Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set NT8 not to trade historical bars

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

    How to set NT8 not to trade historical bars

    Hello I am coding a trading strategy that focus of managing and holding a trade after it got a buy/sell signal for another software component. When being connect to live data feed and enable the strategy, many time i will find myself with historical long/short position. If i am not running a simulation then i would like to start my account flat.

    For this i am planning to add to the strategy a checkbox if to trade historical bars or not.

    I am just wondering why there is no such option in every strategy form before enabling it.

    so is there already such an option somewhere instructing NT8 not to trade historical bars?

    #2
    Hello ezrakoper,

    Thanks for your post.

    You can skip historical bar processing in this manner (In OnBarUpdate()):

    if (YourBool == true && State != State.Realtime) return; // do not process below this line if bool checked to skip historical data and not realtime data

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X