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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      47 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      15 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      21 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      23 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X