Dear ROBERTO,
many thanks for spending your time about this issue. I will try your new system but I think is missing the part regarding the definition of buy/sell number of contracts . Here below I added a part of your previous reply to let the system calculate the contract q.ty based on profit levels (SEE BOLD WORDS). Do you think it’s OK in this way ????
ONCE LongProfit = 0
ONCE ShortProfit = 0
IF StrategyProfit <> StrategyProfit[1] AND BarIndex > 0 THEN
Profitto = StrategyProfit – StrategyProfit[1]
IF LongOnMarket[1] THEN
LongProfit = LongProfit + Profitto
ELSIF ShortOnMarket[1] THEN
ShortProfit = ShortProfit + Profitto
ELSE
p1 = 1
p2 = 2
IF OnMarket THEN
p1 = 2
p2 = 3
ENDIF
IF TradePrice(p1) > TradePrice(p2) THEN
IF Profitto > 0 THEN
LongProfit = LongProfit + Profitto
ELSE
ShortProfit = ShortProfit + Profitto
ENDIF
ELSIF TradePrice(p1) < TradePrice(p2) THEN
IF Profitto < 0 THEN
LongProfit = LongProfit + Profitto
ELSE
ShortProfit = ShortProfit + Profitto
ENDIF
ELSE
LongProfit = LongProfit + (Profitto / 2)
ShortProfit = ShortProfit + (Profitto / 2)
ENDIF
ENDIF
ENDIF
// for LONG trades
Once MinSizeL = 1 //minimum sizecrequired
Once LotSizeL = MinSizeL //starting size (can be bigger than minimum)
Once LotStepL = LL200 //250 //increase/decrease this money step
LotSizeL = max(MinSizeL,MinSizeL + (MinSizeL * round(LongProfit / LotStepL)))
myLotL=LotSizeL
// for SHORT trades
Once MinSizeS = 1 //minimum sizecrequired
Once LotSizeS = MinSizeS //starting size (can be bigger than minimum)
Once LotStepS = LS200 //250 //increase/decrease this money step
LotSizeS = max(MinSizeS,MinSizeS + (MinSizeS * round(ShortProfit / LotStepS)))
myLotS=LotSizeS
if close crosses over average[200,0](close) then
buy myLotL contract at market
elsif close crosses under average[200,0](close) then
sellshort myLotS contract at market
endif
set target pprofit 600
set stop ploss 200
//