Risk Management Indicator

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: Risk Management Indicator

Postby fortesan9 » Mon Apr 12, 2021 11:11 pm

Thanks Don Apprentice,
fortesan9
 
Posts: 52
Joined: Tue May 05, 2020 10:15 pm

Re: Risk Management Indicator

Postby Apprentice » Thu Apr 15, 2021 5:14 am

RiskManagement.lua
(16.19 KiB) Downloaded 224 times

RiskManagement.lua.rc
(10.91 KiB) Downloaded 213 times


Try this version.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Risk Management Indicator

Postby fortesan9 » Fri Apr 16, 2021 1:29 pm

Does not display all data when applying the indicator on the charts.

what am i doing wrong?
Attachments
RMI.jpg
fortesan9
 
Posts: 52
Joined: Tue May 05, 2020 10:15 pm


Re: Risk Management Indicator

Postby fortesan9 » Tue Apr 20, 2021 10:43 pm

The results for Lots, Position Cost, Position Value, Applied Leverage, Limit Profit in $, and Position Profit Margin appear incorrect, these are the formulas:

Lots = (Position Risk Value / Pip Value)

Position Cost = (MMR * Lots)

Position Value = (Lot Size * Lots) * Price

Applied Leverage = (Position Value / Account Equity)

Limit Profit in $ = (Pip Cost) * (Limit Profit in Pips) * (Lots)

Postition Profit Margin = (Limit Profit in Pips / Account Equity)
fortesan9
 
Posts: 52
Joined: Tue May 05, 2020 10:15 pm

Re: Risk Management Indicator

Postby fortesan9 » Wed Apr 21, 2021 11:35 am

Apprentice wrote:You havn't install it.


Displays perfectly fine now, Thanks Don, just the mentioned formulas i think..
Attachments
RMI.jpg
fortesan9
 
Posts: 52
Joined: Tue May 05, 2020 10:15 pm

Re: Risk Management Indicator

Postby Apprentice » Wed Apr 21, 2021 11:37 am

Your request is added to the development list.
Development reference 392.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Risk Management Indicator

Postby Apprentice » Wed Apr 28, 2021 8:54 am

Everything as requested. From the code:

local lots = position_risk_value / pip_value;
CellsBuilder:Add(MAIN_FONT, "Position Cost", text_color, 1, row, 0);
CellsBuilder:Add(MAIN_FONT, win32.formatNumber(MMR * lots, false, 2), text_color, 2, row, 0);
local position_value = entry_price * baseUnitSize * lots;
local leverage = (baseUnitSize * lots * entry_price / equityAmount);
CellsBuilder:Add(MAIN_FONT, "Limit Profit in $", text_color, 1, row, 0);
CellsBuilder:Add(MAIN_FONT, win32.formatNumber(limit_curr, false, 2), text_color, 2, row, 0);
CellsBuilder:Add(MAIN_FONT, "Position Profit Margin %", text_color, 1, row, 0);
CellsBuilder:Add(MAIN_FONT, win32.formatNumber(100 * limit_curr / equityAmount, false, 2) .. "%", text_color, 2, row, 0);
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Previous

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 44 guests