• 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 Ilpropio, Yesterday, 09:45 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by sgordet, Yesterday, 10:31 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by Revan, Yesterday, 05:44 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by superg3, Yesterday, 07:57 PM
    0 responses
    4 views
    0 likes
    Last Post superg3
    by superg3
     
    Started by Longhornmark, Yesterday, 07:06 AM
    5 responses
    37 views
    0 likes
    Last Post nkhoi
    by nkhoi
     
    Working...
    X