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

Test multiple strategies with market replay

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

    Test multiple strategies with market replay


    Hi,
    I am trying to test the same strategy with 3 different parameter sets on a specific asset using market replay
    each entry position has also stop loss and profit target orders
    When all of the strategies get entry signal at the same time, all of them is getting executed but right after that two of them exits with sell market command,
    what could be the reason ?

    Thanks​

    Attached Files

    #2
    Hello yaniv,

    Likely, a condition in the script has evaluated as true and submitted the sell market order.

    To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the date time of the bar and all values compared in every condition that places an order.
    The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for this action to be triggered. It is very important to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.

    Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Further, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

    I am happy to assist you with analyzing the output from the output window.

    Run or backtest the script and when the output from the output window appears save this by right-clicking the output window and selecting Save As... -> give the output file a name and save -> then attach the output text file to your reply.

    Below is a link to a forum post that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.
    https://ninjatrader.com/support/foru...121#post791121

    Please let me know if I may further assist with analyzing the output or if you need any assistance creating a print or enabling TraceOrders.​
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks,
      But as you can see in the "Name" column, for each order i send, i give a specific name, the name "Sell" in not one of my strategy orders names, that is how I know that the sell orders was not send from my strategy
      ​I am already using print log
      Enabling "TraceOrders" will also print to the output window ?

      Comment


        #4
        Hello yaniv,

        Yes, TraceOrders also prints to the NinjaScript Output window.

        The order is showing the strategy name, implying the order came from the strategy.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,403 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        94 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X