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

How to run a strategy and see results

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

    How to run a strategy and see results

    A very simple minded question.

    I just set up my first strategy which is a MA crossover. After I connect to market replay or real time data feed and right click on the chart, I can select strategy. I select my strategy. Click OK. How to run a test and get trading results?

    Thank you.

    #2
    Hello Benluk,

    Thank you for your post.

    Please ensure the Strategy property Enabled is set to true so that the strategy is active and running.

    Right click on the chart and select Strategies...

    Select the added strategy and ensure the property Enabled is set to true.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      I set ENABLED to true on the selected strategy. It does not stay. So I hard code Enabled = true.

      Then I carry on running the market replay. Still do not see orders executed and the results in Control Center. What did I do wrong?

      Comment


        #4
        Benluk,

        Are there any errors in the Log Tab of the Control Center after enabling the strategy?

        Would you mind sharing the strategy, so I could test this on my end?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Benluk View Post
          I set ENABLED to true on the selected strategy. It does not stay. So I hard code Enabled = true.

          Then I carry on running the market replay. Still do not see orders executed and the results in Control Center. What did I do wrong?
          Hard-coding Enabled is not a viable method of forcing a strategy to run. You mention that you are using Market Replay. If so, make sure that you are using the correct account : Replay101.

          Comment


            #6
            I see executions now. Not sure what I did differently this time.
            After connection, I see errors logged. See attached. Is it normal or an issue?
            The execution is not realistic, I need to learn how to enter or exit orders strategically. For example, enter a long order at Ask minus 2 ticks, or enter a long order with 2 contracts but one exits first, etc.

            Is there any references or examples that I can model or learn from?

            From Strategy tab, I see Sim 101 and Replay 101. What are they? The one Replay 101 has connection which I just tested successfully. The one Sim 101 does not have connection, which I think it failed. When to use what? See attached.

            Thank you in advance for all the help.
            Attached Files

            Comment


              #7
              Benluk,

              The Sim101 and Replay101 are the simulation accounts for NinjaTrader. The Sim101 is used with real-time data order submission. The Replay101 is used when connected to the Market Replay Connection

              As for the errors, please check your references for your scripts in that you are calling the correct DLL

              Open a NinjaScript Editor, Tools -> Edit NinjaScript -> Indicator
              Select a random indicator
              Right click in the editor and select References
              You need to check for a reference to NinjaTrader.Vendor.dll

              If you see it, select it and delete it. Re-add it back in by going to Add
              This will open a file search window in the NinjaTrader Custom folder, in which you will see the same NinjaTrader.Vendor.dll
              Select it and click ok to add the reference.

              Let me know if I can be of further assistance.
              Cal H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by JesseOffshore, Today, 09:40 PM
              0 responses
              1 view
              0 likes
              Last Post JesseOffshore  
              Started by WHICKED, 04-26-2024, 12:56 PM
              4 responses
              138 views
              0 likes
              Last Post WHICKED
              by WHICKED
               
              Started by ezrollin, 02-26-2022, 11:14 PM
              7 responses
              207 views
              0 likes
              Last Post kenz987
              by kenz987
               
              Started by rocketman7, Today, 08:34 PM
              0 responses
              4 views
              0 likes
              Last Post rocketman7  
              Started by rt61968, 02-17-2018, 05:24 PM
              3 responses
              2,736 views
              0 likes
              Last Post MasterEtrad3  
              Working...
              X