Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    44 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    65 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X