Hi,
I am having an issue with getting different values for the previous daily close. It seems to be centered around the input Use Settlement as Close on daily interval from the Edit Chart window.
Upon the first tick of a new day:
if(getBarStateInterval("D") == BARSTATE_NEWBAR){
I calculate the previous daily close with:
getSeries(close(sym(getSymbol() + ",D"))).getValue(-1);
or
close( -1, inv("D") );
For NQ I got 10842.75 as the previous daily close (Daily close for Nov 9) . I reloaded my study and got the same value.
I then restarted eSignal and without changing anything I got 10830.75 as the previous daily close. So my code is identical but I am receiving two different values depending on if eSignal is restarted or not.
See attachments for edit chart window:
I have always had Use Settlement as Close on daily interval and Include Settlement in intraday and tick intervals as checked.
After I restarted eSignal, I changed Use Settlement as Close on daily interval to OFF by setting the Interval to D, checking the input OFF, then switching the Interval back to 5. Upon doing that I was getting the previous daily close as 10842.75, which was the first number I was getting before I restarted eSignal.
Overnight & Reload & Use Settlement as Close on daily interval = ON
I believe if a study is left on overnight, then in the morning when it calculates the previous daily close, it does so with Use Settlement as Close on daily interval as OFF, even when the input is ON.
Here is a log of my study showcasing the issue. As you can see, the daily low and high are the same, however running the script overnight and reloading the script without restarting eSignal produces 10842.75 while restarting eSignal in the morning produces 10830.75.
Overnight & Reload
Daily Close V2: 10842.75
Daily Close V1: 10842.75
Daily Low: 10822.25
Daily High: 11164.25
eSignal Restart
Daily Close V2: 10830.75
Daily Close V1: 10830.75
Daily Low: 10822.25
Daily High: 11164.25
I am using a 5 min time interval and a custom session from 7:45 to 18:00
I am having an issue with getting different values for the previous daily close. It seems to be centered around the input Use Settlement as Close on daily interval from the Edit Chart window.
Upon the first tick of a new day:
if(getBarStateInterval("D") == BARSTATE_NEWBAR){
I calculate the previous daily close with:
getSeries(close(sym(getSymbol() + ",D"))).getValue(-1);
or
close( -1, inv("D") );
For NQ I got 10842.75 as the previous daily close (Daily close for Nov 9) . I reloaded my study and got the same value.
I then restarted eSignal and without changing anything I got 10830.75 as the previous daily close. So my code is identical but I am receiving two different values depending on if eSignal is restarted or not.
See attachments for edit chart window:
I have always had Use Settlement as Close on daily interval and Include Settlement in intraday and tick intervals as checked.
After I restarted eSignal, I changed Use Settlement as Close on daily interval to OFF by setting the Interval to D, checking the input OFF, then switching the Interval back to 5. Upon doing that I was getting the previous daily close as 10842.75, which was the first number I was getting before I restarted eSignal.
Overnight & Reload & Use Settlement as Close on daily interval = ON
- 10842.75
- 10830.75
- 10842.75
I believe if a study is left on overnight, then in the morning when it calculates the previous daily close, it does so with Use Settlement as Close on daily interval as OFF, even when the input is ON.
Here is a log of my study showcasing the issue. As you can see, the daily low and high are the same, however running the script overnight and reloading the script without restarting eSignal produces 10842.75 while restarting eSignal in the morning produces 10830.75.
Overnight & Reload
Daily Close V2: 10842.75
Daily Close V1: 10842.75
Daily Low: 10822.25
Daily High: 11164.25
eSignal Restart
Daily Close V2: 10830.75
Daily Close V1: 10830.75
Daily Low: 10822.25
Daily High: 11164.25
I am using a 5 min time interval and a custom session from 7:45 to 18:00
Comment