Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X