You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
not if you test with current spread this is very crazy moving so spread can become very huge
so how did you do the test ??
fixed spread or current spread ??
ok, so this is the time I go google "spread"
I appreciate that you are answering my stupid questions))
I will be back in a while
ok, so this is the time I go google "spread"
I appreciate that you are answering my stupid questions))
I will be back in a while
and each tick this value can change
reason why i asked method how you did do the test
and each tick this value can change
reason why i asked method how you did do the test
exactly!
I the difference was due to the current spread testing, when I performed the tests with fixed spread they were exactly the same!
Thank you guys so much!
I have really improved my knowledge.
And please let me know if there is something left to be improved in the code.
exactly!
I the difference was due to the current spread testing, when I performed the tests with fixed spread they were exactly the same!
Thank you guys so much!
I have really improved my knowledge.
And please let me know if there is something left to be improved in the code.
if you show what your code has become now
like to see also a new errorhandling, see comment RaptorUK https://www.mql5.com/en/forum/148529
if you show what your code has become now
like to see also a new errorhandling, see comment RaptorUK https://www.mql5.com/en/forum/148529
Ok, here we go:
price normalization:
GetLot function, I guess it hasn't changed
New Order function, now uses normalised prices:
Close 1 or all orders
I have not changed the order close function to check for symbol and magic numbers, because I am going to trade at one symbol only and with only one EA per account. But I will do it after I deal with other more important issues and tuning.
I have changed the EMA cross detection from comparising EmaDiff[2] to EmaDiff[1] to comparising EmaDiff[0] to zero and using an additional flag (all this coming from some example I found)
On a minute scale Demo account it makes false triggers when the spread is so high that a buy deal make EMAs intersect and then a sell deal coming after that within the same minute bar make them seperate again.
[url=http://postimg.org/image/udq4ufmqf/][img]http://s15.postimg.org/udq4ufmqf/mess.jpg[/img][/url]
I am thinking of how to deal with this right now
the trailing stop function:
and the body itself:
Thanks for your interest!
I have not changed the order close function to check for symbol and magic numbers, because I am going to trade at one symbol only and with only one EA per account. But I will do it after I deal with other more important issues and tuning.
don't be lazy, do it directly !!!!
it's an important thing you always have to include
if you want to fix your program and we give advise what is needed to do
then if you don't wanna work to fix it then what are we doing helping you ??
don't be lazy, do it directly !!!!
it's an important thing you always have to include
if you want to fix your program and we give advise what is needed to do
then if you don't wanna work to fix it then what are we doing helping you ??
ok, ok, just take it easy)
here it is, I think that should do the trick.
open order function:
close all order function:
I have a bigger problem now, my broker tends to partially execute orders.
Dear Customer,
Please be hereby advised that your trade has been opened partially (2.32 lots out of 15.84) at the price 587.318.
Should you have any additional questions on this issue, don’t hesitate to contact us.
Kind Regards,
Broker.
here is what support say:
Please be advised, during periods of high volatility or low liquidity, Limit Orders may be partially executed. This means that the position will get filled immediately fully or partially if the price is met. In you case your order was executed partially, that is why you have received notification letter.
I understand how to close all orders despite them being closed partially, I just have to do Close all Orders while OrdersTotal() > 0, but I don't know what to yet when orders open partially.
edit:
Just realized that I have to check proper Symbol and magicnumber orders, it is a bit more difficult
edit: here is the close all orders function that should close orders even with partial closure
Here is how I am going to struggle with partial execution of open orders,
Opening order will no longer be performed with a NewOrder function, but it will be done with this one: