Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 794

 
tara:

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
 
Just remove the Static attribute and leave it as it is. It will be a global variable...
 
Hi all! Guys, how do I know the minimum distance to set a pending order?
 
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);
   }
//+------------------------------------------------------------------+

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.

 
logut:

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 add commas because it is unclear what you want!
 
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" ...

SZZ. Technical, specialized resource, dammit...

 
artmedia70:

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()

Thank you)
 
borilunad:
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???

 
artmedia70:

+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???

Reason: