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

Strategy sends orders to the market even when Historical=true

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

    Strategy sends orders to the market even when Historical=true

    Hi there,

    II have a strategy that does a very strange thing:
    it says orders to the exchange (real orders, to real exchange) when Historical=true.

    1) Is this normal?

    2) How can I then make a difference in ninjascript between orders sent in backtest and realtime strategy run?

    Thanks!

    #2
    Hello nicanor.babula,

    Thanks for your post.

    No, that would not be expected.

    Can you clarify how you are observing that real orders are sent when Historical is true? Please provide a screenshot of your observations.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi there,

      I am simply reading the console output.

      I put a
      Code:
      Print("Historical=" + Historical)
      right after the call to
      Code:
      EnterLongStopLimit(..)
      There's not much to show, really.

      The strategy runs on 2 series (for futures):
      main: 1 tick
      secondary: 1 day bars

      Comment


        #4
        Hello nicanor.babula,

        Thanks for your reply.

        A strategy will place historical orders on historical data. These are not sent to the exchange, they are in your PC only and show you what the strategy would have done.

        Live/real-time orders placed by the strategy would show in the "executions" tab of the control center. If the strategy is connected to the Sim101 account then the orders would remain in your PC to be filled through the simulation engine. Only when the strategy is connected to your live account would live orders be sent to the exchange.

        If you do not want your strategy to place historical orders you can add following as the first line of code in the OnBarUpdate() method:

        if (Historical) return;
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the answer, but I can tell if an order is real or not. This was not backtesting, but real.

          I added the strategy in the strategies tab, enabled it for live, then in the console I saw the log saying that the order has been sent and Historical=true and then I saw the order in the orders tab with status accepted.

          I mean, the order ended up in the orders tab of the control center.

          Please advise.

          Comment


            #6
            Hello nicanor.babula,

            Thanks for your reply.

            Please write into PlatformSupport[at]NinjaTrader[dot]Com In the e-mail please attach your log and trace files as well as a screenshot of the Orders tab. In the subject line, please add Atten:Paul and a link to this thread.

            Please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.

            Open your NinjaTrader folder under Documents.
            Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
            Send the 2 compressed folders as attachments to this email.
            Once complete, you can delete these compressed folders.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PhillT, Today, 02:16 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Kaledus, Today, 01:29 PM
            3 responses
            9 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frankthearm, Yesterday, 09:08 AM
            14 responses
            47 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by gentlebenthebear, Today, 01:30 AM
            2 responses
            13 views
            0 likes
            Last Post gentlebenthebear  
            Started by PaulMohn, Today, 12:36 PM
            2 responses
            17 views
            0 likes
            Last Post PaulMohn  
            Working...
            X