Position Size Calculator

Discussion in 'MetaTrader Indicators' started by Enivid, Mar 27, 2012.

  1. Alexter

    Alexter Active Trader

    23
    12
    29
    Thanks for the quick response @Enivid . I actually thought that after posting.

    I started making a prototype EA with what I know and tools I have.

    I will share it with you so you can have a look and see if it can have value here. (i would also like suggestions for any improvements in the code or the insconsistencies in the calculations I am having with it)
     
  2. SPATrading

    SPATrading Trader

    1
    1
    9
    Amazing tool!!! Thanks
     
    Enivid likes this.
  3. Alexter

    Alexter Active Trader

    23
    12
    29
    Hi @Enivid.

    I started having a strange issue recently.

    I'm using v1.7 and with one broker (which for some reason uses .... as the suffix for the pairs) whenever I change the timeframe the calculator re-opens (i have it "minimized" and when changing it opens again). Also for some reason with any broker, I get a think that the max position size in the scripts tab gets reset to 1 for no apparent reason.
    I'm not sure what can be causing this issue if its the config files the indicator uses or something with the settings or another thing.

    It would be nice if you could investigate it.

    Thanks
     
    Enivid likes this.
  4. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    Which broker is that? I need to test it.

    When does it get reset? When you restart a platform or switch timeframes or just randomly?
     
  5. Alexter

    Alexter Active Trader

    23
    12
    29
    Thanks for the quick response.

    The broker is EliteTechnology ( I am using it as part of a Prop Firm application process).
    I can give you the .SRV file if that helps in any way.
    This is the link to download their MT4 platform (though I use my own configured MT4 platform that worked and still works well with other brokers)
    Download MT4

    As for the reset, it happens whenever I change timeframe or re-open the profile (this includes changing profiles as well as closing and opening the terminal).
    It's strange I have not had this problem before at all. I think it may be the broker data feed or something like that causing it to reset.

    Thanks for your hard work.
     

    Attached Files:

  6. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    Did this happen when the actual value was >= 0.5 and < 1.5?
     
  7. Alexter

    Alexter Active Trader

    23
    12
    29
    Yes,
    When I had it as 0.26 it went to 0 on the reset. So it seems it rounds the value up to the nearest integer upon the reset (i call reset to what happens when I change the timeframe or anything that makes it pop up again even if it was minimized. )
     
  8. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    Thanks! Then I have found the problem causing this. It will be fixed in the next version release.
     
  9. Alexter

    Alexter Active Trader

    23
    12
    29
    Thanks a lot Enivid, you do great work.
     
  10. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    Alexter, Velgengni and EnrichWave like this.
  11. thealchemist

    thealchemist Trader

    5
    0
    7
    Hi Enivid,
    I love your indicator and it works great for MT4.
    Bugs I've found:
    For MT5, tried both Pepperstone and ICMarkets versions on my Macbook. There are a few bugs for me using 2.18 or earlier versions.

    1. When configuring PSC I cannot change SL label color, TP Label Font Color, Entry line, SL Line color, TP Line color. (When I double click, nothing happens) No problems with any other settings. All else seemed to be working fine.

    2. If I execute an instant order, SL and TP will be left empty (0.00000). A stop-order on the other hand still has S/L and T/P intact. Any ideas?

    This goes for all currency pairs I've tested, try EURUSD for example.

    Thank you.
     
  12. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    I change them without problems via input parameters:

    labels.png

    You cannot double-click and select the labels on chart to modify their properties - this is done intentionally. If you still want to change their color (and do not want to do it via the indicator's input parameters) or other properties, you can List All in the Objects List (Ctrl+B) and find the labels there.

    Which version of PSC-Trader are you using? What is the output in the Experts tab when you launch it? For example, mine is:
    2019.02.28 08:17:26.726 PSC-Trader (EURUSD,M15) Detected position size: 7.09.
    2019.02.28 08:17:26.727 PSC-Trader (EURUSD,M15) Detected entry level: 1.13748.
    2019.02.28 08:17:26.727 PSC-Trader (EURUSD,M15) Detected entry type: Instant.
    2019.02.28 08:17:26.727 PSC-Trader (EURUSD,M15) Detected stop-loss level: 1.13734.
    2019.02.28 08:17:26.727 PSC-Trader (EURUSD,M15) Detected take-profit level: 1.13772.
    2019.02.28 08:17:26.727 PSC-Trader (EURUSD,M15) Magic number = 0
    2019.02.28 08:17:26.728 PSC-Trader (EURUSD,M15) Order commentary =
    2019.02.28 08:17:26.728 PSC-Trader (EURUSD,M15) Disable trading when lines are hidden = false
    2019.02.28 08:17:26.728 PSC-Trader (EURUSD,M15) Entry line hidden = false
    2019.02.28 08:17:26.729 PSC-Trader (EURUSD,M15) Max slippage = 0
    2019.02.28 08:17:26.729 PSC-Trader (EURUSD,M15) Max spread = 0
    2019.02.28 08:17:26.730 PSC-Trader (EURUSD,M15) Max Entry/SL distance = 0
    2019.02.28 08:17:26.731 PSC-Trader (EURUSD,M15) Min Entry/SL distance = 0
    2019.02.28 08:17:26.731 PSC-Trader (EURUSD,M15) Max position size = 0.00
    2019.02.28 08:17:26.731 PSC-Trader (EURUSD,M15) Subtract open positions volume = false
    2019.02.28 08:17:26.732 PSC-Trader (EURUSD,M15) Subtract pending orders volume = false
    2019.02.28 08:17:26.733 PSC-Trader (EURUSD,M15) Execution mode: SYMBOL_TRADE_EXECUTION_MARKET
    2019.02.28 08:17:26.733 PSC-Trader (EURUSD,M15) Order filling mode: Immediate or Cancel.
    2019.02.28 08:17:26.875 PSC-Trader (EURUSD,M15) Initial return code: done at 1.13748
    2019.02.28 08:17:26.875 PSC-Trader (EURUSD,M15) Order ID: 887355
    2019.02.28 08:17:26.875 PSC-Trader (EURUSD,M15) Deal ID: 886281
    2019.02.28 08:17:26.875 PSC-Trader (EURUSD,M15) Position ID: 887355
    2019.02.28 08:17:27.009 PSC-Trader (EURUSD,M15) SL/TP applied successfully.
     
  13. thealchemist

    thealchemist Trader

    5
    0
    7
    1. I cannot double click on lime and change the color.
    I've tried re-installing MT5, I've tried with the Pepperstone version. It all works really smooth on MT4 but not with MT5. I'm only using Mac.
    Screenshot 2019-02-28 at 18.38.00.png

    2. Attached
    Screenshot 2019-02-28 at 18.51.12.png
     
  14. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    I am afraid that's some Mac/MT5 compatibility issue. It looks like the platform fails to load the color palette. Can you change other colors? The indicator's code cannot control whether you are able or not able to change the input parameter.

    It looks like you are using an old version of PSC-Trader. Please use the latest version (1.06).
     
  15. thealchemist

    thealchemist Trader

    5
    0
    7
    True, I cannot change any colors.

    I've updated and will test 1.06 on Monday

    ty and until then
     
  16. EnrichWave

    EnrichWave Active Trader

    39
    2
    34
    Hi, I tested today with MT5. My side working fine.,

    Thank you soooooooo much buddy @Enivid for the great contribution to traders. You are always rememberable one. I know it's really hard to make money in the market. but step by step progress will allow us to be consistent (yearly earning). some months it gives some months it doesn't. don't push the market to take your money.
     
  17. thealchemist

    thealchemist Trader

    5
    0
    7
    Yes, thank you so much Enivid, fantastic sharing of your indicator and script
     
  18. Alexter

    Alexter Active Trader

    23
    12
    29
    Thanks a lot, @Enivid. The updates are greatly appreciated.

    Works great, no more random resets and the new tools are great.

    We really appreacitate the great value you give to the community.
     
  19. ozcoz

    ozcoz Newbie

    2
    1
    3
    Hey Enivid,

    Amazing work with this indicator, thanks for all the time and effort you've put into it, it's so quick and easy to use.

    I have a suggestion for improvement for the take profit multiplier. Is it possible to factor in the commission into this, as I TP at 3% for most of my trades and hitting the 3x TP button doesn't give me 3% return as it just multiplies the SL by 3. Even if I make the multiplier 3.5 it rarely works out to be 3%, sometimes over, sometimes under.

    The other minor question I had, was that on MT4 the indicator is quite compact, but on MT5 there are larger gaps between the fields which fills up the majority of my chart, is that normal, and can it be fixed so it's smaller like on MT4? I'm currently minimising it so not a major issue.

    Thanks.
     
    Enivid likes this.
  20. Enivid

    Enivid Administrator Staff Member

    11,031
    404
    114
    The button is there just for a quick TP placement. You can adjust the TP by moving the line and looking at the resulting Reward. I might add an input parameter for the TP button to take Commission size into account, but I am not yet sure that adding another input parameter is worth it.

    MT5 now supports lot sizes down to 0.00000001 (compared to MT4's 0.01). Although no brokers that I know of do not offer such position volume granularity, I had to implement the wider panel elements to accommodate such lot precision.
     
    ozcoz likes this.

Share This Page