bonjour,
Lorsque j’ai voulu activer pro order avec le code ci après je me suis heurtée à un refus de l’exécution des ordres au motif ” ordre rejeté par le courtier ou par le marché. “For the controlled risk order, neither contingent stop nor the tralling stop is set”
SMA=Average[Periods](close)
IF NOT ONMARKET THEN
IF Close CROSSES OVER SMA THEN
BUY AT MARKET
ENDIF
ELSE
IF Close CROSSES UNDER SMA THEN
SET STOP %LOSS StopPercent
SET Target %PROFIT StopPercent * ProfitLossRatio
ENDIF
ENDIF
GRAPHONPRICE SMA
pourtant les instructions de sortie me paraissent définies. Auriez vous une idée pour que les ordres s’exécutent?
Je vous en remercie par avance
JSParticipant
Senior
Salut,
Quelles valeurs avez-vous utilisées pour le “StopPercent” et le “ProfitLossRatio”… ?
bonjour,
Merci à vous de vous penchez sur mon problème 🙂
J’ai utilisé les valeurs suivantes:
StopPercent: 1.5%
ProfitLossRatio: 0.5
JSParticipant
Senior
En principe, tout fonctionne… ?
oui en backtest ça fonctionne très bien… mais en réel mes ordres sont rejetés
JSParticipant
Senior
Je vois maintenant ce qui risque de se passer, car si vous achetez sans « StopLoss » lié, les ordres seront rejetés sur votre compte « risque limité »…
Essayez ceci…
Periods=20
StopPercent=1.5
ProfitLossRatio=0.5
SMA=Average[Periods](close)
IF NOT ONMARKET THEN
IF Close CROSSES OVER SMA THEN
BUY AT MARKET
SET STOP %LOSS StopPercent
SET Target %PROFIT StopPercent * ProfitLossRatio
ENDIF
EndIf
GraphOnPrice SMA coloured("Red")
et si vous modifié comme ci dessous en lui donnant le nombre de contrat
Periods=20
StopPercent=1.5
ProfitLossRatio=0.5
SMA=Average[Periods](close)
IF NOT ONMARKET THEN
IF Close CROSSES OVER SMA THEN
BUY 1 contract AT MARKET
SET STOP %LOSS StopPercent
SET Target %PROFIT StopPercent * ProfitLossRatio
ENDIF
EndIf
GraphOnPrice SMA coloured("Red")
Merci beaucoup pour vos retours, je teste ça des demain
Corrigé selon vos conseil l’ordre a bien été éxécuté!
Merci à vous 🙂