Can someone adjust this lot size calculator indicator

To add comments, please log in or register
JincLorp
62
JincLorp  

Hi, im not sure if i have posted in the right place. This lot size calculator has 2 inputs, one for stop loss and one for risk which is fine and it shows you lot size based on that on screen. What im looking for is to be able to see multiple stoploss and lots size on screen.

William Roeder
19825
William Roeder  
  1. Why did you post your MT4 question in the Root / MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Per 2.1.3, uses TickValue by itself (assumes TickStep equals Point.) Also per 2.1.4 assumes LotStep is one of three possibilities.
    1. In code: Risk depends on your initial stop loss, lot size, and the value of the pair.
      1. You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
      2. Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
      3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency (EUR, in this case).
                  MODE_TICKVALUE is not reliable on non-fx instruments with many brokers.
      4. You must normalize lots properly and check against min and max.
      5. You must also check FreeMargin to avoid stop out
      Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5=0.1 Lots maximum.
    2. Use a GUI EA like mine (for MT4): Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 6

  3. Why do you need to see more than one? I think the GUI  (2.2) would be better choice.
  4. You haven't stated a problem. Show us your attempt (using SRC) and state the nature of your problem.
              No free help
              urgent help.
JincLorp
62
JincLorp  

Oh i have never posted on this site before, i just thought it was named MQL5 i didn't even know there is MQL4. Looks like i have made a right balls of this!

I'm not used to coding, i had a look at the code and could create 2 new inputs with  this:

extern double StopLoss1    = 20;

extern double StopLoss1    = 15;


This doesnt show anything extra on the chart, like what i was looking for is it to show this:

30SL 1% risk 1.00 (this is the standard line it shows)

15SL 1% risk  0.50

10SL 1% risk 0.33


Just wanted to see different lot size for different stop loss sizes with the same 1% risk.

I'll check out your indicator too

William Roeder
19825
William Roeder  
JincLorp:

Oh i have never posted on this site before, i just thought it was named MQL5 i didn't even know there is MQL4.

I'm not used to coding, i had a look at the code and could create 2 new inputs with ... This doesnt show anything extra on the chart

  1. Your attached files have extensions MT4 and EX4

  2. Adding inputs does nothing! You have to use them in new computations and add those result to the output (comment.)

  3. Welcome. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  4. extern double StopLoss1    = 20;
    extern double StopLoss   = 15;
    Obviously you can't have two variables with the same name.


JincLorp
62
JincLorp  
whroeder1:
  1. Your attached files have extensions MT4 and EX4

  2. Adding inputs does nothing! You have to use them in new computations and add those result to the output (comment.)

  3. Welcome. When you post code please use the SRC button! Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  4. Obviously you can't have two variables with the same name.


Yeah as you can see i dont know anything about code!!!
forextime8
374
forextime8  
JincLorp:
Yeah as you can see i dont know anything about code!!!

then start to learn mql from now,

or maybe freelance is ur only choice.

To add comments, please log in or register