工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
Auto Lot
Size calculator
I need an interface
that automatic calculates the (previous candle size + X pips) then calculate the
lot size based on 2 options:
Fixed Losses
Fixed Account %
The interface
should have these options:
Previous Candle:
Pending order additional pips:
Additional pips for SL:
TP ratio:
SL by $:
SL by Account %:
TP by $:
TP by Account %:
Lot Size:
Buttons:
Pending Buy Order
Pending Sell Order
Buy
Sell
I will explain each box and what it should do:
Previous Candle:
Insert
number: for example 1,2, 3, 10
We are checking on the previous closed candle.
If 3 is input, we are checking the 3rd candle before the current candle.
Pending order additional pips:
The box
allows us to insert a number. For example: 1,2,3
this will add the additional pip on the pending order price for buy order, and
minus the pip on pending order price for sell order.
For example: Closed Candle on EU is 1.2300, and this box is 1. It will make the
pending order at 1.2301
Additional pips for SL:
The box allows us to insert a number. For example 1, 2, 3,
This will add the additional pips to the SL preset when creating pending order.
It will add X pips depending on the number input into the box.
For example: A buy order’s SL is at 0.9005, and the number is 3, the SL will be
placed at 0.9002 instead.
TP Ratio:
TP Ratio can be inserted by number. For example:
0.8, 1.2, 2 etc etc
SL by $:
This box will allow us to set the SL by value.
For example: if we input 10, we are risking $10 of the account currency.
By editing the value of this box, the box “SL by Account %” will recalculate
and reflect the % based on account balance.
It will update the “Lot Size” box when the value of this box is updated.
SL by Account %:
This box will allow us to set the SL by account’s Balance.
For example: if we input 0.5, it will risk 0.5% of the account balance.
By editing the value of this box, the box “SL by $” will recalculate and
reflect the account value of SL.
It will update the “Lot Size” box when the value of this box is updated.
TP by $
This box will allow us to set the TP by value.
For example: if we input 20, we are risking $20 of the account currency.
By editing the value of this box, the box “TP by account %” will recalculate
and reflect the % based on account balance.
It will update the “Lot Size” box when the value of this box is updated.
TP by Account %:
This box will allow us to set the TP by % of account Balance.
For example: if we input 1.5, it will risk 1.5% of the account balance.
By editing the value of this box, the box “TP by $” will recalculate and
reflect the value of the TP in currency amount.
It will update the “Lot Size” box when the value of this box is updated.
Lot Size:
The box allow
us to input the lot size
0.01 = 1 micro lot
0.1 = 1 mini lot
etc etc
By adjusting this value of this box, it will recalculate the 4 boxes’ value:
“SL by $”
“SL by account %”
“TP by $”
“TP by Account %”
Buttons:
Pending Buy Order:
Clicking this button will trigger a pending buy stop order
If value of “Pending order Extra pips” is positive
The pending buy is Value of “Previous candle” ‘s high + “Pending Order Extra
pips”
SL : the value of “Previous Candle” ‘s size + “Additional pips for SL”
TP’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
Clicking
this button will trigger a pending buy limit order
If value of “Pending order Extra pips” is negative
The pending buy is Value of “Previous candle” ‘s high + “Pending Order Extra
pips”
SL : the value of “Previous Candle” ‘s size + “Additional pips for SL”
TP’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
Pending
Sell Order:
Clicking
this button will trigger a pending Sell stop order
If value of “Pending order Extra pips” is positive
The pending buy is Value of “Previous candle” ‘s low + “Pending Order Extra
pips”
SL : the value of “Previous Candle” ‘s size + “Additional pips for SL”
TP’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
Clicking
this button will trigger a pending Sell limit order
If value of “Pending order Extra pips” is negative
The pending buy is Value of “Previous candle” ‘s low + “Pending Order Extra
pips”
SL : the value of “Previous Candle” ‘s size + “Additional pips for SL”
TP’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
Buy
Clicking this button will trigger a market buy order with the value of
SL : the value
of “Previous Candle” ‘s size + “Additional pips for SL”
TP’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
Sell
Clicking this button will trigger a market Sell order with the value of
SL : the value of “Previous Candle” ‘s size + “Additional pips for SL”
P’s pips: SL multiple by TP ratio
Lot Size: The value in “Lot Size”
-------------------------------------------------------------------------------------------------------------------------------------
please let me know if you have any questions.