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 alifarahani, Today, 09:40 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by RookieTrader, Today, 09:37 AM
      4 responses
      17 views
      0 likes
      Last Post RookieTrader  
      Started by PaulMohn, Today, 12:36 PM
      0 responses
      4 views
      0 likes
      Last Post PaulMohn  
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      39 views
      0 likes
      Last Post love2code2trade  
      Started by junkone, Today, 11:37 AM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X