Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Assistance for strategy creation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Assistance for strategy creation

    Hello to you all

    I am trying to backtest a strategy that consists in the following:

    e-mini SeP daily bars chart whith 3 indicators: EMA(4), EMA(8) and SMA(18)

    The conditions for a long possition are: If close Price>EMA(4)>EMA(8)>SMA(18), for 3 consecutive candles. Execute a long position in the 4th candle opening Price.

    The stop is equal to the profit and its triggered when the Price crosses the SMA(18) line.

    The conditions for the short position are the exact oposite.

    I have already made a strategy that plots a Green triangle up or a red triangle down, when the conditions are filled, but i dont know how to count the triangles and execute the order in the fourth triangle.

    If anyone can assist me, i will be glad

    Best regards

    Joăo from Portugal

    #2
    Hello Joăo,

    Thanks for your note.

    Is this a Strategy you have created with the Strategy Wizard?

    The action needed here is to have an integer which you increment when an arrow is drawn.

    This is not within the abilities of the Strategy Wizard and will have to be done in the code for this strategy.

    For example:
    Code:
    #region Variables
    private int arrowsDrawn = 0;
    #endregion
    
    private OnBarUpdate()
    {
    if (// conditions to draw the arrow would be here)
    {
    if (arrowsDrawn = 4)
    {
    // code to submit order would go here
    arrowsDrawn = 0; // reset the variable when it is on the 4th arrow
    }
    else
    {
    arrowsDrawn++;
    }
    }

    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    656 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    371 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X