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

CrossAbove in multitimeframe conditions

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

    CrossAbove in multitimeframe conditions

    Sorry
    solved it myself.


    a little confused , please advise

    the code bellow doesn't trigger at all.

    I am trying to set a stop based on crossabove or crossbelow SMA
    and I have multitimeframe. the exit on stop i want to activate based on the higher time interval. which is BarsInProgress = 0

    if (condition1== true)
    {

    if ( (Position.MarketPosition == MarketPosition.Long && CrossBelow(Low,SMA(10)[0],1)
    || (Position.MarketPosition == MarketPosition.Short && CrossAbove(High,SMA(10)[0],1) ))
    {
    ExitLong();
    ExitShort();
    }
    }
    Last edited by dadarara; 08-17-2018, 01:29 PM.

    #2
    Hello dadarara,

    Thank you for your post and your update.

    Can you detail what did to resolve this matter in your script? Was it the implementation of the BarsArray for your indicator? Was it the use of the 'Lows' and 'Highs' with the proper BarsArray index? Or perhaps it was the inclusion of the BarsInProgress check?

    You can find details on using multiple time frames and instruments in your code at the following link: https://ninjatrader.com/support/help...nstruments.htm

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    2 views
    0 likes
    Last Post DanielTynera  
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    40 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    10 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Working...
    X