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 ahead of current time

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

    plotting ahead of current time

    is there a way to use plotStlye parameter in drawings?

    I made a histogram using lines ahead of time but I would Like to use plotstyle.
    Is there a way to use plotstyle in the future time reference and if not what is a good solution?
    Attached Files

    #2
    Hello ballboy11,

    Thanks for opening the thread.

    I am not entirely sure I understand your question.

    Do you mean you have made plot values into the future and have used lines for future slots? Are you doing this through displacement?

    I would not know a supported way to assign "future plot values." PlotStyles also cannot be changed dynamically.

    You may be able to accomplish using separate Plots and PlotStyles for the same set of data. When you want to change the visiable PlotStyle, set the Plot's brush to Brushes.Transparant and set the other plots brush to the color you would like to see.

    Could you provide more detail if you have not resolved your inquiry?
    JimNinjaTrader Customer Service

    Comment


      #3
      I understand that plots are for historical up to current time and after current time you can draw ahead.
      Dashstlye is available for drawings but plotstyle is available for plots. Is there a way a drawing can access plot style?

      Comment


        #4
        Hi,

        I'm also interested in doing this. I'm working on an Ichimoku indicator that requires plots 26 periods ahead.

        -C

        Comment


          #5
          Hello claude1 and ballboy11,

          Displacement can be used to offset plots into the future, or SharpDX can be used to draw directly into each bar slot. I'll include documentation links on Displacement and SharpDX Rendering.

          As for PlotStyles, there is not much information I can share as they are undocumented. However, I can say that there would not be a way to use a PlotStyle as a DashStyleHelper for a drawing object, since plots and drawing objects are inherently different.

          Displacement - https://ninjatrader.com/support/help...splacement.htm

          Using SharpDX for Custom Rendering - https://ninjatrader.com/support/help..._rendering.htm

          Example Ichimoku Cloud indicator that uses SharpDX - https://ninjatrader.com/support/foru...tid=-1&lpage=1

          Please let me know if I can be of further help.
          JimNinjaTrader Customer Service

          Comment


            #6
            Does displacement work on NT7 and second can one displace dynamically?

            Comment


              #7
              Hello ballboy11,

              Yes, Displacement can be used in NinjaTrader 7. This cannot be set dynamically and must be set in Initialize() (NT7) or State.SetDefaults (NT8)

              Public documentation for NinjaTrader 7 can be found here: https://ninjatrader.com/support/help...splacement.htm

              Please let me know if I may be of further assistance.
              JimNinjaTrader Customer Service

              Comment


                #8
                I'm trying to use an indicator in a strategy. If I set displacement in the indicator and add the indicator onto a chart, the displacement works. But if I add that indicator in a strategy and run the strategy in the strategy analyzer it does show any displacement.

                I've also tried to do this in the strategy
                PHL = PredictedHL(3,14,0.42);
                PHL.Displacement = 1;
                PHL.Calculate = Calculate.OnPriceChange;
                AddChartIndicator(PHL);

                What do I need to do to make that work in a strategy?

                I can't get the Calculate.OnPriceChange to work either. So I'm not getting my indicator plot on the last bar. Any suggestions on that would also be helpful.

                Comment


                  #9
                  Time forward one must use drawing objects

                  Comment


                    #10
                    Hello dynoweb,

                    Thank you for your note.

                    Within the strategy analyzer, if you display the chart, then drag the chart to the left so that you can see in the future, do you see the plot continue past the current bar? For example I have circled this in red in the attached screen shot.

                    What version of NT8 are you using, under Control Center>Help>About?

                    I look forward to your reply.
                    Attached Files
                    Alan P.NinjaTrader Customer Service

                    Comment


                      #11
                      I upgraded my version to 8.0.12.0 64-bit version. I still see the problem. I'll attach the indicator and the strategy with everything else cleaned out of it.


                      PredictedHIStrategy.cs

                      PredictedHL.cs

                      Click image for larger version

Name:	Chart.PNG
Views:	1
Size:	37.8 KB
ID:	886218

                      Click image for larger version

Name:	Strategy.PNG
Views:	1
Size:	62.8 KB
ID:	886219

                      Comment


                        #12
                        Hello dynoweb,

                        Displacement will only be applied to the top most NinjaScript. Since NinjaTrader 8 strategies incorporate their own plots, the behavior is slightly different than NinjaTrader 7.

                        You may set the Displacement property on the strategy itself to have displacement take place on any indicators added to that strategy.

                        Please let me know if this does not resolve your inquiry.
                        JimNinjaTrader Customer Service

                        Comment


                          #13
                          That's what I've done, take a look at the strategy, I have only one indicator added and specify displacement in that strategy for the indicator.

                          Comment


                            #14
                            Hello dynoweb,

                            Sorry if I was not clear.

                            Please set the Displacement property for the strategy (in the strategy's State.SetDefaults) instead of on the indicator that you are adding.
                            Attached Files
                            JimNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by algospoke, Today, 06:40 PM
                            0 responses
                            9 views
                            0 likes
                            Last Post algospoke  
                            Started by maybeimnotrader, Today, 05:46 PM
                            0 responses
                            7 views
                            0 likes
                            Last Post maybeimnotrader  
                            Started by quantismo, Today, 05:13 PM
                            0 responses
                            7 views
                            0 likes
                            Last Post quantismo  
                            Started by AttiM, 02-14-2024, 05:20 PM
                            8 responses
                            168 views
                            0 likes
                            Last Post jeronymite  
                            Started by cre8able, Today, 04:22 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post cre8able  
                            Working...
                            X