Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

onlyPlotToday but make it plot for two days instead

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

    onlyPlotToday but make it plot for two days instead

    I'm using an option to select _onlyPlotToday but I want to make it for two days rather than one day, or maybe 3 days:

    This everything I'm currently using below, what do I change to plot two days?



    private bool _onlyPlotToday = false;
    SessionIterator _sessionIterator;

    ***************

    if (State == State.Historical)
    {
    //stores the sessions once bars are ready, but before OnBarUpdate is called
    _sessionIterator = new SessionIterator(Bars);
    }

    *******

    protected override void OnBarUpdate()
    {

    if(_onlyPlotToday)

    {
    _sessionIterator.GetNextSession(Time[0], true);
    TimeSpan ts = DateTime.Now - _sessionIterator.ActualTradingDayExchange;
    if(ts.Days == 0) //is today
    PlotIndy();
    }
    else
    {
    PlotIndy();
    }
    }

    private void PlotIndy()
    {

    *******

    [NinjaScriptProperty]
    [Display(Name = "OnlyPlotToday", Description = " Uses Less Data"+"\n"+"\nOn the next day once this indicator loads: hit reset (reset - Apply - OK) to reload the bars"+"\n"+"\n Go to Indicator > template > reset = (template >> save load reset)"+"\n -to keep from the continuation of painting of strong bars where it applies", Order = 1, GroupName = "FibDrawn_1R")]
    public bool OnlyPlotToday
    {
    get { return _onlyPlotToday; }
    set { _onlyPlotToday = value; }
    }​

Latest Posts

Collapse

Topics Statistics Last Post
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
87 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
128 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
65 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
117 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
67 views
0 likes
Last Post PaulMohn  
Working...
X