When I plot an indicator, I would like to use only today's data only but no yesterday's data at all. Please don't ask me why. I just need it that way.
The indicator needs at least 1 bars to start to plot.
When the market opens, there are no bars built since I limited the date range for today only. The problem is whenever I open my workspace, the applied indicator's status gets turned off because there is no bars built yet.
So I had to turn the status on everytime I open the workspace before market opens. I hate doing this.
Is there any way to defer the calculation of indicator till enough # of bars built so that the status does not get turned off?
How can I defer the calculation of indicator?
- ABC
- Posts: 721
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 409 times
- Contact:
2haerim,
if I understand you there are a couple of ways around it. The easiest would probably be to load two days on the chart, but limit the calculations to the current date only. This way your study shouldn't be turned off when you open the workspace and you are still only calculating your study on current days data.
Best regards,
ABC
if I understand you there are a couple of ways around it. The easiest would probably be to load two days on the chart, but limit the calculations to the current date only. This way your study shouldn't be turned off when you open the workspace and you are still only calculating your study on current days data.
Best regards,
ABC
Will this work?
After loading 2 days back data,
If Date = CurrentDate Then Begin
...bla bla
End;
will this make the indicator's status not turned off and at the same time the indicator won't depend on Yesterday's data at all?
If Date = CurrentDate Then Begin
...bla bla
End;
will this make the indicator's status not turned off and at the same time the indicator won't depend on Yesterday's data at all?
- ABC
- Posts: 721
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 409 times
- Contact:
2haerim,
from what I understand the status is turned off, because you don't have enough bars on the chart. To overcome this problem, you load the additional day (depending on the study it might need even more days).
If Date = CurrentDate Then Begin
Will start the calculations once this is true. If you are using reserved words like HighY for example, it might use yesterday's data. You'll have to check this for yourself.
Another approach would be to reset everything at the date change:
If Date <> Date[1] then begin
reset all your values here
and begin with new calculations.
Best regards,
ABC
from what I understand the status is turned off, because you don't have enough bars on the chart. To overcome this problem, you load the additional day (depending on the study it might need even more days).
If Date = CurrentDate Then Begin
Will start the calculations once this is true. If you are using reserved words like HighY for example, it might use yesterday's data. You'll have to check this for yourself.
Another approach would be to reset everything at the date change:
If Date <> Date[1] then begin
reset all your values here
and begin with new calculations.
Best regards,
ABC