Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to plot Downtrend or Uptrend Lines in Supertrend indicator for current Bar?

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

    How to plot Downtrend or Uptrend Lines in Supertrend indicator for current Bar?

    Hello,
    I am new to ninja trader script. I found supertrend indicator on ninja forum.My question is how to plot Uptrend or Downtrend Signal lines for Current Ongoing plot?
    Suppose I am using 5 min bar chart,for every current streaming bar , trend lines shows upto previous closed bar not for the current bar.
    I found in the script written as "plot below by replacing 'Close[0]' with your own formula".
    So should i Change Close[0] with Open[0],so that trend lines will appear for current bar?
    Also script is attached below.
    Attached Files

    #2
    Hello smith1309,

    Thanks for writing in.

    Changing the Price series from Close to Open would not be the same as calculating the current bar. The bar used for the indicator calculation will still be created upon the close of a bar, and Open[0] will always be the Open of the bar that just closed when calculating with CalculateOnBarClose=true.

    Have you tried enabling the script with CalulateOnBarClose=false? This will allow the indicator to calculate the plot for the current developing bar with each in coming tick. The indicator would have to be developed with this functionality in mind, however.

    I've included publicly available documentation on CalculateOnBarClose.

    CalculateOnBarClose - https://ninjatrader.com/support/help...onbarclose.htm

    For setting up plots in a NinjaTrader 7 indicator, I recommend following the tutorial found here: https://ninjatrader.com/support/help...ot_colors_.htm

    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kevinenergy, 02-17-2023, 12:42 PM
    118 responses
    2,778 views
    1 like
    Last Post kevinenergy  
    Started by briansaul, Today, 05:31 AM
    0 responses
    9 views
    0 likes
    Last Post briansaul  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    8 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X