• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 lunardiplomacy, Today, 07:57 AM
            0 responses
            2 views
            0 likes
            Last Post lunardiplomacy  
            Started by Tagliareni, Yesterday, 08:10 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by SDaCosta30, Today, 04:19 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by memonolog, Today, 02:39 AM
            5 responses
            24 views
            0 likes
            Last Post memonolog  
            Started by memonolog, Today, 07:07 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X