• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by dodo-t, Today, 08:22 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by superg3, Today, 12:33 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by bebbus, Today, 04:50 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by Longhornmark, Today, 06:52 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by yeshujbp, Today, 05:33 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Working...
    X