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:	217
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 sjsj2732, Today, 04:31 AM
    0 responses
    20 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    280 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    279 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    130 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X