I have a button that calls 2 methods
DrawShortStopLine and
DrawShortEntryLine
the Entry line always appears but the stop Line appears at random.always the first time but thereafter sporadically.
It gets called again on IsFirstTickOfBar where it works just fine.
Below is the button calling the method
if(BuildingShortEntryLine == false) { BuildingShortEntryLine = true; shortTradePrice = findlow1-(TickSize*EntryAdjustTicks);//set in IsFirstTickOfBar shortStopPrice =Math.Max(shortTradePrice + TickSize * 8,shortTradePrice + StopLossDistance); BuildingShortStopLine = true; DrawShortStopLine(shortStopPrice); DrawShortEntryLine(shortTradePrice);
private void DrawShortEntryLine(double price) { TriggerCustomEvent(o => { if (BuildingShortEntryLine )//bool { shortEntryLine = DrawLL.LabeledHorizontalLine(this,"SELine",price,CyanBG,DashStyleHelper.Dot,3,true); shortEntryLine.IsLocked = false; } }, null); } private void DrawLongStopLine(double price) { if(BuildingLongStopLine)//bool { TriggerCustomEvent(o => { { longStopLine = DrawLL.LabeledHorizontalLine(this,"LXLine",price,Brushes.Fuchsia,true); longStopLine.IsLocked = false; longStopLine.IsVisible = true; } // ForceRefresh();no effect }, null); } }
And it also comes up with weird numbers even when the IsFirstTickOfBar calls the method but the line prints exactly where it should?
Any pointers anyone?
Comment