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:	52
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 leunating, Today, 12:56 AM
    2 responses
    17 views
    0 likes
    Last Post leunating  
    Started by tmk-c, 07-19-2017, 11:29 PM
    6 responses
    1,687 views
    0 likes
    Last Post Brightredmegaphone  
    Started by Trader4Life, Today, 09:20 PM
    0 responses
    5 views
    0 likes
    Last Post Trader4Life  
    Started by WileCoyote, Today, 08:26 PM
    0 responses
    8 views
    0 likes
    Last Post WileCoyote  
    Started by madankumars, 11-18-2019, 11:12 AM
    10 responses
    176 views
    0 likes
    Last Post ulisesguerrero  
    Working...
    X