Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Got a couple minutes after lunch, so I'll post this question here:
How can I access the chart rectangle bounds from within a strategy? I have fixed text drawn negative bars ago, but it is not visible if you set the margin to 100, only if you scroll. In an indicator, I could easily override the Plot(), but not so much in a strategy.
Edit: I would also need to know how to duplicate the Plot() method ie how to change the position of the string I draw, but delete the previously drawn string.
Thanks in advance
London Calling
Can you help answer these questions from other members on NexusFi?
Is ChartControl not accessible in a strategy? I'm really not very knowledgeable when it comes to strategies.
If things get complicated inside the strategy, why not instantiate an indicator and call its methods from within the strategy? Cross communication should be no problem at all...
Edit: I'd try this.FindForm().ChartControl
And if you can't override the Plot() method there might still be an eventhandler OnPlot or so...just an idea
Vvhg
@vvhg ChartControl is, but Plot() is not. I need to plot labels for lines (working on my advanced ATM system still ), which is simple overriding the Plot() in indicators, but not in strategies. Right now I have it set up using DrawText, but I am kinda picky and hate the fact that I have to manually scroll my chart to see the text drawn "in the future". I want the label to be visible no matter where I am on the chart. Simple enough overriding Plot() in an indy, but without that tool I am stuck in a strategy with DrawText.
In that case it might be easiest to call an indicator doing the plot stuff. Either instantiate it or just call individual methods (maybe with the help of an eventhandler?)
If you instantiate the indicator with a pointer to the strategy ("this", as I have done with the vvfutures.io (formerly BMT)AutoPost) you can access all public variables from within the indicator.
@vvhg How do I instantiate a dummy indicator so I can override Plot(), and then how would I access Plot()? I will be plotting on price panel if that helps. I've instantiated indicator before, but the Plot() event doesn't get triggered, so I'm kind of lost on what to do.
I'm not at my computer, so all from the top of my head and partially untested...
Not entirely sure how to instantiate, but I think you would have to use the Add() method in either initialize or onstartup, helpfile should clarify that. Then Plot() should get called just fine. If that works you could access all relevant variables from within indicator Plot() via public strategy variables and forwarding a pointer to the strategy, in that case as a parameter I should think...