Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical orders

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

    Historical orders

    Hi!
    Can you tell me please, is there any ability do not submit the historical orders, when I attach the strategy to a chart? In other way, I need start trading from "clean sheat". I don't care about the orders should placed before the time I attached a strategy to a chart! May be there is some options about that? I tried to clear all db and account information, but it didn't help.

    #2
    ilyats, you could just start your strategy OnBarUpdate() with

    if (Historical) return;

    Comment


      #3
      Thanks Bertran, it works. But what to do with backtesting? There are no orders submitted in backtests if I use this code. Should I and one more extern bool variable to identify whether is the strategy is used in backtests or in real?

      Comment


        #4
        Correct, this would be realtime use only - another approach is removing the historical check and starting your strategy in 'WaitUntilFlat' mode - this would then take the first realtime generated signal and don't take into consideration any historically taken over orders / positions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X