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

Simplest say to determine if SMA1 is above/ below SMA2

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

    Simplest say to determine if SMA1 is above/ below SMA2

    Hi - for NT8 - I would like to find a way to test if SMA1 is above or below SMA2 with 1) each SMA using the same input series --- e.g. 15 minute chart as input for both SMAs..
    2) each SMA using a different input series --- e.g. 200 tick and 1000 tick --- 1 minute and 5 range, etc.

    Thanks for any help or examples.
    Last edited by seeseea; 06-20-2020, 03:51 PM.

    #2
    Hi seeseea, thanks for your question.

    The SampleMACrossover strategy sets up two SMA objects and checks if they cross above or below each other. If you have additional data series, we have a guide on multi time frame scripts here:


    Instead of setting up both the SMA objects on BarsArray[0], initialize the second SMA with BarsArray[1] e.g.

    Code:
    else if (State == State.DataLoaded)
                {
                    smaFast = SMA(BarsArray[0],Fast); 
                    smaSlow = SMA(BarsArray[1], Slow);
    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ScottW, Today, 06:09 PM
    0 responses
    2 views
    0 likes
    Last Post ScottW
    by ScottW
     
    Started by Board game geek, 10-29-2023, 12:00 PM
    14 responses
    244 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Waxavi, 04-19-2024, 02:10 AM
    4 responses
    56 views
    0 likes
    Last Post sonia0101  
    Started by cmtjoancolmenero, Today, 03:58 PM
    0 responses
    9 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by Segwin, 05-07-2018, 02:15 PM
    11 responses
    1,779 views
    0 likes
    Last Post aligator  
    Working...
    X