| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Allocating Trading Day Number 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. | ||
| |
|
| | #2 | ||
![]() | Re: Allocating Trading Day Number Code: if Month( date ) <> Month( CalcDate( date, iff( DayOfWeek( d ) <> 5, 1, 3 ) ) ) then print( date ) ; Quote:
| ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Number of Markets to Trade | ant | Beginners Forum | 44 | 01-17-2009 06:17 AM |
| Normal expected move for x economic number | walterw | Market Analysis | 7 | 06-03-2007 04:53 AM |