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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    148 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X