This indicator allows you to measure your risk when you take a trade, according to the configured stop loss, the gain / risk ratio and the risk you want to take in relation to your capital.
It also allows the ATR to be taken into account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
// Variables : // Capital, entier, défault 10000 // Risque : decimal, défault 1 // In : decimal // Ratio : entier, défault 2 // Stoploss : decimal // Atr : boolean, défault false if Atr then LeR = In - (stoploss - AverageTrueRange[14](close)) slAtr = stoploss - AverageTrueRange[14](close) else LeR=In-stoploss slAtr = 0 endif NiveauRatio=In+LeR*ratio sl = LeR/In slEnPourcent = sl*100 nbactions = round(((risque/100)/sl*capital)/In) risqueEnEuros = risque/100*capital taillepose = (round(nbactions*In)) objectifGain = round(NiveauRatio*nbactions-nbactions*In) indexSl = In*1.01 indexGain = In*1.03 indexObj = In*1.05 indexRisque = In*1.07 indexNbaction = In*1.09 indextaillePos = In*1.11 indexPrixAchat = In*1.13 if islastbarupdate then DRAWSEGMENT(barindex-10, In, barindex+1, In) coloured(0,0,255) style(line,3) DRAWSEGMENT(barindex-10, NiveauRatio, barindex+1, NiveauRatio) coloured(0,155,0) style(line,3) if Atr then DRAWSEGMENT(barindex-10, slAtr, barindex+1, slAtr) coloured(255,0,0) style(dottedline,2) DRAWTEXT("stop - ATR", barindex+4, slAtr) DRAWTEXT("SL - ATR : #slAtr# soit #slEnPourcent# %", barindex+25, indexSl) else DRAWSEGMENT(barindex-10, stoploss, barindex+1, stoploss) coloured(255,0,0) style(line,3) DRAWTEXT("SL : #stoploss# € soit #slEnPourcent# %", barindex+25, indexSl) DRAWTEXT("Stop", barindex+3, stoploss) endif DRAWTEXT("Entrée", barindex+4, In) DRAWTEXT("R #ratio#/1", barindex+4, NiveauRatio) coloured(0,155,0) DRAWTEXT("Prix d'achat : #In# €", barindex+25, indexPrixAchat) DRAWTEXT("Taille position : #taillepose# €", barindex+25, indextaillePos) DRAWTEXT("Nombre d'actions : #nbactions#", barindex+25, indexNbaction) DRAWTEXT("Risque : #risqueEnEuros# €", barindex+25, indexRisque) DRAWTEXT("Objectif de cours : #NiveauRatio# €", barindex+25, indexObj) DRAWTEXT("Objectif de gain de : #objectifGain# €", barindex+25, indexGain) endif return |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello all,
I was really interested to play around this indicator but I received an error after the import un PRT 10.3.
Erreur de syntaxe : Ligne 35, caractere 64
Une des expressions suivante serait plus appropriée que “style”.
-“n”
Do you know if the problem is coming from the fact that I’m not using the current PRT V11 available ?
Thanks in advance,
Bonjour, Merci pour cet indicateur. Pou rma part fonctionne bien sur PRT 11. Comment le modifier pour faire apparaitre comme pour le ratio 1/1, le ratio de 2,3 etc… en ayant une ligne apparente pour chacun des ratios ? Merci
not sure why its not working at all!