• 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

Adding plot to existing indicator ?

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

    Adding plot to existing indicator ?

    I wanted to add a plot to one of the Ninja indicators. So copy and rename, but what's simple for me on other software is hard for me on Ninja.

    For example on TOS taking the existing " Dailyopen " indicator and adding a fixed percentage line like .

    def Mopen = DailyOpen;
    plot H1H = (Mopen * 0.005)+mopen;
    plot Open = Mopen;

    and you done.

    So using the " CurrentDayOHL " as a starting point it looks like you'd have to " add(new Plot....etc, and or difine something in variables ? Looking for a fixed percentage above or below the Open.
    If this is real difficult I can live without it
    but was hoping maybe a couple lines of code and it could be done.
    Thanks in advance.












    #2
    T2020, correct you would need to do a 'save as' here first, just right click in the indicator code to do this and assign a new name to the copy created for you.

    Next step would be added a plot for your pupose in the Initialize() section of the script.

    Now you would need to create a public property for your plot in the 'Properties' region of the script, you can just copy over an existing one for taking the structure needed but be sure to change the names and Values[x] series assignments for your new plot accordingly (Values would just be the array of data values stored for your script, if you add a new plot in this would increase it's depth, so if you were at Values[4] before, you would 'link' the new plot to Values[5] now)

    Once done, you can .Set a value / do calculations for your new plot.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RB104, Today, 06:06 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by jtrading82, 05-25-2018, 09:59 AM
    9 responses
    977 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by syxforex, Today, 12:11 AM
    2 responses
    15 views
    0 likes
    Last Post syxforex  
    Started by aslane, Today, 02:31 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by stoner, 10-16-2019, 01:38 PM
    5 responses
    51 views
    0 likes
    Last Post sledge
    by sledge
     
    Working...
    X