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

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    5 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X