Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FYI: Random [BarsAgo] indexing issue with Draw.Ray()

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

    FYI: Random [BarsAgo] indexing issue with Draw.Ray()

    Just giving you guys a heads up on this weird behavior I saw today. This indicator has always drawn the Rays correctly as far as I have seen.
    Here is the code used in the indicator.
    Code:
    Draw.Ray(this, "AskLine", false, -2, dblAsk, -3, dblAsk, bshAskLine, DashStyleHelper.Solid, 2);
    Draw.Ray(this, "BidLine", false, -2, dblBid, -3, dblBid, bshBidLine, DashStyleHelper.Solid, 2);
    You'll notice this happened with data after the market closed on Friday, so maybe that's a clue as to why the bar index location on the chart was interpreted wrong.
    Click image for larger version

Name:	SNAGHTML3d0cf5bb.PNG
Views:	25
Size:	73.4 KB
ID:	1118917
    After reloading the chart the lines were drawn correctly. No need to reply back. I'm just passing this along to you guys.
    Thanks.
    Attached Files

    #2
    Hello zacharydw00,

    It appears you have some invalid code.

    Negative values are not allowed for barsAgo indexes.

    Draw.Ray(this, "AskLine", false, -2, dblAsk, -3, dblAsk, bshAskLine, DashStyleHelper.Solid, 2);

    You will need to change the code so that only positive values are used for barsAgo indexes with Draw methods.

    See the forum threads below which have details.
    https://ninjatrader.com/support/foru...rd#post1116611
    https://ninjatrader.com/support/foru...ge3#post836072
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      It appears you have some invalid code.
      Negative values are not allowed for barsAgo indexes.
      Hi ChelseaB,
      As I stated in the first post the indicator works correctly except for that one incident. And, as these screenshots show negative values work just fine.

      Click image for larger version

Name:	Negative index works correctly 1.png
Views:	18
Size:	179.7 KB
ID:	1119147Click image for larger version

Name:	Negative index works correctly 2.png
Views:	14
Size:	182.9 KB
ID:	1119148Click image for larger version

Name:	Negative index works correctly 3.png
Views:	13
Size:	184.1 KB
ID:	1119146Click image for larger version

Name:	Negative index works correctly 4.png
Views:	13
Size:	187.3 KB
ID:	1119145
      Side note, I wanted to attach a video to show the indicator works fine using negative numbers, but the site didn't allow that. That would be helpful if this site would allow that in the future.

      Regards,
      Zac

      Comment


        #4
        Hello Zac,

        Using is negative indexes is not supported by NinjaTrader.

        I recommend you change the code and only use positive barsAgo values.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by tonynt, Today, 09:39 AM
        0 responses
        7 views
        0 likes
        Last Post tonynt
        by tonynt
         
        Started by ervin, Today, 09:23 AM
        0 responses
        5 views
        0 likes
        Last Post ervin
        by ervin
         
        Started by HansLenders, Today, 09:15 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by sdauteuil, Today, 08:23 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by tonynt, Today, 08:27 AM
        4 responses
        26 views
        0 likes
        Last Post tonynt
        by tonynt
         
        Working...
        X