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:
    https://ninjatrader.com/support/foru...ing#post791121

    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 AlexEro, Today, 12:29 AM
    0 responses
    3 views
    0 likes
    Last Post AlexEro
    by AlexEro
     
    Started by Vincere, 01-20-2019, 08:42 AM
    13 responses
    330 views
    0 likes
    Last Post AlexEro
    by AlexEro
     
    Started by bltdavid, 12-01-2022, 07:59 PM
    10 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by StealthM93, Yesterday, 11:09 PM
    0 responses
    1 view
    0 likes
    Last Post StealthM93  
    Started by digibob, 11-22-2020, 10:59 PM
    3 responses
    110 views
    0 likes
    Last Post FutureDragon  
    Working...
    X