Questions from Beginners MQL5 MT5 MetaTrader 5 - page 442
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Good evening, everyone,
1.
Strategy - bar appeared, set pending order with stoploss and takeprofit (sl, tp), nothing else.
Let's assume that in the current bar, after some time, a price will appear for the order to trigger, later the sl price will come, and then the tp price .
Please try to explain - let's assume that the opening price of the new bar will be somewhere between the sl and tp price limits. How is this calculation performed?
Logically, it cannot, because the tester has only the next bar open price? And it is not equal to the price specified in the condition for pending order triggering, which means the order should not be triggered.
But: during the tester's run, trades are somehow executed and stops are triggered. In what way?
2.
the tester creates fxt with every start. and this is time. I couldn't find any setting hinting at avoiding this... In idea: create it once and if I don't change anything, use this file, but no, the terminal rewrites it
Can you tell me, does the EA need a tick to execute init()?
No. You don't. Here's the code to help you see this:
Attach it to the chart and see what functions are working at the weekend.Can you tell me, does the EA need a tick to execute init()?
No. You don't. Here's the code to help you see it:
Attach it to the chart and see which functions are working at the weekend.I don't think so.
Thank you for your prompt reply. Then I don't understand why it's not working - there's no print...
And where does your printer stand? Can I have the code, for reproduction?
It turns out that initialisation does not happen when the terminal is loaded, but it does happen when the timeframe is changed.
I need to check if reading one file by a dozen EAs during initialization would not be a problem...
I am using a class.
A piece of class responsible for reading a file
It turns out that initialisation does not happen when the terminal is loaded, but it does happen when the timeframe is changed.
I need to check if reading one file by a dozen EAs during initialization would not be a problem...
I am using a class.
Piece of class responsible for file reading
So there are a lot of checks and conditions in your code before the print. Go to debug mode and check what is not working.
In the tester, everything works - but there are no printers when the terminal is loaded - that's what confused me.