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 tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Working...
        X