afl to calculate risk, profit and RR Ratio

1sandeepgupta

Well-Known Member
#1
Simply go to amibroker's Analysis-Commentry-formula and paste the below code and save it, then change entry, stoploss, target prices and now click commentry, it will show the values of other parameters.:)

"Date="+Date();
Entry=10.15;
StopLoss=9.57;
Target=13.97;
"Entry="+WriteVal(Entry);
"StopLoss="+WriteVal(StopLoss);
"Target="+WriteVal(Target);
Risk=(Entry-StopLoss);
RiskPer=((Entry-StopLoss)/Entry)*100;
"Risk%="+WriteVal(RiskPer);
Profit=(Target-Entry);
ProfitPer=((Target-Entry)/Entry)*100;
"Profit%="+WriteVal(ProfitPer);
RRR=(Profit/Risk);
"RRRatio="+WriteVal(RRR);
 
#4
Mr.Hatsenlienhuong,

First save the formulae through FORMULA EDITOR. Then click on COMMENTARY. Immediately guru chart commentary will open. After that click on formula in guruchart commentary and click on LOAD button and select the formulae where you have saved. Then change the parametres of entry, stoploss,target for the current chart. Then click on commentary. You will get results.
 
#5
Mr.Hatsenlienhuong,

First save the formulae through FORMULA EDITOR. Then click on COMMENTARY. Immediately guru chart commentary will open. After that click on formula in guruchart commentary and click on LOAD button and select the formulae where you have saved. Then change the parametres of entry, stoploss,target for the current chart. Then click on commentary. You will get results.
Thanks alot.your brief details clear everything like a water.keep it up bro.
 
#6
if you/anyon can add position size then it will be very helpful for novice like me.thanks in advance

like :
i want to know if i pick xyz price and target xyz = ?no of share
 

Similar threads