Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Ray Problem

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

    Ray Problem

    I am using the code below to draw a ray on the price chart when a certain condition is met. The intent is for the ray to be drawn only from the latest occurrence. However, the ray is showing up only once, at a prior occurrence, in a seemingly random choice of occurrences. Can't figure this out.

    if ((RSI(2,1)[2] < 20) && (RSI(2,1)[1] < RSI(2,1)[2]) && (Close[0] > Close[1]))
    {
    DrawRay("Tag1",8,Close[0],0,Close[0],Color.Yellow,DashStyle.Dash,3);

    }


    Another approach would be to draw a ray from, say, 8 bars back and end it a certain number of bars forward, but I can't figure out how to do that either. If so, I could draw multiple bars, one for each occurrence by changing the Tag1 name.
    Last edited by Richard Von; 02-02-2010, 11:04 AM.

    #2
    Richard, correct in your code case the ray would be drawn the last time the condition evaluated to true to get a history of ray's, please a unique tag id for each.



    Unfortunately you can't plot programmatically into the future.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply. I thought I had the problem is that the ray is NOT being drawn at the last occurrence. But may have a problem with the condition code. Working on it.

      I appreciate the help.
      Last edited by Richard Von; 02-02-2010, 12:54 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Today, 01:16 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by samish18, Today, 01:01 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by WHICKED, Today, 12:56 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by WHICKED, Today, 12:45 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X