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

IntraBar Condition

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

  • manueldecastro
    replied
    Gracias Brandon. solucioné el error usando otras condiciones. se puede cerrar el hilo

    Leave a comment:


  • NinjaTrader_BrandonH
    replied
    Hello manueldecastro,

    Thanks for your notes.

    Have you added debugging prints to the script to understand exactly how your logic is evaluating?

    To understand why the script is behaving as it is, such as drawing objects or not 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 script 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).

    See this NinjaTrader Support article for information about using Print() to understand the behavior of a script: https://support.ninjatrader.com/s/ar...nd-TraceOrders

    Leave a comment:


  • manueldecastro
    replied
    Originally posted by NinjaTrader_BrandonH View Post
    Hello manueldecastro,

    Thanks for your post.

    The condition you shared would correct to detect if the current Low price is less than the previous Low price.

    That would also be correct logic for checking if the current High price is greater than the previous High price.

    If the script has the Calculate mode set to Calculate.OnBarClose, the OnBarUpdate() logic will only process at the close of a bar.

    To have logic calculate intrabar, you could set the Calculate mode to Calculate.OnPriceChange or Calculate.OnEachTick.

    Calculate.OnPriceChange would have OnBarUpdate() logic process for each change in price. Calculate.OnEachTick would have OnBarUpdate() logic calculate for each incoming tick.

    See this help guide page for more information about Calculate: https://ninjatrader.com/support/help.../calculate.htm

    To understand how your logic is behaving, debugging prints need to be added to the script. Add prints one line above the conditions that print out all the values being used in the condition along with the Time of the bar. Prints will appear in a New > NinjaScript Output window.

    See this NinjaTrader Support article for information about using Print() to understand the behavior of a script: https://support.ninjatrader.com/s/ar...nd-TraceOrders
    Hi Brandon,
    Im working OneachTick.

    Leave a comment:


  • NinjaTrader_BrandonH
    replied
    Hello manueldecastro,

    Thanks for your post.

    The condition you shared would correct to detect if the current Low price is less than the previous Low price.

    That would also be correct logic for checking if the current High price is greater than the previous High price.

    If the script has the Calculate mode set to Calculate.OnBarClose, the OnBarUpdate() logic will only process at the close of a bar.

    To have logic calculate intrabar, you could set the Calculate mode to Calculate.OnPriceChange or Calculate.OnEachTick.

    Calculate.OnPriceChange would have OnBarUpdate() logic process for each change in price. Calculate.OnEachTick would have OnBarUpdate() logic calculate for each incoming tick.

    See this help guide page for more information about Calculate: https://ninjatrader.com/support/help.../calculate.htm

    To understand how your logic is behaving, debugging prints need to be added to the script. Add prints one line above the conditions that print out all the values being used in the condition along with the Time of the bar. Prints will appear in a New > NinjaScript Output window.

    See this NinjaTrader Support article for information about using Print() to understand the behavior of a script: https://support.ninjatrader.com/s/ar...nd-TraceOrders

    Leave a comment:


  • manueldecastro
    started a topic IntraBar Condition

    IntraBar Condition

    I need to make a condition for when the following is met.
    A candlestick should have a lower low than the previous one and then have a higher high than the previous one.

    I've tried the following code but it doesn't draw the signals for me correctly. Could you give me some ideas?

    bool signal = false;
    if (Low[0]<Low[1])
    {signal = true;}

    if (signal==true && High[0]>High[1])
    {Draw.ArrowDown(this, @"Signal " + CurrentBar, false, 0, High[0]+2, Brushes.Blue);}

    I need the signal to be drawn when the price goes down from low1 and then exceeds high1. The current candlestick may have made a higher high than high1 before dropping below low1.

    Thanks!

Latest Posts

Collapse

Topics Statistics Last Post
Started by TiffanyMiller, Today, 10:19 PM
0 responses
2 views
0 likes
Last Post TiffanyMiller  
Started by JackyP, 07-25-2023, 08:39 AM
2 responses
310 views
0 likes
Last Post j4trdr
by j4trdr
 
Started by algospoke, 05-13-2024, 06:53 PM
12 responses
132 views
0 likes
Last Post algospoke  
Started by psangram, Today, 06:35 PM
0 responses
4 views
0 likes
Last Post psangram  
Started by Alaina19, Yesterday, 04:38 PM
2 responses
16 views
0 likes
Last Post Alaina19  
Working...
X