• 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 albertokeira, Today, 09:30 AM
    0 responses
    3 views
    0 likes
    Last Post albertokeira  
    Started by U0000999, Today, 05:44 AM
    0 responses
    7 views
    0 likes
    Last Post U0000999  
    Started by lakman184, Today, 05:41 AM
    0 responses
    9 views
    0 likes
    Last Post lakman184  
    Started by MarkFrench1991, Today, 03:47 AM
    0 responses
    9 views
    0 likes
    Last Post MarkFrench1991  
    Started by EddyEd, Today, 03:47 AM
    0 responses
    8 views
    0 likes
    Last Post EddyEd
    by EddyEd
     
    Working...
    X