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 WHICKED, Today, 12:45 PM
    2 responses
    16 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by GussJ, 03-04-2020, 03:11 PM
    15 responses
    3,272 views
    0 likes
    Last Post xiinteractive  
    Started by Tim-c, Today, 02:10 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    2 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    51 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X