Questions from Beginners MQL5 MT5 MetaTrader 5 - page 214

 
Hi, can you tell me why the global variables created during testing are not visible in the terminal? I mean the ones created as GlobalVariableSet()
 
dmitry01110:
Hi, can you tell me why the global variables created during testing are not visible in the terminal? I mean the ones created as GlobalVariableSet()
The tester has its own separate directories where it stores all the data it needs for testing and optimization.
 
Reshetov:
The tester has its own separate directories in which it stores all the data it needs for testing and optimising.
So the data can only be exchanged using the file system?
 
Hi. Here's a question. When using ChartApplyTemplate function, I get error 5019 - can't find file. There is a file in the folder and it is manually loaded to the window. It shows an error in visualization mode when testing, but if I apply the Expert Advisor to a chart on a demo account, everything is OK.
 
cyn:
Hi. Here's a question. When using ChartApplyTemplate function, I get error 5019 - can't find file. There is a file in the folder and it is manually loaded to the window. I get the error during testing in visualization mode, but if I apply the EA to a chart on a demo account, everything is OK.
The visualization mode is a tester mode. The tester has its own directories.
 
Reshetov:
The visualization mode is the tester mode. The tester has its own directories.

and if it's not a secret which ones? And most importantly, how to use ChartApplyTemplate function in test mode? And why does the TerminalInfoString(TERMINAL_PATH) function show the directory from which the terminal is running?

 
Reshetov:
Режим визуализации - это тестерный режим. У тестера свои директории.
cyn
:

and if it's not a secret which ones? And most importantly, how to use ChartApplyTemplate function in test mode? And why does the TerminalInfoString(TERMINAL_PATH) function show exactly the directory from which the terminal is running?

In general, the question is how to display the standard moving curves (built into MT5) in the Strategy Tester using different drawing styles. For example a fast one is red, and a slow one is blue?

 

Please help to remake the order opening function for mql5.

OrderSend("NZDUSD",OP_BUY,Lot,MarketInfo("NZDUSD",MODE_ASK),slip,0,MarketInfo("NZDUSD",MODE_ASK)+tp*Point,"NZDUSD",magic[3],0,Red);
 
Example2:

Please help to remake the order opening function for mql5.

Read the article Trading in MQL5 - it's easy.
 

Please advise. The EA executes a trade from the market by sending OrderSend(), StopLoss and TakeProfit are set immediately. How can I further determine which one triggered when a Stop or a TakeProfit is triggered? I.e. how do I find the trade (there may be many of them, as other EAs may trade on the same symbol) among allhistorical trades (StopLoss or TakeProfit) which triggered as a result of triggering of a closing order? These trades have zero magic value and there is no way to identify it... We may know the ticket of the order which resulted in the trade, but we do not know the stoploss and takeprofit values beforehand. Or is there some way to identify them? Well, I need to trace the state of a trade opened using the order with the so-and-so's ticket - whether the stop or profit set simultaneously with its opening was executed, and if so, what exactly was executed and what was the financial result. How do I do this? Is this even possible in MT5?

Reason: