Oh yes i realized that the market is closed now...and I found the stupid mistake...
I don't know how, but I changed the open price "bid" and "ask" and that was the reason why it worked with a high slippage...! But I plan to include some parts of Ais' or WHRoaders' code in mine, thank you for that...
Now I tried to improve my ordersending-code with a take profit. So the aim is, that if it reachs the tp, it closes, otherwise, it should close when the ordersend signal in the opposite direction is given...
I use the contrary code to close a sell-order, if one exists and and to open a buy-order.
I believe I made a logical mistake, because it sometimes closes with the tp, but even if I make the tp as small as possible, it only closes about half of the orders with it, but not in a static sequence. Is there anybody who can see a mistake in there?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Oh yes i realized that the market is closed now...and I found the stupid mistake...
I don't know how, but I changed the open price "bid" and "ask" and that was the reason why it worked with a high slippage...! But I plan to include some parts of Ais' or WHRoaders' code in mine, thank you for that...
Now I tried to improve my ordersending-code with a take profit. So the aim is, that if it reachs the tp, it closes, otherwise, it should close when the ordersend signal in the opposite direction is given...
My code:
I use the contrary code to close a sell-order, if one exists and and to open a buy-order.
I believe I made a logical mistake, because it sometimes closes with the tp, but even if I make the tp as small as possible, it only closes about half of the orders with it, but not in a static sequence. Is there anybody who can see a mistake in there?
Thanks for your help.
Manag