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

Plotting from Strategy scipt in NT8

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

    Plotting from Strategy scipt in NT8

    Hello NT8,

    I am not s skillful programmer.

    I am using NT7 currently on live-trading from more than 2 years.
    Now I am thinking to migrating slowly to NT8, and start trying the strategy script for NT8.

    I need help on how to plot from strategy script on NT8.
    In particular, this is the main plotting part of my strategy script in NT7:
    ===========================

    Add(StrategyPlot(0));
    Add(StrategyPlot(1));
    Add(StrategyPlot(2));
    Add(StrategyPlot(3));
    Add(StrategyPlot(4));
    Add(StrategyPlot(5));

    // Set the color for the indicator plots
    //StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
    StrategyPlot(0).Plots[0].Pen.Color = Color.White;
    StrategyPlot(0).Plots[0].Pen.Width = 3;
    StrategyPlot(1).Plots[0].Pen.Color = Color.Red;
    StrategyPlot(2).Plots[0].Pen.Color = Color.Pink;
    StrategyPlot(3).Plots[0].Pen.Color = Color.GreenYellow;
    StrategyPlot(3).Plots[0].Pen.Width = 2;
    StrategyPlot(4).Plots[0].Pen.Color = Color.Yellow;
    StrategyPlot(5).Plots[0].Pen.Color = Color.Black;

    // Set the panel which the plots will be placed on. 1 = price panel, 2 = panel under the price panel, etc.
    StrategyPlot(0).PanelUI = 1;
    StrategyPlot(1).PanelUI = 2;
    StrategyPlot(2).PanelUI = 3;
    StrategyPlot(3).PanelUI = 1;
    StrategyPlot(4).PanelUI = 4;
    StrategyPlot(5).PanelUI = 3;

    ====================

    Basically I am plotting 6 lines with values from the strategy script (not data-series values) into 3 (new) additional panel below the price-chart. Some of the lines are plotted in the price-data-series panel.

    Now I am struggling to write a simple direct NT8 script for the plotting part.
    Your help with sample working script (if any) of similar topic is very much helpful.
    ( I cannot get full understanding to apply from the sample script "SampleStrategyPlot").

    Thank you

    #2
    Hello Gustirai,

    Thank you for the post.

    We have a sample for NT8 that replaces the original strategy plot example here: https://ninjatrader.com/support/foru...ead.php?t=6651

    In NT8, rather than configuring the indicators directly from the strategy, it is suggested to create multiple indicators and have the strategy add each of them. In the NT8 strategy plot sample, two indicators are supplied with it. One uses IsOverlay = true, the other does not. This causes one indicator to plot in the price panel and one to create a new panel.

    Alternatively, strategies now have access to use indicator Plots and drawing methods directly so indicators may not be needed to plot simple data.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse,

      Thank you for the feeddback.

      Yes I did try that sample called "SampleStrategyPlot" which has relation with indicators called "SampleOverlayPlot" and "SamplePanelPlot". And I guess due to my lack of programming skills I still could not revise or adopt them to my strategy script.

      Could you help by revising the script called "SampleStrategyPlot" into the one called "SampleGustiRai" and still performing exactly the same function (perhaps is a syntax problem that i have so far).

      Regards

      Comment


        #4
        Hello Gustirai,

        What specific problems were you having when trying to make your own variation of the sample? Was it the strategy code or understanding how the indicators were used? While I wouldn't be able to create this item for you, I can try to help you better understand where your test deviated from the sample.

        The two indicators that are supplied with the sample are simply placeholders. They define if the data to be displayed should be in a new panel or the price panel, that basically all they are for. You dont need both, if you only wanted new panels for example, you would just use the indicator that defines IsOverlay = false;.

        The strategy will add various combinations of these placeholder indicators to achieve the desired result. In the end, the strategy would do all of the calculations and pass that to the placeholder indicator for plotting.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by samish18, Yesterday, 08:31 AM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by funk10101, Yesterday, 09:43 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        5 responses
        551 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by rtwave, 04-12-2024, 09:30 AM
        5 responses
        37 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by funk10101, Today, 12:02 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X