Guys, imho, you're both wrong. In MQL, the Static memory management mode works in a very peculiar way. Initialization of variables occurs ONLY once during the whole period of program's work - just before the first call of init().
Hence, it inevitably follows that your programs are always wrong at the moment when EA parameters change, for example.
That's why I now use function of new bar definition from this article
CJIeCaPb: Hey guys, how do I know the minimum distance for placing a pending order?
int lv=(int)SymbolInfoInteger(Symbol(),SYMBOL_TRADE_STOPS_LEVEL);
int sp=(int)SymbolInfoInteger(Symbol(),SYMBOL_SPREAD);
int stopLevel=(lv==0)?sp*2:lv;
Well, or a function:
//+------------------------------------------------------------------+int StopLevel(string sy) {
int lv=(int)SymbolInfoInteger(sy,SYMBOL_TRADE_STOPS_LEVEL);
int sp=(int)SymbolInfoInteger(sy,SYMBOL_SPREAD);
return((lv==0)?sp*2:lv);
}
//+------------------------------------------------------------------+
borilunad: You have to put the commas, it's hard to understand what you're trying to say!
+100500. I don't even want to respond to such opuses. I have a feeling that I will have to explain for a long, long time on my fingers to a completely illiterate third-grader.
Since "the man can't speak intelligently, I want to send him back to school instead of telling him what he should do properly" ...
+100500. I don't even want to respond to such opuses. I have a feeling that I will have to explain for a long, long time on my fingers to a completely illiterate third-grader.
Since "the man can't speak intelligently, I want to send him back to school instead of telling him what to do correctly"...
ZS. Technical, specialized resource, man...
Comrades, tell me, when my order is closed, it must reopen in the same place. What operation and how?
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.
Guys, imho, you're both wrong. In MQL, the Static memory management mode works in a very peculiar way. Initialization of variables occurs ONLY once during the whole period of program's work - just before the first call of init().
Hence, it inevitably follows that your programs are always wrong at the moment when EA parameters change, for example.
Hey guys, how do I know the minimum distance for placing a pending order?
Well, or a function:
Well and call it on every tick, for example:
int stopLevel=StopLevel(symbol);string symbol - a variable storing the name of the required symbol, or the current: Symbol()
Please, advise me when my order has been closed it has reopened in the same place.
i.e. it was pending at closing became pending at the same level where it was.
Please, advise me when my order has been closed it has reopened in the same place.
i.e. it was pending at closing became pending at the same level where it was.
You have to put the commas, it's hard to understand what you're trying to say!
+100500. I don't even want to respond to such opuses. I have a feeling that I will have to explain for a long, long time on my fingers to a completely illiterate third-grader.
Since "the man can't speak intelligently, I want to send him back to school instead of telling him what he should do properly" ...
SZZ. Technical, specialized resource, dammit...
Well, or a function:
Well and call it on every tick, for example:
string symbol - a variable storing the name of the desired symbol, or the current one: Symbol()
Spell out the commas, it's not clear what you want!
comrades, tell me, I want when my order closed, it should open again in the same place. through which operation and how???
the point is now clear???
+100500. I don't even want to respond to such opuses. I have a feeling that I will have to explain for a long, long time on my fingers to a completely illiterate third-grader.
Since "the man can't speak intelligently, I want to send him back to school instead of telling him what to do correctly"...
ZS. Technical, specialized resource, man...
Comrades, tell me, when my order is closed, it must reopen in the same place. What operation and how?
the point is now clear???