Hi.
I have found a little issue with the playback function together with an indicator I've made. There's a text object at the last bar on the chart, and the indicator creates this text object on live data ( Bars.Status != EBarState.Close ). The problem is when a bar closes, the text object disappears, which is fine, but I'll have to wait for 10 seconds before it appears again. The code is correct, but it would be nice if disappears right before open, instead of right after close.
Best regards,
Johannes Baumann
A Little Issue with Playback
Re: A Little Issue with Playback
I solved it with this code:
Would be nice if there solution after a while though. Noticed that on 1M it only closes, so the text object never gets created...
Regards,
Johannes Baumann
Code: Select all
public void CreateSum( VariableSeries<ITextObject> TextObject, double Number, ETextStyleV StyleV, double Level, int Size, Color Color )
{
TextObject.Value = DrwText.Create( new ChartPoint( Bars.Time[0], Level ), Number.ToString("0.#"), true );
TextObject.Value.Size = Size;
TextObject.Value.VStyle = StyleV;
TextObject.Value.HStyle = ETextStyleH.Right;
TextObject.Value.SetFont( FontStyle.Bold, true );
TextObject.Value.Color = Color;
TextObject.Value.BGColor = m_BGColor;
TextObject.Value.FontName = "Courier New";
TextObject.Value.Locked = true;
}
protected override void CalcBar()
{
if ( Bars.Status == EBarState.Close )
{
if (Bars.LastBarOnChart)
{
if ( t_Sum[0] != 0 )
t_Sum[0].Delete();
CreateSum( t_Sum, Sum, ETextStyleV.Center, m_Average_Level, Size, m_Wave_Color )
}
}
}
Regards,
Johannes Baumann
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: A Little Issue with Playback
Hello Johannes,
You need to add [RecoverDrawings(False)] to your code to avoid that.
You need to add [RecoverDrawings(False)] to your code to avoid that.