• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 tonynt, Today, 02:48 AM
    0 responses
    5 views
    0 likes
    Last Post tonynt
    by tonynt
     
    Started by cls71, Today, 02:11 AM
    1 response
    10 views
    0 likes
    Last Post bkool
    by bkool
     
    Started by RB104, Today, 01:52 AM
    0 responses
    4 views
    0 likes
    Last Post RB104
    by RB104
     
    Started by reks13, Today, 01:52 AM
    0 responses
    5 views
    0 likes
    Last Post reks13
    by reks13
     
    Started by raffu, Today, 01:35 AM
    1 response
    12 views
    0 likes
    Last Post raffu
    by raffu
     
    Working...
    X