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 xiinteractive, 04-09-2024, 08:08 AM
    2 responses
    10 views
    0 likes
    Last Post xiinteractive  
    Started by Irukandji, Today, 09:34 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by RubenCazorla, Today, 09:07 AM
    1 response
    5 views
    0 likes
    Last Post RubenCazorla  
    Started by TraderBCL, Today, 04:38 AM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    11 responses
    1,423 views
    0 likes
    Last Post jculp
    by jculp
     
    Working...
    X