Questions from Beginners MQL5 MT5 MetaTrader 5 - page 680
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
This is not the way to do it:
int TimeScale=50,TimeInMemory,TimeNow;
or rather, after such a declaration, you must explicitly initialise(assign values to) these variables in OnInit().
The Sell method must also be surrounded by checks, such as
" (",trade.ResultRetcodeDescription(),")");
And there may be one more catch - in the morning, at the opening of trading, the auction does not start immediately, not from the first second - at this point, errors may occur
I haven't run it on a real or demo account yet, only in tester mode. And there is an error with Invalid order type
I ran it in the tester - no such error. Describe how you tested: tick generation mode, deposit, leverage, period and provide tester log. Also please state which build you are using - I was testing with 1486.
build 1485
build 1485
Please show the specification of the SBER contract - is it a futures?, the name of the trading server you are logging into and the tester's log.
Trading server - Open-Broker
Trading server - Open-Broker
Is it already possible to trade a stock? Replace Buy with BuyLimit and Sell with SellLimit.
Aren't shares traded on the stock exchange?
If I replace Buy with BuyLimit, how will I buy shares at the market price?
Is it already possible to trade stocks? Replace Buy with BuyLimit and Sell with SellLimit.
This is not the way to do it:
int TimeScale=50,TimeInMemory,TimeNow;
or rather, after such a declaration, you must explicitly initialise(assign values to) these variables in OnInit().
The Sell method must also be surrounded by checks, such as
" (",trade.ResultRetcodeDescription(),")");
And there may be one catch - in the morning, at the opening of trading, trading does not start immediately, not from the first second - that's when errors are possible.
Vladimir, don't confuse the man!
From the documentation:
The scope of global variables is the entire program, global variables are available from all functions defined in the program. They are initialized with zero, unless another initial value is explicitly specified. A global variable can be initialized only with a constant or a constant expression corresponding to its type.
Global variables are initialized only once after a program is loaded into the client terminal memory and before the firstInit event isprocessed.For global variables that are objects of classes the corresponding constructors are called during initialization. In scripts, global variables are initialized before theStart event is handled.
Almost like a year on MT5 at Otkritie.