Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reseting values to zero at new session start

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

    Reseting values to zero at new session start

    Hi,

    i created a cum delta like indicator and added divergence sooting to it, but i have two questions.

    1. I try to reset the value of the oscillator to 0 when a new day starts ( being in europe, it is 1 am here ), but it does not work
    Code:
    if ((Times[0][0].TimeOfDay == new TimeSpan(1, 0, 0))) CD[0] = 0.0;
    2. Is there a way to draw the divergence line on both price and oscillator?

    Click image for larger version

Name:	image.png
Views:	209
Size:	157.0 KB
ID:	1327198

    Thank you
    Last edited by gyilaoliver; 12-10-2024, 11:20 AM.

    #2
    Hello gyilaoliver,

    To trigger an action at the start of a new session:

    if (Bars.IsFirstBarOfSession())
    {
    myVariableName = 0;
    }




    "Is there a way to draw the divergence line on both price and oscillator?"

    An indicator is only able to plot, add drawing objects, or custom render in one panel.
    With drawing objects you can choose the input series panel, or the indicator panel, but not both.

    For both panels to have drawing objects, plots, or renders, these would need to be split into two indicators.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    553 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    100 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    543 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    546 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X