• 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

Strategy: Plotting from within a NinjaScript Strategy

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

    Strategy: Plotting from within a NinjaScript Strategy

    When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot.

    NinjaTrader 8

    With NinjaTrader 8 we introduced strategy plots which provide the ability for a strategy to render its own plots. These plots must be specific to a single panel just like indicators. If you need to have strategy plots on more then a single panel then please use the technique seen in the attached sample. You can find documentation on the standard methods for plotting in the Indicator help guide section, although the documents are for indicators the plotting items are shared between indicators and strategies.

    You can still use the same technique as NT7 for expanded plotting options or multi panel plotting, the attached sample is a duplication of the original NT7 sample.

    Important related documentation:


    NinjaTrader 7

    The technique involves the use of a custom indicator, StrategyPlot(), that is included in the import.

    Note: This technique has limited functionality. It will NOT work for charts in the Strategy Analyzer during backtesting, but it will work on real-time charts.

    Key concepts in this example:
    • Set values to a blank indicator from a strategy
    • Plot multi-time/instrument values
    • Value.Set()
    • Pen.Width
    • Pen.DashStyle


    Important related documentation:

    Import instructions:

    NinjaTrader 8
    1. Download the file contained in this thread to your PC desktop
    2. From the Control Center window, select the menu Tools > Import > NinjaScript
    3. Select the downloaded file


    NinjaTrader 7
    1. Download the file contained in this thread to your PC desktop
    2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
    3. Select the downloaded file and click Import.
    Attached Files
    Last edited by NinjaTrader_Jesse; 05-25-2016, 09:37 AM.
    JoshNinjaTrader Customer Service

Latest Posts

Collapse

Topics Statistics Last Post
Started by losfer, Yesterday, 07:25 AM
3 responses
12 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by joanmos, Today, 04:17 AM
1 response
2 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by domven, 10-13-2018, 07:03 AM
3 responses
26 views
0 likes
Last Post NinjaTrader_PatrickH  
Started by zextra, Today, 07:20 AM
0 responses
5 views
0 likes
Last Post zextra
by zextra
 
Started by dadarara, Yesterday, 11:42 PM
1 response
6 views
0 likes
Last Post NinjaTrader_PatrickG  
Working...
X