Risk Calculator

Discussion in 'MetaTrader Indicators' started by Enivid, Apr 24, 2015.

  1. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Discuss Risk Calculator indicator in this thread. The indicator can calculate and display the potential risk of all your trades by currency pairs and in total. It is freely available for MT4 and MT5. You can ask any questions about this indicator here.
     
    Last edited: Sep 5, 2017
  2. chief

    chief Confirmed Tickmill Representative

    217
    2
    37
    put these indicator on my chart, thank's for give us free custom indies ( not much forum provide such). is it available for further development, i mean can we add some idea implemented to these indi. I may ask too much, but if if possible can we put another information similar to exposure indicator :), so we able to pointed at which price our current entries at breakeven point, which mean we end all the order at 0 risk percentage.
    and related to "unlimited loss risk" can we also had exact price level when the entry gonna wipe out our balance, pips till MC perhaps.
    many thank's.
     
  3. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    I don't get it. Could you please give a more clear explanation?

    Thanks for the idea. I will definitely try to implement it.
     
  4. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Unfortunately, adding margin calculation to the indicator would significantly hinder its performance making it useless for situations with several pending orders. It would only work for very simple situations, like 2-4 pending orders or just many open orders.
     
  5. Manoes

    Manoes Newbie

    8
    1
    3
    Hello brother., thank you so much for sharing good indicator for peoples, I pray for you to live long with happy,healthy and wealthy

    Today I downloaded this indicator and tried. But it shows the error in "OrderIterator.mqh" line 403
    RO.Delete(RO.IndexOf((CDOMObject*)Ro_Order));
    Error says
    [​IMG]
    It will be really great to have this indicator working.,

    Thanks with Regards
     
  6. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Thanks for reporting the bug! Looks like something has changed in one of the newer MetaTrader builds.

    I have fixed the error - please redownload the indicator version 1.02.
     
    Manoes likes this.
  7. Manoes

    Manoes Newbie

    8
    1
    3
    Hi @Enivid Thank you so much for the update. Is there any option i can enter the price(by using horizontal line) as open order price and lot size with SL or TP (by using horizontal line) so it can tell the profit loss percentage for the current equity or balance?.

    With Regards
     
  8. Manoes

    Manoes Newbie

    8
    1
    3
    Hello @Enivid I saw the Position size indicator have the option. but need bit modified. like this.,
    [​IMG]
     
  9. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    I don't have such a calculator but you can achieve it simply by entering different risk values until the Position Size equals your desired input value. Of course, you should be doing it in the panel version of PSC, not the text one you have on this screenshot.
     
  10. Pier71

    Pier71 Trader

    3
    0
    7
    Hi, I'm having trouble with this indi. MQ4 file does not compile, 90 errors and 11 warnings. what's going on? Thanks for your help.
    Pier
     
  11. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Please post the errors and warnings you are getting here.

    Also, please make sure that you have copied the Include folder, which is bundled in the indicator's zip-file, to the MQL4 folder too. It contains vital files for the Risk Calculator's compilation.
     
  12. Pier71

    Pier71 Trader

    3
    0
    7
    I have included (copied) the Include folder (which btw includes MQL5 Header files)

    Please find below the list with 80 error(s), 2 warning(s) 81 3

    can't open "C:\Users\Pierluigi\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\include\OrderMap.mqh" include file RiskCalculator.mq4 22 11
    can't open "C:\Users\Pierluigi\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\include\StatusObject.mqh" include file RiskCalculator.mq4 23 11
    can't open "C:\Users\Pierluigi\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\include\RemainingOrderObject.mqh" include file RiskCalculator.mq4 24 11
    can't open "C:\Users\Pierluigi\AppData\Roaming\MetaQuotes\Terminal\294B6FCE6F709DE82DA4C87FDBF1DE36\MQL4\include\OrderIterator.mqh" include file RiskCalculator.mq4 25 11
    'COrderIterator' - struct undefined RiskCalculator.mq4 44 8
    '=' - unexpected token RiskCalculator.mq4 44 35
    'COrderIterator' - struct undefined RiskCalculator.mq4 45 8
    '=' - unexpected token RiskCalculator.mq4 45 40
    'COrderIterator' - declaration without type RiskCalculator.mq4 46 1
    'UNLIMITED' - undeclared identifier RiskCalculator.mq4 136 20
    'UNDEFINED' - undeclared identifier RiskCalculator.mq4 136 72
    'COrderIterator' - import not defined RiskCalculator.mq4 153 4
    'COrderIterator' - import not defined RiskCalculator.mq4 154 4
    'OrderIterator' - undeclared identifier RiskCalculator.mq4 155 2
    'COrderIterator' - declaration without type RiskCalculator.mq4 155 22
    'COrderIterator' - struct undefined RiskCalculator.mq4 155 22
    '=' - illegal operation use RiskCalculator.mq4 155 16
    '=' - some operator expected RiskCalculator.mq4 155 16
    'CDOMObject' - undeclared identifier RiskCalculator.mq4 157 4
    'order' - undeclared identifier RiskCalculator.mq4 157 16
    expression has no effect RiskCalculator.mq4 157 15
    'CStatusObject' - declaration without type RiskCalculator.mq4 181 22
    'CStatusObject' - struct undefined RiskCalculator.mq4 181 22
    'Buy' - undeclared identifier RiskCalculator.mq4 181 77
    '=' - illegal operation use RiskCalculator.mq4 181 16
    'Status' - struct or class type expected RiskCalculator.mq4 182 24
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 185 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 185 25
    'Sell' - undeclared identifier RiskCalculator.mq4 185 62
    'SLTP' - undeclared identifier RiskCalculator.mq4 185 74
    '=' - illegal operation use RiskCalculator.mq4 185 19
    'RO' - struct or class type expected RiskCalculator.mq4 186 27
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 190 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 190 25
    'Sell' - undeclared identifier RiskCalculator.mq4 190 62
    'SLTP' - undeclared identifier RiskCalculator.mq4 190 74
    '=' - illegal operation use RiskCalculator.mq4 190 19
    'RO' - struct or class type expected RiskCalculator.mq4 191 27
    'CStatusObject' - declaration without type RiskCalculator.mq4 198 22
    'CStatusObject' - struct undefined RiskCalculator.mq4 198 22
    'Sell' - undeclared identifier RiskCalculator.mq4 198 77
    '=' - illegal operation use RiskCalculator.mq4 198 16
    'Status' - struct or class type expected RiskCalculator.mq4 199 24
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 202 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 202 25
    'Buy' - undeclared identifier RiskCalculator.mq4 202 85
    'SLTP' - undeclared identifier RiskCalculator.mq4 202 96
    '=' - illegal operation use RiskCalculator.mq4 202 19
    'RO' - struct or class type expected RiskCalculator.mq4 203 27
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 207 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 207 25
    'Buy' - undeclared identifier RiskCalculator.mq4 207 85
    'SLTP' - undeclared identifier RiskCalculator.mq4 207 96
    '=' - illegal operation use RiskCalculator.mq4 207 19
    'RO' - struct or class type expected RiskCalculator.mq4 208 27
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 216 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 216 25
    'Sell' - undeclared identifier RiskCalculator.mq4 216 88
    'Pending' - undeclared identifier RiskCalculator.mq4 216 148
    '=' - illegal operation use RiskCalculator.mq4 216 19
    'RO' - struct or class type expected RiskCalculator.mq4 217 27
    'CRemainingOrderObject' - declaration without type RiskCalculator.mq4 221 25
    'CRemainingOrderObject' - struct undefined RiskCalculator.mq4 221 25
    'Buy' - undeclared identifier RiskCalculator.mq4 221 97
    'Pending' - undeclared identifier RiskCalculator.mq4 221 110
    '=' - illegal operation use RiskCalculator.mq4 221 19
    'RO' - struct or class type expected RiskCalculator.mq4 222 27
    'current_price' - struct or class type expected RiskCalculator.mq4 227 18
    possible loss of data due to type conversion RiskCalculator.mq4 227 32
    'UNDEFINED' - undeclared identifier RiskCalculator.mq4 229 24
    'OrderIterator' - object pointer expected RiskCalculator.mq4 231 11
    'COrderIterator' - import not defined RiskCalculator.mq4 246 8
    'else' - semicolon expected RiskCalculator.mq4 247 4
    'COrderIterator' - import not defined RiskCalculator.mq4 247 122
    'else' - semicolon expected RiskCalculator.mq4 248 4
    'COrderIterator' - syntax error RiskCalculator.mq4 247 122
    'DoubleToString' - some operator expected RiskCalculator.mq4 247 107
    'COrderIterator' - import not defined RiskCalculator.mq4 252 20
    'if' - semicolon expected RiskCalculator.mq4 253 7
    ')' - not all control paths return a value RiskCalculator.mq4 287 1
    'UNDEFINED' - undeclared identifier RiskCalculator.mq4 298 21
    'UNLIMITED' - undeclared identifier RiskCalculator.mq4 299 21
     
  13. Pier71

    Pier71 Trader

    3
    0
    7
    Sorted Out....I had included the "include" in the wrong folder...the indicators folder under include :)

    Thanks for the quick response
     
  14. bharatw

    bharatw Trader

    4
    1
    14
    Hi @Enivid

    Thank you very much for sharing the Risk Calculator. I use it very frequently and find it very effective. I am not sure why buy any trades with 'USDCAD' & 'USDCHF' shows incorrect values. I have checked the stop loss levels and did not find anything wrong with it. Are you please able to help with this issue.
     

    Attached Files:

    Enivid likes this.
  15. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    What broker is that?
     
  16. bharatw

    bharatw Trader

    4
    1
    14
    Thanks for the prompt response. I have tried it with two brokers and both show similar results. I use "ATC Brokers" based in UK and "Vantage FX" based in Australia.
     
  17. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Thanks for reporting this interesting bug! Please use this hotfix while I will be doing some other changes before releasing a new version of Risk Calculator.

    In /Include/OrderIterator.mqh change the code on the line 318 from:
    Code (MQL4):
        for (CRemainingOrderObject *RO_order = RO.GetFirstNodeAtPrice(order_price); (RO_order != NULL) && (RO_order.Price() == order_price); RO_order = RO.GetNextNode())
     
    to:
    Code (MQL4):
        for (CRemainingOrderObject *RO_order = RO.GetFirstNodeAtPrice(order_price); (RO_order != NULL) && (RO_order.Price() == order_price); RO_order = RO.GetCurrentNode())
     
     
  18. bharatw

    bharatw Trader

    4
    1
    14
    I am glad it continues to become a robust indicator. I tried to update the suggested row with new code however the compiler generates lot of unresolved variables. Please find below the result.
     

    Attached Files:

  19. Enivid

    Enivid Administrator Staff Member

    8,368
    289
    114
    Do not compile OrderIterator.mqh. Compile only RiskCalculator.mq4.
     
  20. bharatw

    bharatw Trader

    4
    1
    14
    My apologies for the confusion.

    You are an absolute STAR. This line of code has indeed addressed the bug. Thanks a ton for your support.
     

Share This Page