Hi,
I wrote a script to find today's volume is how many days largest and showed the number as indicator in the chart. The purpose is to show the importance of today's volume. For example, if today's volume is the largest of the last 200 trading days, it is obviously more important than the volume just larger than the past few days.
The script works fine. The big question is it only shows the result of the past few years at most, no matter how many bars I load. I cannot figure out why the script does not start at the 7th bar, given the first 6 bars are ignored by default. I sense that it must be something to do with the bar numbers. I maximized the bars loaded through "format instrument"->"setting"->"data range". It is no use. I am desperate for a direction. Any hints would be highly appreciated.
The script:
Variables: KeepGoing(True),
BarCount(1);
BarCount = 1;
KeepGoing = True;
While KeepGoing = True begin
If Volume > Volume[BarCount] then begin
BarCount = BarCount + 1;
End
Else begin
KeepGoing = False;
End;
End;
Value20 = Text_New_Self(Date, Time, 1, NumtoStr(BarCount-1,0));
Value21 = Text_setsize(Value20,6);
Value24 = text_setcolor(Value20,yellow);
Print(CurrentBar:2:0, " ",ELDatetoString(Date), " BarCount=", BarCount:2:0);
Bar Number Setting [SOLVED]
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Bar Number Setting
Please look up these articles in wiki:Hi,
I wrote a script to find today's volume is how many days largest and showed the number as indicator in the chart. The purpose is to show the importance of today's volume. For example, if today's volume is the largest of the last 200 trading days, it is obviously more important than the volume just larger than the past few days.
The script works fine. The big question is it only shows the result of the past few years at most, no matter how many bars I load. I cannot figure out why the script does not start at the 7th bar, given the first 6 bars are ignored by default. I sense that it must be something to do with the bar numbers. I maximized the bars loaded through "format instrument"->"setting"->"data range". It is no use. I am desperate for a direction. Any hints would be highly appreciated.
The script:
::
Maximum Bars Back
How Scripts Work
Symbol_currentbar
ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713
Re: Bar Number Setting
Thanks TJ and sorry for the mess.
I checked out the wiki. It seems that Multicharts does not support "bars-since". I can easily find the 52-week high but no easy way to find the corresponding bar number.
Am I right?
I checked out the wiki. It seems that Multicharts does not support "bars-since". I can easily find the 52-week high but no easy way to find the corresponding bar number.
Am I right?
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Bar Number Setting [SOLVED]
1. set up a variable,Thanks TJ and sorry for the mess.
I checked out the wiki. It seems that Multicharts does not support "bars-since". I can easily find the 52-week high but no easy way to find the corresponding bar number.
Am I right?
2. when the chart reaches the 52-week high, capture the bar number and save it to the variable.
3. if the market makes another high, then replace the capture with the new one.