Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    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?
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,983 views
        3 likes
        Last Post jhudas88  
        Working...
        X