Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MTF Strategy SMA Typical, Rising

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

    MTF Strategy SMA Typical, Rising

    I want to compare if SMA is rising on Lower (1 Minute) and Higher Time Frames (3,5,15), but not the Close type but the "Typical" type - could anyone help me, please??

    protected override void Initialize()
    {
    SetProfitTarget("", CalculationMode.Ticks, TP);
    SetStopLoss("", CalculationMode.Ticks, SL, false);
    Add(PeriodType.Minute, 3);
    Add(PeriodType.Minute, 5);
    Add(PeriodType.Minute, 15);
    CalculateOnBarClose = false;
    }


    protected override void OnBarUpdate()
    {
    if (
    Rising(SMA(Typical, 1)) == true
    && Rising(SMA(Typical, 3)) == true
    && Rising(SMA(BarsArray[1], 3)) == true // <---- I want to check type "Typical", not type "Close"
    && Rising(SMA(BarsArray[2], 3)) == true // <---- I want to check type "Typical", not type "Close"
    && Rising(SMA(BarsArray[3], 3)) == true // <---- I want to check type "Typical", not type "Close"
    && SMA(Typical, 1)[0] > SMA(Typical, 3)[0] // <---- This I want to check on higher TF, too, but how with type "Typical" ????
    && Rising(EMA(13)) == true
    && Rising(SMA(20)) == true
    && Rising(SMA(50)) == true
    && EMA(13)[0] > SMA(20)[0]
    && (EMA(BarsArray[1], 13))[0] > (SMA(BarsArray[1], 20))[0]
    && (EMA(BarsArray[2], 13))[0] > (SMA(BarsArray[2], 20))[0]
    && Position.MarketPosition == MarketPosition.Flat
    && (Opens[3][0] < Closes[3][0])
    && Low[0] <= EMA(13)[0] + 1 * TickSize
    )
    {
    EnterLong(DefaultQuantity, "");
    }
    }

    #2
    resist, instead of pointing to the BarsArray for the series to 'grab' for calculation, you can just use Typicals for your task - http://www.ninjatrader.com/support/h...7/typicals.htm

    Comment


      #3
      SMA typical + only 1 trade each bar

      Thank you!!!!

      I m not sure if the result will be the same.
      I want to check
      if the SMAs(Typical, 1 and 3) of the HigherTimeFrames are Rising.
      I´m wondering if it´s enough to check that the SMAs of the HTFs are rising at all, calculated "Standard".


      Additional question.
      I want my strategy only to make one trade each bar.
      I put in the Variables area "private int Notrade" and condition is checked:

      if Notrade != CurrentBar
      {
      EnterLong(DefaultQuantity, "");
      Notrade = CurrentBar;
      }

      but strategy opens (COBC false) after Takeprofit a new trade in same bar - that´s not wanted. What can I do

      Comment


        #4
        Do you mean, you're not sure if using Typical would make a noticeable difference in your results? Only testing could tell you that.

        In which BarsInProgress do you run this check and entry point?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        66 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X