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:	225
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    155 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    137 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X