|
Allocating Trading Day Number
Hi,
Anyone can help to translate the following Metastock code into TS2000i compatiable code?
The indicator allocate a number to each trading day and reset to zero following a new month.
========================= ========================= ====
{ User input }
EOM:=Input("Final month's end: [1]True, [2]Current (dynamic)",1,2,1);
{ Choice of Static/Dynamic last EOM signal }
EOM:=If(EOM=2,Cum(1)=Last Value(Cum(1)),
DayOfMonth()=31);
{ Start of month }
nuMonth:=Month()<>Ref(Mon th(),-1) OR Cum(1)=2;
{ End of month }
monthEnd:=PeakBars(1,
-(nuMonth OR Cum(IsDefined(nuMonth))=1 ),1)=0
OR EOM;
{ Plot signals in own window }
nuMonth;-monthEnd
BarsSince(nuMonth)
========================= ========================= =====
Regards.
|