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

DrawTriangle instability

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

    DrawTriangle instability

    This time I am not asking for help. I am merely reporting a verified bug with the DrawTriangle() method. I checked, re-checked, and even had another person verify the code is correct, and the data is being reported incorrectly.

    So...I have this code creating a triangle, followed by a Print() dumping the info to the output window:
    Code:
    uni[mcount] = DrawTriangle(crypto[mcount].namtriuni,false,anchBtime,anchXprice,anchBtime,anchAprice,tm,pr,clearBrush,cb[19],0);
    Print("created UNI tm1: "+uni[mcount].Anchor1Time.ToString()+"   tm2: "+uni[mcount].Anchor2Time.ToString()+"   tm3: "+uni[mcount].Anchor3Time.ToString()+"   crypto Btm: "+crypto[mcount].btime);
    The resultant output is:
    created UNI tm1: 4/30/2018 8:00:00 AM tm2: 4/30/2018 3:00:00 PM tm3: 4/30/2018 8:00:00 AM crypto Btm: 4/30/2018 8:00:00 AM
    For whatever reason, anchor 2 is being reported as anchor 3, and anchor 3 is reported as anchor 2. But....that's not all. Later, i make updates to the triangle points. I have a Print() statement before the update in the following code:
    Code:
    Print("tracking    UNI tm1: "+uni[mcount].Anchor1Time.ToString()+"   tm2: "+uni[mcount].Anchor2Time.ToString()+"   tm3: "+uni[mcount].Anchor3Time.ToString()+"   crypto Btm: "+crypto[mcount].btime);
    uni[mcount] = DrawTriangle(crypto[mcount].namtriuni,false,uni[mcount].Anchor1Time,maghprice,uni[mcount].Anchor2Time,maglprice,tm,targprice,clearBrush,cb[19],fade);
    The resultant output is (only posting the first two lines of output:
    tracking UNI tm1: 4/30/2018 8:00:00 AM tm2: 4/30/2018 3:00:00 PM tm3: 4/30/2018 8:00:00 AM crypto Btm: 4/30/2018 8:00:00 AM

    tracking UNI tm1: 4/30/2018 8:00:00 AM tm2: 4/30/2018 3:00:00 PM tm3: 4/30/2018 3:00:00 PM crypto Btm: 4/30/2018 8:00:00 AM
    Notice, the anchors #2 and #3 are still switched on the first line (before any modification). The triangle is modified. The output is triggered again for another update...but the second pass (before the second update and after the first update) anchors #2 and #3 are now the same.

    So....either the documentation
    HTML Code:
    https://ninjatrader.com/support/helpGuides/nt7/?drawtriangle.htm
    has been incorrect for years...or there is a bug in the drawing method.

    #2
    Hello Antny,
    Thanks for your post.

    With only variables as inputs we would need to see this script to know for sure what is happening.
    Feel free to write in to PlatformSupport(at)NinjaTrader(dot)com and reference this post. Please be sure to include the script.

    Otherwise, I will keep this forum post open for anyone else that would like to comment.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      This is strange. I thought I had posted this in the NinjaTrader 7 sub-forum. For anyone who reads this post, this issue does not exist in NT8. This ONLY pertains to NT7. When a moderator sees this, you may want to move this thread over to the NT7 forum.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by martin70, 03-24-2023, 04:58 AM
      14 responses
      105 views
      0 likes
      Last Post martin70  
      Started by TraderBCL, Today, 04:38 AM
      0 responses
      2 views
      0 likes
      Last Post TraderBCL  
      Started by Radano, 06-10-2021, 01:40 AM
      19 responses
      606 views
      0 likes
      Last Post Radano
      by Radano
       
      Started by KenneGaray, Today, 03:48 AM
      0 responses
      4 views
      0 likes
      Last Post KenneGaray  
      Started by thanajo, 05-04-2021, 02:11 AM
      4 responses
      470 views
      0 likes
      Last Post tradingnasdaqprueba  
      Working...
      X