Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating Flashing Draw objects (e.g. ArrowsUp/Down)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Creating Flashing Draw objects (e.g. ArrowsUp/Down)

    Hi,

    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
    Last edited by ystan79; 03-08-2017, 11:05 PM.

    #2
    I am not sure I follow your logic but it would seem
    that you have a Print "Up" and you should really have a
    Print "UP On" and Print "UP Off" for both Up and Down in order to debug this.

    Comment


      #3
      Hello,

      Thank you for the post.

      I wanted to check, with your current test are you able to see the blinking occur if you are scrolling the chart or fast market data is coming in? Also what is the overall goal, is it just to make a blinking arrow?

      This could potentially be caused by the charts rendering not seeing anything to change while rendering. Could you provide a working example of what you have created so far? I could look further into if this could work as I am unsure from what has been provided if that is specifically the problem.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gravdigaz6, Today, 11:40 PM
      0 responses
      4 views
      0 likes
      Last Post gravdigaz6  
      Started by MarianApalaghiei, Today, 10:49 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      4 views
      0 likes
      Last Post XXtrader  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      9 views
      0 likes
      Last Post funk10101  
      Working...
      X