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

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 kaywai, Today, 06:26 AM
    1 response
    3 views
    0 likes
    Last Post kaywai
    by kaywai
     
    Started by ct, 05-07-2023, 12:31 PM
    6 responses
    202 views
    0 likes
    Last Post wisconsinpat  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    118 responses
    2,779 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  
    Working...
    X