Bonjour, mon’indicateur extratrend acheté sur ProRealCode Market fonctionne bien en backtest mais impossible de déclencher un proorderautotrading, et lorsque j’édite le code proorderautotrading j’ai en fin de code: //—————————————————————- //
code indisponible
ci dessous recopie de mon système de trading
//-------------------------------------------------------------------------
// Code principal : tradeprice
//-------------------------------------------------------------------------
DEFPARAM cumulateOrders = false // Cumulating positions deactivate
Defparam flatafter = 173000 //close the position at 16:00 (day trading) /could be switched off
ONCE myatr = 1.0
ONCE partialprofitfactor = 1.0
ONCE ratchetfactor = 1.0
ONCE risque = 1.0
ONCE stopfactor = 1.0
once StartE = 90000 //start time for opening positions
once StartL = 17300 //ending time for opening positions (only trading in the morning)
// = Barindex - TradeIndex(1) > IntradayBarIndex // limits the (opening) trades till 1 per day (OTD One Trade per Day)
capitalinitial=10000
risque=risque
stopfactor=stopfactor//1.5
partialprofitfactor=partialprofitfactor//3
ratchetfactor=ratchetfactor//7
myatr=myatr
myTrend,ignored,ignored,myReDyn,ignored = CALL "ExtraTrend"[0,1, 0, 0, 0, 0](close)
ratchet=lowest[30](highest[55](high)-ratchetfactor*averagetruerange[myatr])
ok=myTrend[1]<>myReDyn[1]
if ok and not longonmarket and close>myReDyn[1] then
positionsize=round(((capitalinitial+STRATEGYPROFIT)*(risque/100))/(1.5*averagetruerange[20]))
BUY positionsize shares AT MARKET
set stop loss stopfactor*averagetruerange[myatr]
flag=0
ENDIF
if longonmarket and close>=tradeprice+(partialprofitfactor*averagetruerange[myatr]) and flag=0 then //
sell round(positionsize/2) shares at market
flag=1
endif
if LONGONMARKET and close sell at market
endif
//-------------------------------------------------------------------------
// Fonction : ExtraTrend
//-------------------------------------------------------------------------
Code indisponible
“code indisponible”, c’est normal puisque celui-ci n’est pas libre, mais ça n’est pas cela qui doit empêcher le fonctionnement de la stratégie, à l’instar de ce qui marche dans le backtest.
Le calcul de la taille de position est-il correct ? et adapté à l’instrument ?
oui le calcul de la taille de position est correct et adapté à l’instrument.
lorsque je tente “dupliquer un système de trading” puis “préparer pour le trading automatique” à partir du papertrading j’ai le message
“le code est invalide corrigez le ligne 41 erreur commande inconnue” or la ligne 41 correspond à la fonction extratrend code indisponible.
Merci pour le retour, je vais investiguer et revenir poster les informations dés que possible.
Bonjour, avez-vous pu trouver une solution svp ? Je suis dans le même cas que cette personne.
Merci
bonjour,
il y a une erreur a la ligne 35.
la condition n’est pas fermé ,il manque then
@keyeming
avec ce même code ou avec un autre ?
Ligne 21 -> Il y’a 5 paramètres dans l’Extratrend et je vois que tu en appelles 6…retires un “0” !
myTrend,ignored,ignored,myReDyn,ignored = CALL “ExtraTrend”[0,1, 0, 0, 0, 0](close)
non il y bien 6 cases à cocher donc CALL “ExtraTrend”[0,1, 0, 0, 0, 0](close)