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

Possible error in data with strategy

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

    Possible error in data with strategy

    Yesterday something curious happened to me, I have a very well defined strategy, it is not a complex strategy. He took an entry when he shouldn't have done so because of the logic of the strategy, there are 2 rules that he breaks. Today after reviewing yesterday, I downloaded the history to repeat the operation with the strategy, and it has not been taken, I had to modify the 2 variables for which I should not have entered it yesterday to force it to enter the market.

    The time is just the opening 9:32, or if this is influenced by volatility, but the problem is that the entry is executed taking into account the previous candle, which is already closed and it is where the variables that should have been collected are prevented entry

    How could I check what the error was? since the logic of the strategy is very clear and in playback connection it works perfectly, this error made me lose some money, this may not matter but I do not want it to happen again

    #2
    Hello RubenCazorla,

    Thank you for your post.

    CRITICAL — If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

    When you ran your strategy yesterday, was it calculating On Bar Close, On Price Change, or On Each Tick? When testing in Playback, be sure to select the same calculation mode. I am curious because you mentioned that "the entry is executed taking into account the previous candle" - that sounds like it could have been calculating On Bar Close when you were potentially expecting it to make intrabar calculations.

    The next step I would suggest is to add debugging prints to your strategy to confirm which order submission methods are being reached. You mentioned that you had to modify two variables to get it to enter the market in your testing. Adding print statements showing the time and the values of the variables both inside and outside of your conditions that trigger the entries will tell you how the condition evaluates. These prints will show up in the NinjaScript Output window for you to monitor while testing in Playback. If you see any unexpected values for your variables in the prints, that could help to narrow down what might have happened while running your strategy yesterday.

    Here is a great resource with additional helpful links about debugging steps and adding debugging prints:


    Please let me know if I may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    6 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Working...
    X