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:	230
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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    56 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    57 views
    0 likes
    Last Post PaulMohn  
    Working...
    X