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 attempting to modify historical order that has transitioned . . .

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

    Strategy attempting to modify historical order that has transitioned . . .

    Hi all,

    I have reviewed the Advanced Order Handling section on this issue and have inserted the recommended code into the OnStateChange section of my strategy as follows:

    else if (State == State.Realtime)
    {
    if (entryOrder_1 != null)
    {
    entryOrder_1 = GetRealtimeOrder(entryOrder_1);
    }
    }

    Then in a Strategy Analyzer, I use dates that exclude the current date, thinking that will prevent some code logic regarding submitting live orders bc the present moment is being excluded from the backtester.

    But, I continue to see this alert.

    1. Why are order object issues related to live orders being triggered in a backtester? Shouldn't this piece of code only be relevant in live trading? (Isn't that the whole point of the State.Realtime conditional statement?)

    2. What am I doing wrong here? I need the error to not trigger so that I can see results in the Strategy Analyzer window for troubleshooting.

    Thanks for any help,
    Tim


    #2
    Hello Tim,

    I would not expect this error for a strategy tested in the Strategy Analyzer.

    Are you able to reproduce with the SampleMACrossOver included with NinjaTrader?

    If not, may I test a script that is able to reproduce?

    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter a unique name for the file in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.
    http://ninjatrader.com/support/helpG...-us/export.htm
    Once exported, please attach the file as an attachment to your reply.

    I look forward to receiving the export.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea,

      How can I get you the script file privately? Posting here is not something I will do.

      Thanks!

      Comment


        #4
        Hello Tim,

        The NinjaTrader support email is platformsupport [at] ninjatrader [dot] com.

        Below is a link to the Contact Us page on the NinjaTrader website.
        If you have any questions, concerns or feedback, or want to open an account, we're here to help. Click here to find the appropriate contact for your needs!


        However, if you could strip out any custom logic, or just make a new very simple test script that can reproduce the behavior, this can help anyone who may have a similar issue and finds this forum thread and would be highly appreciated.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        603 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        22 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        21 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        230 views
        0 likes
        Last Post TradingLoss  
        Working...
        X