qualcuno può aiutarmi a tradurre questo codice per renderlo automantico ,grazie
Trading System : dax 50
Parametri da inserire manualmente dal trade
1) Trend (up/down)
2) Start level
3) Box (ampiezza movimento e livello di stop loss /profit)
Quindi :
trend UP
se last price <= start level-box allora sell 1 contract set target profit + 50 set stop ploss -50 se last price >= start level +50 allora NEW start level = start level+ 50 (TRAILING START)
trend DOWN
se last price >= start level + box allora buy 1 contract
set target profit +50
set stop ploss -50
se last price <= start level – 50 allora New start level = start level -50 (TRAILING START)
Pubblica il tuo argomento nel forum corretto:
_ Supporto piattaforma ProRealTime: solo problemi relativi alla piattaforma.
_ ProOrder: solo argomenti su strategie.
_ ProBuilder: solo argomenti su indicatori.
_ ProScreener: solo argomenti su screener.
_ Discussione generale di Trading: qualsiasi altro argomento di trading.
_ Benvenuto ai nuovi membri: per permettere ai nuovi membri del forum di presentarsi.
Grazie 🙂
L’ho spostato io nel forun corretto.
Ecco la strategia:
Trend = 1 //1=UP, -1=DOWN
StartLevl = 16000
Box = 50
IF Trend = 1 THEN //UP
IF close <= (StartLevel - Box) THEN
SELLSHORT 1 CONTRACT AT MARKET
SET TARGET PRICE close - 50*PipSize
SET STOP PRICE close + 50*PipSize
ENDIF
ELSIF Trend = -1 THEN //DOWN
IF close >= (StartLevel + Box) THEN
BUY 1 CONTRACT AT MARKET
SET TARGET PRICE close + 50*PipSize
SET STOP PRICE close - 50*PipSize
ENDIF
ENDIF
// trailing start
IF LongOnMarket THEN
IF close <= (StartLevel - 50) THEN
StartLevel = StartLevel - 50*PipSize
ENDIF
ELSIF ShortOnMarket THEN
IF close >= (StartLevel + 50) THEN
StartLevel = StartLevel + 50*PipSize
ENDIF
ENDIF
Buongiorno,
grazie per la cortese risposta. Ho due problemi però :
- il sistema entra solo per posizioni long
- il codice non riconosce la scala di ingresso (in questo caso 50 punti) quindi va a mercato alle 9:00 invece che attendere il valore di ingresso multiplo di 50
// Definizione dei parametri del codice
DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
// Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l’orario “Flat Before” non saranno piazzati nuovi ordini o posizioni.
DEFPARAM FLATBEFORE = 090000
// Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all’orario “Flat After”
DEFPARAM FLATAFTER = 123000
// Impedisce al sistema di tradare in giorni specifici della settimana
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
trend = -1 // 1=UP, -1=DOWN
StartLevl = 17900
Box = 50
if not onmarket then
IF Trend = 1 THEN //UP
IF close <= (StartLevel – Box) THEN
SELLSHORT 1 CONTRACT AT MARKET
SET TARGET PRICE close – 50*PipSize
SET STOP PRICE close + 50*PipSize
ENDIF
ELSIF Trend = -1 THEN //DOWN
IF close >= (StartLevel + Box) THEN
BUY 1 CONTRACT AT MARKET
SET TARGET PRICE close + 50*PipSize
SET STOP PRICE close – 50*PipSize
ENDIF
ENDIF
// trailing start
IF LongOnMarket THEN
IF close <= (StartLevel – 50) THEN
StartLevel = StartLevel – 50*PipSize
ENDIF
ELSIF ShortOnMarket THEN
IF close >= (StartLevel + 50) THEN
StartLevel = StartLevel + 50*PipSize
ENDIF
ENDIF
// Stop e target
SET STOP pLOSS 50//trailing 100
SET TARGET pPROFIT 50
ENDIF
Per Long o Short devi variare tu il parametro TREND, mettendo 1 se è al rialzo o -1 se pè al ribasso.
Hai specificato di inserire i dati manualmente per poi automatizzare le entrate.
Puoi crearti due copie della setssa strategia, dove su una metti il valore 1 e sull’altrea il valore -1.
Per l’arrore di entrata sui 50 punti, indicami lo strumento ed il time frame usato, con l’ora della candela di entrata di un’operazione sbagliata.
per il momento funziona in back test solo lo indicando trend -1 . con il trend 1 non ho risultati in back test
uso lo strumento dax index time frame 1 secondo. tutte le operazioni entrano alle 9 ed eseguono solo posizioni andando a mercato
Alega il file ITF che hai usato.
// Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l’orario “Flat Before” non saranno piazzati nuovi ordini o posizioni.
DEFPARAM FLATBEFORE = 090000
// Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all’orario “Flat After”
DEFPARAM FLATAFTER = 123000
// Impedisce al sistema di tradare in giorni specifici della settimana
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
trend = -1 // 1=UP, -1=DOWN
StartLevl = 17900
Box = 50
if not onmarket then
IF Trend = 1 THEN //UP
IF close <= (StartLevel – Box) THEN
SELLSHORT 1 CONTRACT AT MARKET
SET TARGET PRICE close – 50*PipSize
SET STOP PRICE close + 50*PipSize
ENDIF
ELSIF Trend = -1 THEN //DOWN
IF close >= (StartLevel + Box) THEN
BUY 1 CONTRACT AT MARKET
SET TARGET PRICE close + 50*PipSize
SET STOP PRICE close – 50*PipSize
ENDIF
ENDIF
// trailing start
IF LongOnMarket THEN
IF close <= (StartLevel – 50) THEN
StartLevel = StartLevel – 50*PipSize
ENDIF
ELSIF ShortOnMarket THEN
IF close >= (StartLevel + 50) THEN
StartLevel = StartLevel + 50*PipSize
ENDIF
ENDIF
// Stop e target
SET STOP pLOSS 50//trailing 100
SET TARGET pPROFIT 50
ENDIF
Modifiche le seguenti due righe come segue:
StartLevel = 17900
Box = 50*pipsize
nella prima il nome era errato, nella seconda è opportuno aggiungere *PipSize, anche se con il DAX è ininfluente.
come faccio per dire al sistema di eseguire una sola operzione al giorno ,cioè una sola posizione long o una short?
non mi riconosce il segnale di trailing start .
es: se il prezzo continua a salire non si aggiorna il livello d’ingresso short
non riesco a sistemare il trailing start, può aiutarmi cortesemente?
Questa versione lo aggiorna, ma non è facile fare le prove, perché è molto difficile che si verifchino:
// Il sistema cancellerà tutti gli ordini in attesa e chiuderà tutte le posizioni a 0:00. Dopo l’orario "Flat Before" non saranno piazzati nuovi ordini o posizioni.
//DEFPARAM FLATBEFORE = 090000
// Cancellare tutti gli ordini in attesa e chiudere tutte le posizioni all’orario "Flat After"
//DEFPARAM FLATAFTER = 123000
// Impedisce al sistema di tradare in giorni specifici della settimana
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
ONCE trend = -1 // 1=UP, -1=DOWN
ONCE StartLevel = 17900
ONCE Box = 50*pipsize
if not onmarket then
IF Trend = 1 THEN //UP
IF close <= (StartLevel - Box) THEN
SELLSHORT 1 CONTRACT AT MARKET
SET TARGET PRICE close - 50*PipSize
SET STOP PRICE close + 50*PipSize
ENDIF
ELSIF Trend = -1 THEN //DOWN
IF close >= (StartLevel + Box) THEN
BUY 1 CONTRACT AT MARKET
SET TARGET PRICE close + 50*PipSize
SET STOP PRICE close - 50*PipSize
ENDIF
ENDIF
ENDIF
// trailing start
IF LongOnMarket THEN
IF close <= (StartLevel - 50*PipSize) THEN
StartLevel = StartLevel - 50*PipSize
ENDIF
ELSIF ShortOnMarket THEN
IF close >= (StartLevel + 50*PipSize) THEN
StartLevel = StartLevel + 50*PipSize
ENDIF
ENDIF
// Stop e target
SET STOP pLOSS 50
SET TARGET pPROFIT 50
buongiorno,
ho fatto le prove ma purtroppo continua a non aggiornarsi il livello di ingresso (trailing start) . questo è il codice di prova che ho inserito
// Impedisce al sistema di tradare in giorni specifici della settimana
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
ONCE trend = 1 // 1=UP, -1=DOWN
ONCE StartLevel = 18215
ONCE Box = 5*pipsize
if not onmarket then
IF Trend = 1 THEN //UP
IF close <= (StartLevel – Box) THEN
SELLSHORT 0.5 CONTRACT AT MARKET
SET TARGET PRICE close – 5*PipSize
SET STOP PRICE close + 5*PipSize
ENDIF
ELSIF Trend = -1 THEN //DOWN
IF close >= (StartLevel + Box) THEN
BUY 0.5 CONTRACT AT MARKET
SET TARGET PRICE close + 5*PipSize
SET STOP PRICE close – 5*PipSize
ENDIF
ENDIF
ENDIF
// trailing start
IF LongOnMarket THEN
IF close <= (StartLevel – 5*PipSize) THEN
StartLevel = StartLevel – 5*PipSize
ENDIF
ELSIF ShortOnMarket THEN
IF close >= (StartLevel + 5*PipSize) THEN
StartLevel = StartLevel + 5*PipSize
ENDIF
ENDIF
// Stop e target
SET STOP pLOSS 5
SET TARGET pPROFIT 5
Su quale strumento e timefreame l’hai provato?