I have built an indicator script and trying to make my arrows flash (between yellow and transparent) on the chart.
I have created a timer event (timerBlinkEvent) and this event will call the TriggerCustomEvent to process the blinking of the arrows.
The timer interval is set as 500 ms. But I do not see the arrows blinking on the chart. However, the events are actually trigger because i see the "blinking" printout when the Print function is called in the event
Did i do anything wrong?
Following are my code snipets:
//event triggered by timer
private void OnBlinkTimerEvent(Object source, System.Timers.ElapsedEventArgs e)
{
TriggerCustomEvent(ProcessBlinkHandler, 0, "blink");
}
//event triggered by TriggerCustormEvent
private void ProcessBlinkHandler(object state)
{
if(i_BuyArrowUp != null && i_waitingTriggerBuy == true)
{
if(i_BuyArrowUp.Color == watiTriggerArrowColor)
{
Print("blinking_Up");
i_BuyArrowUp.Color = Color.Transparent;
}
else
{
i_BuyArrowUp.Color = watiTriggerArrowColor;
}
}
if(i_SellArrowDown != null && i_waitingTriggerSell == true)
{
if(i_SellArrowDown.Color == watiTriggerArrowColor)
{
Print("blinking_Dwn");
i_SellArrowDown.Color = Color.Transparent;
}
else
{
i_SellArrowDown.Color = watiTriggerArrowColor;
}
}
}
Many Thanks in advance
Comment