Hi so I created indicator called NFPDay and I calculate in there the Friday’s of the month.
Then I call the NFPDAY and say if it is 1 Criteria is met. However it is not executing.
Here is the code for the indicator and the ProOrder system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//Name NFPDAY
//Count of Fridays in a month Indicator
If Dayofweek = 4 Then
NewFriday = 1
else
NewFriday = 0
endif
If Month = Month [ 1 ] then
Friday= Friday+ NewFriday
else
Friday = NewFriday
Endif
Return Friday
//Strategy Code
DEFPARAM Flatafter = 153000
Friday = Call "NFPDAY"
IF Friday = 1 Then
DayOK= 1
Else
DayOk= 0
endif
If Time = 093000 Then
Active = 1
Else
Active= 0
Endif
If Close > Open Then
Bull = 1
BeAR= 0
ELSe
BEAR= 1
BULL= 0
endif
// Conditions to enter long positions
IF NOT LongOnMarket AND dayok and Active and Bull THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
// Conditions to enter short positions
IF NOT ShortOnMarket AND dayok and Active and Bear THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
// Stops and targets : Enter your protection stops and profit targets here