An error occurred in the previous version .... I entered the wrong file.
//////// DOW J. Day Only Long indicator by Vonasi ////////////
DEFPARAM CumulateOrders = False
c30 =TR(close)>30
indicator11 = ADX[10]
indicator21 = ADXR[13]
c2 = (indicator11[1] > indicator21[1])
indicator1 = CALL "Average Penetration Histog."[55, 95](close)
c1 = (indicator1 >= 1)
If longonmarket and (barindex-tradeindex)>=22 then
SELL AT MARKET
ENDIF
LossMonth =450
once StopMonth=1
IF Month <> Month[1] THEN
ProfitMonth=strategyprofit
StopMonth=1
endif
If strategyprofit<=ProfitMonth-LossMonth then
StopMonth=0
endif
IF not longonmarket and StopMonth=1 and c1 and c2 and c30 then
BUY 1 CONTRACT AT MARKET
SET STOP %LOSS 1.5
ENDIF
indicator2 = CALL "Average Penetration Histog."[55, 95](close)
c3 = (indicator2 <= -1)
IF c3 THEN
SELL AT MARKET
ENDIF
Trailinglong = 4* averagetruerange[1](close)
Trailingsteplong = 1* averagetruerange[1](close)
TGL = Trailinglong
STPL = Trailingsteplong
if not onmarket then
MAXPRICE = 0
PREZZOUSCITA = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL then
PREZZOUSCITA = MAXPRICE-STPL
ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIF