Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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;
    BertrandNinjaTrader Customer Service

    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.

        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        10 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        8 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        385 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X