Tâche terminée
Spécifications
Hi,
I am using GDMFX broker to trade binary options. They use a MT4 extension for trading binary options, so I can use the extension to trade BO manually. You can find the extension here: http://www.gdmfx.com/en/platforms/binary-options
What I want to do, is to automate the process of placing the binary options trades with this broker by sending the trading signals directly from my own BO MT4 indicator.
PART 1:
I need a simple connection that would function in the following manner:
1. My indicator sends the trading signal, defined as a simple MT4 alert function with following variables: Symbol(), Trade direction, trade amount, trade expiry.
For example:
if(GdmfxRobot && signalIndex == 1){
tradesignal(
Symbol(),
"DOWN",
TradeExpiry,
TradeAmount
);
}
if(GdmfxRobot && signalIndex == 2){
tradesignal(
Symbol(),
"UP",
TradeExpiry,
TradeAmount
);
}
What I need you to do, is to make a connection for these variables to be passed to the binary options extension and for the trade order to be placed. Below is an example for geturl function which I use for other purposes, but instead of geturl function I need a function that would place the trade trough the mentioned binary options extension. This is what I need you to code.
for example:
void tradesignal(string var1, string var2, string var3, string var4)
{
geturl("https://www.tradeorder.example/?asset="+var1+"&direction="+var2+"&expiry="+var3+"&amount="+var4);
}
So instead of geturl I need the code to actually place the trade. If other variables, such as username and password need to be included, they should be able to be passed as variables which I can define.
PART 2 (if possible)
In addition it would be great if I could define the trade amount variable as a fixed percentage of my total account balance. So for each trade, before the amount variable is defined, the system would check my current account balance and define the trade amount as a percentage of my total account balance. The correction of the amount should be made only in case of a winning trade (if account goes up), in case of a losing trade (if account goes down) the amount should always stay the last highest amount. The numbers should be rounded to 0 decimals.
For example (in case of 80% return on winning trades):
amount=10% of total account balance
TRADE 1: ACCOUNT BALANCE =$1000, amount=$100
- RESULT: WIN (+$80 PROFIT)
TRADE 2: ACCOUNT BALANCE = $1080, amount=$108
- RESULT: LOSS (-$108 LOSS)
TRADE 3: ACCOUNT BALANCE = $972, amount=$108 (the amount stays the last highest)
- RESULT: WIN (+$86.4 PROFIT)
TRADE 4: ACCOUNT BALANCE = $1058.4, amount=$108 (the amount stays the last highest)
- RESULT: WIN (+$86.4 PROFIT)
TRADE 5: ACCOUNT BALANCE = $1144.8, amount=$114 (rounded from 114.48, increased to 10% of total account balance)
...
If this type of function is difficult to code it would be enough just the have the PART 1 coded.
Please name your price and how long would it take ...
Thanks,
Bojan