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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X