Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not recognising conditions are being met.

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

    Strategy not recognising conditions are being met.

    Hi, i am creating a strategy using footprint charts. These footprint charts have plot values i am accessing.
    I have tick replay on.

    However, when i run the strategy, it shows up the historical trades it would have taken but will not recognise the conditions being met when ran live/market replay.
    I have tested the Strategy without any order and just said to paint background if conditions met. Still same thing happens, conditions are met, but the strategy does not carry out the actions.

    This happens when i access plot points one bar ago or more, if i do calculate on each tick and conditions are set to current bar [0], it works but not as intended. I think the strategy is having problem accessing plot data from 1 bar ago 2 bars ago... and so on.

    I have checked the Plots are there for the indicator. Printing the plot values for 1,2,3,4... bars ago are up in the output window.

    My conditions for example are if (stackedImbalance [1]) EnterLong;
    Ran on Calculate.OnEachTick

    I have tried to run OnBarUpdate and/or current bar[0] condition, still does not work.

    All these conditions are under OnBarUpdate()

    This problem has stumped me and have not been able to solve it. I have contacted the developer and i was told to contact Ninja trader. I am hoping you guys are able to help.

    Thank you.

    Click image for larger version  Name:	image.png Views:	0 Size:	122.1 KB ID:	1234107
    Last edited by ishcan; 02-05-2023, 09:01 AM.

    #2
    Hello ishcan,

    Thanks for your post.

    I see you mentioned that you contacted a developer. Was this script created by you or was it created by a third-party developer?

    If this strategy was created by a third-party developer and not by you, the developer must debug the strategy's logic to determine exactly why the script is not behaving as expected.

    If this strategy was created by you, you would need to debug the script to determine exactly why the script isn't behaving as expected.

    There is nothing specific I could advise based on the information shared. Ultimately, if the expected trade(s) are not appearing or actions are triggering, this would indicate that the condition to place the order or actions is not evaluating as true or the order is being ignored for other reasons.

    To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Also, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

    ​Below is a link to a forum post that demonstrates how to use prints to understand behavior.

    https://ninjatrader.com/support/foru...121#post791121

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    57 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X