Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter positions only after script has been started

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

    Enter positions only after script has been started

    How can a script be coded to avoid having positions entered when script is started on a chart and chart contains past data which would have met entry (and exit) criteria already in the past? In other words, the first entry should only be possible at or after the script was launched.

    #2
    Hello BillCh,

    I suggest to review the information at the forum thread below.


    You will need to use:

    if (Historical)
    return;
    JasonNinjaTrader Customer Service

    Comment


      #3
      Thanks Jason

      When I put this at the beginning of my OnBarUpdate() loop I assume it just returns and loops until live data is being processed, so no "executions" on historical data. But I assume that a lookback period would still work on the first live bar, like SMA(14), as long as at least 13 histroical bars are available, right?

      Btw, your reference is a link to this thread here, I guess you wanted to refer to another link?

      Comment


        #4
        Hello BillCh,

        I see . Please see the link below.


        Correct, it will loop and return on historical data in your chart.
        JasonNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,262 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,429 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, 04-16-2024, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        41 views
        0 likes
        Last Post jeronymite  
        Working...
        X