Skip to main content

Risk/Reward Ratio Auto Calculation and Drawing for Amibroker (AFL)

xnohat almost 7 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker, risk management

Risk/Reward Ratio, Stop Loss and Target, Auto Calculation and Drawing

Screenshots

Indicator / Formula

Copy & Paste Friendly

Apply Directly to Price Chart

// Code by xnohat.com
"Date="+Date();
Entry=ParamField("Entry",3);
StopLoss=Entry-((Entry/100)*Param("StopLoss%",10));
Target=Entry+((Entry/100)*Param("Target%",15));
"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); 

Plot(SelectedValue(Entry),"Entry",colorYellow,styleDashed); 
Plot(SelectedValue(StopLoss),"StopLoss",colorRed,styleDashed); 
Plot(SelectedValue(Target),"Target",colorGreen,styleDashed); 

0 comments

Leave Comment

Please login here to leave a comment.