Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to hit F5 to draw arrows when chart tab is not selected

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

    Need to hit F5 to draw arrows when chart tab is not selected

    They show up in real time if the tab is active but if I go to another chart tab that has the indicator running I need to refresh ninjascript in order for the arrows to plot.

    Does anyone know what I'm doing wrong?

    Here's the code:
    Code:
     protected override void OnBarUpdate()
    {
    if(CrossBelow(RSI(5,1), 80, 1))
    {
    Draw.ArrowDown(this, "tag2"+CurrentBar, true, 0, High[0] + TickSize, Brushes.Red);
    }
    if(CrossAbove(RSI(5,1), 20, 1))
    {
    Draw.ArrowUp(this, "tag1"+CurrentBar, true, 0, Low[0] - TickSize, Brushes.Green);
    }
    }

    #2
    Hi Walter, thanks for posting. Does the indicator run OnEachTick or OnBarClose? I would need you to post a test script that re-creates this because the code you posted looks like it will work in Historical mode.

    Best regards,
    -ChrisL

    Comment


      #3
      Hi Chris.

      It's set to OnBarClose.

      Could it be due to the fact that IsSuspendedWhileInactive was set to true?

      It's set to false in the attached script, I'm currently waiting to see if this does the trick.

      Edit:
      It looks like it was due to that setting after all.

      Attached Files
      Last edited by WalterSkinner; 04-28-2022, 10:46 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      561 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      325 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X