Position Size Calculator

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

  1. Michael618

    Michael618 Trader

    11
    5
    14
    One more thing about commission.

    1. It was 0.0
    2. I found out how much is the commission on my new broker (pepperstone) => 3.76
    3. i changed the value in indicator's settings or properties
    4. but it didn't updated into the window

    5. i saved though a set with indicator's properties
    6. i closed the indicator
    7. i reopened it, and loaded the set of properties
    8. new value appeared correctly in the window

    so maybe there's a bug at point 4?
    or is this the desired behavior?
     
    Enivid likes this.
  2. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    That's not gibberish. It's the right way to solve the issue - to move the window (minimized or maximized) to the position where the user has dragged it previously to. I am working on it.

    Yes, it looks like an error. I will look if it can be fixed without breaking anything else related to saving the indicator's settings.
     
  3. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    Actually, after considering this a bit more thoroughly I come to a conclusion that such behavior is optimal. It is not a bug because input parameters should not be used to change the values inside the currently loaded panel. They should only be used to set the default values when indicator is first attached to a chart. Otherwise, changing, for example, the commission via inputs on an already attached PSC would reset its SL/TP levels, entry type, and all other settings that are controlled via input parameters.
     
  4. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    On the second (or is it third?) thought, I have decided to implement the modifications necessary for the indicator to react properly to changes in the Risk, EntryType, Commission, and Commentary input parameters. It will work this way: if the input parameter is changed from its previous value, the respective panel's field gets updated (because the user explicitly wanted to update it obviously); if the input parameter is not changed from its previous value, the respective panel's field will remain the same as it had been and will not take the value from the input parameters even if it is different.

    Any other ideas before I roll out the next version update of PSC?
     
  5. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
  6. muscae

    muscae Trader

    5
    2
    9
    Very good indicator, very helpful. I would like to reveal a small bug that I have found. when we change the order type from instant to Pending in the settings and save a settings file, looks like it have changed to Pending but button still appears as Instant.
     
    Enivid likes this.
  7. muscae

    muscae Trader

    5
    2
    9
    Another small bug that I have found is like a missing initialization cleanup. When I attach the indicator to a graph and save it as template, when reuse that template appears two boxes one real and another ghost sitting there. I think that would be easy to fix, but not me, I haven't those skills. If someone could tell me the code to fix, I will appreciate.
    Check what happens after applied template to another instrument.
    https://i.imgur.com/7YNHKs0.png
     
    Enivid likes this.
  8. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    Thanks! It will be fixed in the next release.
     
  9. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    PSC version 2.11 is out. It fixes the bugs mentioned by @muscae and also one bug that was appearing only in MT5 version of the platform.
     
    muscae likes this.
  10. Michael618

    Michael618 Trader

    11
    5
    14
    I was thinking about possible improvement of the indicator, specifically for speed, while contemplating my strategy.

    Given that my SL is almost always between 20 and 30 pips, i wondered about one way to display needed lots for each pip.

    A way would be in the right of the chart, in the form of:

    Pips: lots

    20: 0.05
    21: 0.05
    .
    .
    25: 0.06
    26: 0.06
    ..
    30: 0.08

    Even better, only unique lots values would be needed, to minimize the output.
    Of course, the range would be defined with parameters, i mean from 20 to 30.

    Its just anidea,
    At least I'm curious what do you think about it.
     
    Enivid likes this.
  11. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    It looks like an interesting idea. Now I have to figure out how to display that without adding to much clutter on the chart and also make sure that everyone will understand what those numbers mean.
     
    Michael618 likes this.
  12. Michael618

    Michael618 Trader

    11
    5
    14
    Well,
    In my mind i visualized textboxes drawn into the future.
    Not labels.
    But I'm not sure if this is also possible in MT4, I've meddled only with MT5.

    In a range of 10 to 20 pips,
    Like in my case, from 20 to 30,
    Its very possible that only few textboxes would be required.
    I will test, and see for sure.
    I presume 3 textboxes would do, with unique lots value changes.

    If the range is not given, then no textboxes.
    I would add a single string input parameter for this, "minSL, maxSL"

    Usually i tend to make these parameters as strings, like "20, 30"
    Then split the string and read values at the start of indicator.
    I do this to minimize number of input parameters.
     
    Enivid likes this.
  13. Michael618

    Michael618 Trader

    11
    5
    14
    actually, there are many changes from SL to SL, so I didn't imagine well this part.

    so the next best thing, for this potential feature, would be,
    instead of displaying for each SL,
    I see 2 possibilities:
    1. display only for 3 values: minSL, midSL, maxSL
    2. or add a 3rd input parameter, minSL, maxSL, increment, and let user decide how many textboxes

    either case, i cannot compute if this would be helpful or not for others
    it would be good if people would be able to vote for potential features, here on forum
    polls?


    ps.
    btw, if you want, i can give you MT5 functions for splitting a string with any separator given.
    I have separate functions for splitting into strings, into ints, into doubles
     
  14. Michael618

    Michael618 Trader

    11
    5
    14
    Meanwhile,
    I put together a script for this, in MT4
    (i took portions of code from 2 indicators)

    i think it works well, if someone is curious to see what i was after
     

    Attached Files:

    Enivid likes this.
  15. Danielmoaz

    Danielmoaz Newbie

    4
    1
    3
    Hi,

    I was hoping that somebody can help me with the script as when I want to trade with UK shares the positions are very big for my account.

    I've tried it before with another stock and the position the script gave me was 4 lots however my broker didn't allowed me to open the position due to my account and I did opened with 1.50 lots.

    As per below the script suggest a position of 10 lots for the trade however there is no way my account can handle 10 lots or as it's a UK share I should read it 1 lot? Am I doing anything wrong or the script is not accurate for shares? I doubt it but not 100% sure.

    [​IMG]

    Thank you!!
     
    Enivid likes this.
  16. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    It might be a problem in the indicator or it might be a problem with incorrectly filled specification for a trading instrument on your broker's server. Please let me know the broker and server you are using, so I could test it. Thanks!
     
  17. Danielmoaz

    Danielmoaz Newbie

    4
    1
    3
    Hi Enivid,

    Broker: Activtrades
    Server: Activtrades-Server

    Thank you!!!!
     
  18. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    @Danielmoaz, Thanks for reporting this! It was indeed a bug in the calculator, which appeared because of the tick value in CFDs' specifications in MetaTrader 5 work differently from the tick value in Forex instruments and in CFDs in MetaTrader 4. It is now fixed. Please download version 2.12. Let me know if it works for you.

    PS: Anyone using MT4 version of PSC does not need to update.
     
  19. Danielmoaz

    Danielmoaz Newbie

    4
    1
    3
    @Enivid I get the same result.

    Also, seems not to get when a position is long or short. This case would be a short one.

    [​IMG][​IMG]
    [​IMG]

    Other tab settings:
    Risk: Nothing to do here I believe for my case.
    Margin: Does not really matter if I leave it as "0" or "25". Result does not change.
    Swaps and Script: Nothing to do here.

    Thank you!!
    Daniel
     
  20. Enivid

    Enivid Administrator Staff Member

    8,165
    267
    114
    Unfortunately, I cannot check it with the UK shares at the moment because the market is closed, but it gives the correct results for the US shares. I will check it again on Tuesday when the UK market reopens.

    EDIT: I will check it on Monday as it looks like the UK stock market is open on December 25.
     

Share This Page