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 NullPointStrategies, Today, 05:17 AM
0 responses
23 views
0 likes
Last Post NullPointStrategies  
Started by argusthome, 03-08-2026, 10:06 AM
0 responses
120 views
0 likes
Last Post argusthome  
Started by NabilKhattabi, 03-06-2026, 11:18 AM
0 responses
63 views
0 likes
Last Post NabilKhattabi  
Started by Deep42, 03-06-2026, 12:28 AM
0 responses
41 views
0 likes
Last Post Deep42
by Deep42
 
Started by TheRealMorford, 03-05-2026, 06:15 PM
0 responses
45 views
0 likes
Last Post TheRealMorford  
Working...
X