Good afternoon, there is a reference: it should return “The price at which the last transaction was made”
In fact, these are the lines:
string neededSymbol = “EURUSD”;
Print(SymbolInfoDouble(neededSymbol, SYMBOL_LAST));
Return 0
I tried to substitute Symbol() on different charts instead of explicitly specifying the tool, it turned out the same thing-returns 0
Then I tried the code from this example: last_tick; if(SymbolInfoTick(Symbol(),last_tick)) { Print(last_tick.time,”: Bid = “,last_tick.bid, ” last = “,last_tick.last,” Volume = “,last_tick.volume); } else Print(“SymbolInfoTick() failed, error = “,GetLastError());
The bid is returned, and the remaining fields are zeros.
Accidentally Googled this constant: PRICE_CLOSE
Not very understanding “how and where” it comes from, I tried to do so:
SymbolSelect(neededSymbol, true);Print(PRICE_CLOSE);
Got 1 with any tool…
Right here: that if this is the first call of the indicator, then it should be added: “If the first call form is used in the indicator, then at the custom indicator start you can additionally indicate data for calculation in its “Parameters” tab. If the “Apply to” parameter is not selected explicitly, the default calculation is based on the values of “Close” prices.”
– Please tell me: where/at what point of the russified MT5 you can find this window with indicators, or how “correctly” you can get the last price for a given instrument?!
noob_aka_nk
Hurry up and make people laugh, here is a “working code” that returns what I want: just: how to work with the help if there were 3-4-5 options for solving my “problem” in it, and none of them worked… ??!
PS. I continue to follow the topic, if someone explains to me what I did wrong in the first post – I will be grateful, because in theory it should not be so: if there is documentation , you need to do it according to it. If something from the documentation does not work, then I am doing something fundamentally “wrong”… it didn’t work for me at all, which is scary! ))