++++++++++
// Definition of Code Parameters
DEFPARAM CumulateOrders = False
//Cumulating Positions Deactivated
DEFPARAM FLATAFTER = 215500
Below variables are easy to define in PROBacktest Variable Definition Menu,
But PROAutotrade system insists that these variables to be defined inside programming.
// ADD Variable definition
Label in program “Short”
Label in properties window “ShortMA”
Restriction > 0
Minimal Value 10
Maximum Value 50
Step (Interval) 5
// ADD Variable definition
Label in program “Long”
Label in properties window “LongMA”
Restriction > 0
Minimal Value 30
Maximum Value 60
Step (Interval) 5
MAShort = Average[Short] (Close)
MALong = Average[Long] (Close)
// Conditions to Enter Long Positions
C1 = (MAShort CROSSES OVER MALong)
IF C1 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
//Conditions to Exit Long Positions
C2 = (MAShort CROSSES UNDER MALong)
IF C2 THEN
SELL AT MARKET
ENDIF
//Conditions to Enter Short Positions
C3 = (MAShort CROSSES UNDER MALong)
IF C3 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
//Conditions to Exit Short Positions
C4 = (MAShort CROSSES OVER MALong)
IF C4 THEN
EXITSHORT AT MARKET
ENDIF
//Stops and Targets
SET STOP pTRAILING 25
++++++++++++++++++++++++++++++++++++++++++++++++++