- Search Energy EXCH
- m.m.m. replied Feb 19, 2013
Unfortunately for people like you, MetaQuotes is doing all they can to prevent* such a possibility. Such can be done only by hacking their protocol, which they consider illegal, and they have already sued not long ago a company that has offered ...
Processing requests/responses directly with a broker without terminal
- m.m.m. replied Feb 12, 2013
Simply duplicate the line (a if-statement rather) for a check for saturday, too, i.e. (pseudocode): for (all days){if (saturday) skip; if (sunday) skip; /*or else count me in*/}
Help coding ADR indicator
- m.m.m. replied Feb 11, 2013
You have put the statement (line 88) outside the function (start)..
I need help adding a trailing stoploss function
- m.m.m. replied Feb 11, 2013
Yeah I forgotten: for some reason with scripts things may not get updated properly. I came across this finding in a project of mine. Best would be to run as EA.
Script to close orders once and only when new bar detected
- m.m.m. replied Feb 8, 2013
Your initialisation of old_bars is wrong, it has to be old_bars = Bars. If script then it has to loop infinitely (at least until finished job), and old_bars=Bars statement belongs inside the outer if-clause. For next time remember enclosing code in ...
Script to close orders once and only when new bar detected
- m.m.m. replied Feb 6, 2013
I have tested it on Alpari UK MT5 demo, it worked. What is Your broker?
Metatrader 5 auto insert stop loss!
- m.m.m. replied Feb 6, 2013
In editor make a new expert (from template), delete all generated code, copypaste this and compile. Ignore all "[invaid stops]" errors, and I think it will do. SL has to be in sub-pips (i.e. 15 pips is 150 sub-pips). input int SL = 150; //15 pip ...
Metatrader 5 auto insert stop loss!
- m.m.m. replied Feb 4, 2013
As long as you do not close orders you can also count the other way around, i.e.: for (ordPos = 0; ordPos < OrdersTotal(); ordPos++) { //do some tricks here// }
Addition equation subtracts... WHY?
- m.m.m. replied Feb 4, 2013
Well this means that your code "features" another bug somewhere.. Because it has to be OrdersTotal()-1. Every working code does it like that and also the fact that your program did not work correctly is proof of that very fact. Think of it: ...
Addition equation subtracts... WHY?
- m.m.m. replied Feb 4, 2013
No! Look... you forgot a semicolon at the end of the 3rd line in your code. And use code tags when exposing code! Like so: void checktime() { int LastAllowedDate = StrToTime("2013.02.15 23:59:00"); if (TimeCurrent() >= LastAllowedDate) { ...
A bit of help on time protection!
- m.m.m. replied Feb 4, 2013
Well you seem not quite well at reading, so, here again: 1. You forgot a semicolon in 3rd line... 2. You not need return anything.
A bit of help on time protection!
- m.m.m. replied Feb 4, 2013
If this is your exact code you obviously missed a semicolon in 3rd line.
A bit of help on time protection!
- m.m.m. replied Feb 4, 2013
I do not think that the problem is in the particular lines of code that you exposed. Instead I suspect that the problem is in line 84, where it reads: for (opo = OrdersTotal(); opo >=0; opo--) //--look for open orders You forgot to subtract 1 from ...
Addition equation subtracts... WHY?
- m.m.m. replied Feb 2, 2013
OK, EAs are tick-driven, and (if I understand) you'd need to know the point in time when a new candle is opened; then you'd check for condition and, if met, place a trade. So, you'd do: 1. Compare current candle open time with an initial candle open ...
Help with coding for a beginner
- m.m.m. replied Jan 15, 2013
This. In general API means just another way connecting to the same broker. So, it will depend on how your broker handles things. I do not know how for example high frequency trading technically works; likely HF traders use special providers or are ...
API Programming: One step closer to profitable trading
- m.m.m. replied Jan 15, 2013
What API? There are only few brokers offering an API of any kind (except FIX, usually for customers with a lot of money or professionals/institutionals). Such APIs are broker specific (i.e. Dukascopy) . Or do you mean programming in MQL (programming ...
API Programming: One step closer to profitable trading
- m.m.m. replied Jan 11, 2013
You're welcome. But.. I forgot something
I forgot to reset the condition on that it triggers the signals. So, right now it would signal once and than never ever again. So, here's the fix, I apologize. (and again put in the values as described ...Need a kind soul to add sound/email alert to indicator
- m.m.m. replied Jan 10, 2013
I think this should do.. However, you have to put in the (standard) values for high/low threshold, in line 66, 67, where it reads: extern double thresholdhigh; extern double thresholdlow;
Need a kind soul to add sound/email alert to indicator
- m.m.m. replied Dec 20, 2012
Yeah, except the "OrdersTotal()" versus "OrdersTotal()-1", as pointed out by nubcake, and as you say, if it works it works. A litte bit clumsy yes, possibly not perfectly robust, but if you are satisfied, so be it. And: work on that formatting tho.
A "real" coding challenge