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 samish18, Yesterday, 08:31 AM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by funk10101, Yesterday, 09:43 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    5 responses
    551 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rtwave, 04-12-2024, 09:30 AM
    5 responses
    37 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by funk10101, Today, 12:02 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X