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 inanazsocial, Today, 01:15 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X