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 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