Onmarket dans un indicateur ?
- This topic has 5 replies, 3 voices, and was last updated 5 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime forum Français › Support ProBuilder › Onmarket dans un indicateur ?
Bonsoir,
Je réfléchis à une idée d’indicateur pour afficher automatiquement des niveaux de Take Profit juste au moment d’une entrée en position et que ces niveaux soient effacés si on sort de position. En
L’idéal serait de pouvoir utiliser l’instruction Onmarket mais ça ne marche pas quand on crée un indicateur car la structure est strictement réservée aux stratégies de trading.
Auriez-vous une idée pour contourner ce problème ?
Bien cordialement.
soit une variable booléen ou un algo en backtest
Merci pour votre réponse. Je vois bien pour l’algorithme en backtest mais pensez-vous que je pourrais m’en servir d’indicateur en trading live et manuel ? Vous parlez d’une variable en booléen mais justement que récupérer puisque je ne peux pas obtenir le nombre de positions en cours avec COUNTOFPOSITION ou ONMARKET ?
Vous pouvez utiliser ce code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
once long=0 //Boolean 0=not on market / 1= on market StartDateLong=20250117 //write here the date StartTimeLong=183000 //write here the time buyprice=230 //write here the buyprice takeprofit=265 //write here the takeprofit stoploss=210 //write here the stoploss if long=0 and opentime>=StartTimeLong and opendate>=StartDateLong then long=1 idx=barindex endif if islastbarupdate then drawsegment(idx, takeprofit, barindex+10,takeprofit)coloured("green") drawsegment(idx, buyprice, barindex+10,buyprice)coloured("blue") drawsegment(idx, stoploss, barindex+10,stoploss)coloured("red") endif return |
Vous pouvez utiliser ce code :
1234567891011121314151617181920 once long=0 //Boolean 0=not on market / 1= on marketStartDateLong=20250117 //write here the dateStartTimeLong=183000 //write here the timebuyprice=230 //write here the buypricetakeprofit=265 //write here the takeprofitstoploss=210 //write here the stoplossif long=0 and opentime>=StartTimeLong and opendate>=StartDateLong thenlong=1idx=barindexendifif islastbarupdate thendrawsegment(idx, takeprofit, barindex+10,takeprofit)coloured(“green”)drawsegment(idx, buyprice, barindex+10,buyprice)coloured(“blue”)drawsegment(idx, stoploss, barindex+10,stoploss)coloured(“red”)endifreturn
Bonjour Ivàn,
Merci beaucoup ! Je vais essayer ça de suite !
Bien cordialement.
Find exclusive trading pro-tools on