Onmarket dans un indicateur ?
Forums › ProRealTime forum Français › Support ProBuilder › Onmarket dans un indicateur ?
- This topic has 5 replies, 3 voices, and was last updated 9 months ago by
ground77600.
-
-
01/25/2025 at 5:16 PM #243095
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.
01/25/2025 at 5:22 PM #24309601/25/2025 at 5:57 PM #243097soit 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 ?
01/25/2025 at 6:11 PM #24309801/27/2025 at 1:11 PM #243117Vous pouvez utiliser ce code :
1234567891011121314151617181920once 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")endifreturn01/27/2025 at 2:36 PM #243124Vous pouvez utiliser ce code :
1234567891011121314151617181920once 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”)endifreturnBonjour Ivàn,
Merci beaucoup ! Je vais essayer ça de suite !
Bien cordialement.
-
AuthorPosts
Find exclusive trading pro-tools on 