MODE_MINLOT and MODE_LOTSTEP

 

Hi,

Can you someone clarify me whether MODE_MINLOT is always same as MODE_LOTSTEP for any broker

I am using below to calculate average price for my open positions and it works fine.

But I have little doubt whether I should use MODE_LOTSTEP

TotalBuyOpenPrice = TotalBuyOpenPrice+(OrderOpenPrice()*(OrderLots()/MarketInfo(Symbol(),MODE_MINLOT)));

thanks in advance

 
jpbiznes:

Hi,

Can you someone clarify me whether MODE_MINLOT is always same as MODE_LOTSTEP for any broker

No, MODE_MINLOT may be the same as MODE_LOTSTEP across many Brokers for Forex . . . but there are many instruments that this does not hold true for.

The Open price for an order is OrderOpenPrice() after you have first selected it . . . . loop through, add them up, divide by the number of Orders you just added up. Why do you need to even consider MINILOT or LOTSTEP ?

Maybe you are talking about the Order Profit ? if you are, just use OrderProfit() after selecting an order.

 
jpbiznes:

Hi,

Can you someone clarify me whether MODE_MINLOT is always same as MODE_LOTSTEP for any broker

I am using below to calculate average price for my open positions and it works fine.

But I have little doubt whether I should use MODE_LOTSTEP

thanks in advance


It is not always the same depends on broker

read here https://www.mql5.com/en/forum/137780

With this broker FinFX it is different

 
RaptorUK:

No, MODE_MINLOT may be the same as MODE_LOTSTEP across many Brokers for Forex . . . but there are many instruments that this does not hold true for.

The Open price for an order is OrderOpenPrice() after you have first selected it . . . . loop through, add them up, divide by the number of Orders you just added up. Why do you need to even consider MINILOT or LOTSTEP ?

Maybe you are talking about the Order Profit ? if you are, just use OrderProfit() after selecting an order.



Hi RaptorUK,

for example

order 1 - $5 - 1lot

order 2 - $6 - 3lot

if i calculate as you said i get ($5+$6)/2 $5.5, it is wrong

assume your MINLOT or LOTSTEP is 1lot, then ---- > this is where i have doubt

($5+($6*3))/(1lot+3lot) = $5.75

Do you agree? happy to correct myself if i am wrong

 
jpbiznes:


Do you agree? happy to correct myself if i am wrong

If you want to know current profit if you closed the order now then OrderProfit() will give you . . . . " For open positions, it is the current unrealized profit. " If you want to know potential profit if the trade went to TP then that is a dfferent issue . . .

Perhaps you should explain what you are trying to achieve ? I'm not sure I understand . . .

 
RaptorUK:

If you want to know current profit if you closed the order now then OrderProfit() will give you . . . . " For open positions, it is the current unrealized profit. " If you want to know potential profit if the trade went to TP then that is a dfferent issue . . .

Perhaps you should explain what you are trying to achieve ? I'm not sure I understand . . .


hmm ok

leave my "TotalBuyOpenPrice" calculation code

can you suggest me a best method to calcuate my example i explained above

i need to calcuate average price where multiple orders have different lot sizes,if they are of same lot that is easy, but for different lot size in orders i am confused

 
jpbiznes:
i need to calcuate average price where multiple orders have different lot sizes,if they are of same lot that is easy, but for different lot size in orders i am confused
Use a Weighted arithmetic mean AvePrice = Sum( price * lots ) / Sum( lots )
 
jpbiznes:

i need to calculate average price where multiple orders have different lot sizes,if they are of same lot that is easy, but for different lot size in orders i am confused

Oh I see . . . you have multiple orders open for the same currency pair and you want to work out the effective open price as if it were one order . . .
 
RaptorUK:
Oh I see . . . you have multiple orders open for the same currency pair and you want to work out the effective open price as if it were one order . . .

yes :)

i believe that is what the avg price am asking for

 

Hi, may I ask is there anyway to modify / change a broker's Maximum lot allowed?

Change from MT4 desktop? Or how?

Currently it is set up to USD500.

Thanks.

 
Chua Chee Seng: Hi, may I ask is there anyway to modify / change a broker's Maximum lot allowed? Change from MT4 desktop? Or how? Currently it is set up to USD500.

No! That is all dependant on the Broker and the Types of Account which they provide.

So either choose a different type of Account that they offer (eg. Cent, Fixed, Standard, Pro , ECN, or whatever they name them), or you select a different Broker that offers the trading conditions best suited for you.

Reason: