// MOVING AVERAGE CROSSOVER by Enrico Malveri
// “I Consigli dei Grandi Trader” , Hoepli, 2015
// translated in ProRealTime language by Saucius
DEFPARAM CumulateOrders = False
MAF = Average[9](close)
MAL = Average[18](close)
c1 = (MAF crosses over MAL)
c2 = (MAF crosses under MAL)
// Condizioni per entrare long/short – long/short entry conditions
If not shortonmarket and c1 then
buy 2 shares at market
elisf not longonmartket and c2 then
sellshort 2 shares at market
endif
// Stop conditions
MAS = Average[10](close)
c3 = (close crosses under MAS)
c4 = (close crosses over MAS)
if c3 then
sell at market
elsif c4 then
exitlong at market
endif
SET STOP LOSS x %TRAILING y
SET STOP PROFIT x %TRAILING y