Hi,
I'm calling DrwTrendLine.Create() in an tool bar button event handler, but the trendline is not showing up immediately. It shows up on the next bar or maybe the next tick. Is there a way to force the UI to render the trendline from the event handler immediately?
Thanks!
Trendline created in EventHandler not showing up immediately
- Kate MultiCharts
- Posts: 593
- Joined: 21 Oct 2020
- Has thanked: 9 times
- Been thanked: 148 times
Re: Trendline created in EventHandler not showing up immediately
Hi uprz23,
You can use RecalcLastBarAfter to force calculation according to the set timeout, without waiting for the next tick.
You can use RecalcLastBarAfter to force calculation according to the set timeout, without waiting for the next tick.
Re: Trendline created in EventHandler not showing up immediately
Thanks Kate for RecalcLastBarAfter. Is that method for the .NET version of MultiCharts? I got a compilation error when I tried to use it. "The name 'RecalcLastBarAfter' does not exist in the current context"
Re: Trendline created in EventHandler not showing up immediately
I found this that helped:
From this thread viewtopic.php?t=43339
Code: Select all
// in event handler with 100 millisec delay
ExecControl.RecalcLastBarAfter (new TimeSpan (0,0,0,0,100));
// add
protected override void OnRecalcLastBarAfterEvent() {
CalcBar();
}
From this thread viewtopic.php?t=43339
- Kate MultiCharts
- Posts: 593
- Joined: 21 Oct 2020
- Has thanked: 9 times
- Been thanked: 148 times
Re: Trendline created in EventHandler not showing up immediately
Hi! It's a PowerLanguage method, sorry for misunderstanding. Glad you found the solution for your version!Thanks Kate for RecalcLastBarAfter. Is that method for the .NET version of MultiCharts? I got a compilation error when I tried to use it. "The name 'RecalcLastBarAfter' does not exist in the current context"
Some more info that might be useful for .NET here.