Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple dataseries

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

    multiple dataseries

    Hello,

    I want to ask please when working with multiple dataseries in a script strategy if this structure will work

    if(Historical)
    return:
    {
    if(BarsInProgress==0)
    {
    {entry conditions and entry}
    }
    if(BarsInProgress==1)
    {
    {exit conditions and exit}
    }
    }

    Is this OK with "{ }" and the other question is if such a structure needs more CPU (I run a lot of forex scripts because of 2 strategies each fx-pair) so this might be important.

    And please: WHERE and HOW is to set for script strategies so that when not using "Historical-return" there will not be an immediate entry when enabling and conditions true. Dont remember. Sorry.

    Thanks
    Tony
    Last edited by tonynt; 08-25-2016, 12:39 AM. Reason: Translation error

    #2
    Hello Tony, and thank you for your questions. You asked,

    Is this OK with "{ }"
    The bolded { and } are completely harmless. Your code will work with or without them in exactly the same way; they do nothing. Provided this is what you wanted, this is fine. It is equivalent to this,

    Code:
    [FONT=Courier New]
    if (Historical)
    {
        return;
    }
    {
        // other stuff here
    }[/FONT]
    You also asked,

    Code:
    WHERE and HOW is to set for script strategies so that when not using  "Historical-return" there will not be an immediate entry when enabling  and conditions true
    To prevent this you will want to do the following

    • Tools -> Options -> Strategies -> NinjaScript -> Check the "Wait until flat before executing live" radio button
    • Select your chart -> Ctrl + S -> Ensure your "sync account position" setting is set to false

    For more information, please review this tips video





    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    305 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    197 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    186 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    274 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    228 views
    0 likes
    Last Post CarlTrading  
    Working...
    X