Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Missing line part

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

    Missing line part

    I want an indicator to change color when going up and down. With all methods I used, always in the changing zone a part is missed.

    What is the way to avoid this missing part?

    I did it this way:


    protected override void OnBarUpdate()
    {
    // Do not calculate if we don't have enough bars
    if (CurrentBar < Period) return;

    // Calculate ZeroLagHATEMA value
    double value = ZeroLagHATEMA(Period) [0];

    // Change color when up or down
    if (Rising (ZeroLagHATEMA(Period)))
    {
    UpMove.Set(value);
    }
    else if (Falling (ZeroLagHATEMA(Period)))
    {
    DownMove.Set(value);
    }
    }
    Attached Files

    #2
    Hello,


    When you switch colors/Plots you will want retroactively draw the new color to connect to the rest of the line using something like this:

    UpMove.Set(1, value)[1];

    Note the above line of code should be added to your existing code to connect the plots.

    Here is a link that has a sample:
    DenNinjaTrader Customer Service

    Comment


      #3
      thx, that's what I was looking for.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      308 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      349 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X