Citazione Originariamente Scritto da armando Visualizza Messaggio
Gent. Max e Fabio
Di seguito lo script posto in strategia nella giornata odierna.
Script Buy:
INPUTS: @price(CLOSE), @periods(14), @trailAmount(100), @trailPercent(10), @stopLoss(400), @SLperiods(8)
INPUTS: @matype(EXPONENTIAL)

SET TRAILING_STOP = @trailAmount
SET TRAILING_PERCENT = @trailPercent
SET STOP_LOSS = @stopLoss
SET TnP= TotalNetProfit()
SET a = MovingAverage(@price, 8, @matype)
SET b = MovingAverage(@price, 14, @matype)
SET c = MovingAverage(@price, 20, @matype)
SET d = MovingAverage(@price, 30, @matype)
a> b AND
b> c AND
c> d AND
((a+b+c)/3) - d> 15
AND TIME <1730
AND (TnP< 800 OR TnP >-500)

Script Sell:
SET a = MovingAverage(@price, 8, @matype)
SET b = MovingAverage(@price, 14, @matype)
SET c = MovingAverage(@price, 20, @matype)
SET d = MovingAverage(@price, 30, @matype)
SET TnP = TotalNetProfit()
a< b AND
b< c AND
c< d AND
d- ((a+b+c)/3) > 15
AND TIME <1730
AND (TnP< 800 OR TnP >-500)

E questo é il risultato:

Clicca sull'immagine per ingrandirla

Nome: 2014-08-06_Trade Nastrone_EMA_M4.jpg
Visite: 39
Dimensione: 45.7 KB
ID: 16087

Mi sembra che adesso, con la suddetta formulazione, lo script "tollera" la presenza del TotalNetProfit in oggetto ma che nel contempo, come dal trend il risultato sia purtroppo di non intervenuto.
Saluti
Armando
Ciao Armando, ma tu vuoi uscire dai trades quando raggiungi 800€ o il contrario? Perchè AND (TnP< 800 OR TnP >-500) vuol dire che esce quando TnP è inferiore a 800 e questa condizione è sempre verificata quando parte il trade, prova ad invertire i segni!