Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

can somebody help?

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

    can somebody help?

    hi, I am not good with coding and what I looking for to figure out is how to develop a strategy where I can put SMA + some range eg
    protected override void Initialize()
    {
    SetProfitTarget ("", CalculationMode.Ticks, 4);
    SetStopLoss ("", CalculationMode.Ticks, 2);
    CalculateOnBarClose = false;
    }
    SMA(close, 4)
    if ( price_is_above_SMA_5_ticks )
    {
    enterlong; //only one time, if price pullback (one tick because second is SL) and cross the fifth tick from SMA again, no more opening position
    }
    if ( price_is_bellow_SMA_5_ticks )
    {
    entershort; //only one time
    }
    Last edited by ninoo; 04-17-2010, 03:51 PM.

    #2
    SMA is a dataseries (an array) you must use an index to a specific value.

    Example

    SMA()[0];

    More specifically

    if ( Input[0] > SMA(20)[0] + (5 * TickSize))
    {
    do something;
    }
    Last edited by Sleeping Troll; 04-17-2010, 05:21 PM.

    Comment


      #3
      ninoo, Sleeping Troll's suggestion is a good place to start. Let us know if you have any other questions.
      AustinNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 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
      573 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X