Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check variable value in the strategy

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

    Check variable value in the strategy

    Hello guys! There is variable in strategy that get value from this strategy. I need to find some problem and use Print in strategy. But strategy get stuck. As I understand because variable doesn't have some value from the start. How to avoid this moment?

    if (var>0) didn't help.

    I need to check entryOrder.StopPrice and OrderPriceShort, that get value as instrument price.

    #2
    Alexstox,

    Thank you for your post.

    What do you mean by gets stuck?

    What exactly is the variable used for in the script?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Alexstox,

      Thank you for your post.

      What do you mean by gets stuck?

      What exactly is the variable used for in the script?
      Variables: entryOrder.StopPrice and OrderPriceShort. So, in the beginning of backtesting after some conditions entryOrder.StopPrice can get no value and script can stuck because Print() still want to print value of entryOrder.StopPrice.

      Comment


        #4
        Alexstox,

        Can you please provide your script so I can look into this further
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        151 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        303 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        244 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        345 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        175 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X