• 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

Can we change a PlotStyle.Dot Plot's Color or Width in OnBarUpdate?

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

  • NinjaTrader_Ray
    replied
    No ability to change the DrawDot() method.

    There is a custom plot sample installed with NT but that will not likely be sufficient for what you want to do. You could troll through the NinjaScrip File Sharing section to see if there are examples of custom graphics, for sure I have seen some in the past.

    Leave a comment:


  • shawnj
    replied
    Thanks Ray. I was afraid this was the situation. Perhaps another alternative would be to override the DrawDot() method and add a Width Property. I haven't looked to see if DrawDot is overrideable (virtual).

    Are there any reference samples that show how to override the Plot method?

    thanks,
    shawnj

    Leave a comment:


  • NinjaTrader_Ray
    replied
    If each row of dots always has the same color/width then you can just use 10, otherwise using the Dot style plot for sure would not be efficient.

    The alternate route is to use DrawDot() however, it only has one width. The final approach is to override the Plot() method however, this is advanced programming and we do not provide any support to code within this method other than the reference samples we provide.

    Leave a comment:


  • Can we change a PlotStyle.Dot Plot's Color or Width in OnBarUpdate?

    I'm translating an Easylanguage Indicator into Ninjascript. Before I write a bunch of workaround code, I thought I'd see if I'm understanding how Ninjascript's Plot works.

    The indicator plots up to 10 seperate dots above each bar's high.
    Each bar the code:
    1) calcuates the location of each dot,
    2) then defines the Color and Width of each dot,
    3) then the 10 Plots (dots) are drawn.
    See attached screenshot.

    From trial and error, it looks to me like Ninjascript cannot do this. It looks like I will have to create a seperate Plot for each combination of Color and Width. Assuming 5 colors and 3 widths that would be 150 (!) Plots.

    Is this correct? Is there a better way to approach this?

    thanks,
    shawnj
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by Aporshnev, Today, 05:56 PM
0 responses
4 views
0 likes
Last Post Aporshnev  
Started by aslane, Today, 05:46 PM
0 responses
4 views
0 likes
Last Post aslane
by aslane
 
Started by Aporshnev, Today, 04:31 PM
1 response
7 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by tradykat, Yesterday, 05:09 PM
7 responses
35 views
0 likes
Last Post NT-Roland  
Started by PLeary, Today, 03:09 PM
2 responses
22 views
0 likes
Last Post PLeary
by PLeary
 
Working...
X