Questions from Beginners MQL4 MT4 MetaTrader 4 - page 225

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
Hello, dear programmers, I'm new to mgl4, can you please help me? I need a trading robot that opens in the morning ( 9:00 )after getting a profit waited for the next day. Can you tell me in simple words what to add where?
Well, in simple words, it goes like this:
We create a variable of datetime type and record the time of the current D1 candle in it when we close the order with a profit. And before opening another order, we check the value of this variable with the time of the current D1 candle. Accordingly, if the current time is higher, we can open. Otherwise, we smoke smoke smoke.
Here's a working code:
Note that the arrow is drawn with the back number BufferDn[i+1]=. That's unfortunate.Oh, thank you, thank you, thank you, thank you! :)) Good programmers are wizards for mere mortals, after all! :))
So, is there a sense in such an indicator? I do not quite understand how much the arrow will be drawn retroactively? That is, for example, the candle ended, the arrow is drawn, and at the same moment we have entered the trade on a new candle (that is, at the beginning of the next candle)? If so, it seems to be good. But if it is different, how?
Good afternoon. In Prof() the numbers are set. In ProfS() these numbers should add up. Can you tell me what's wrong and how to fix it?
Thank you very much Alexei!
i is just closed candle, the arrow is drawn on i+1. There will always be a lag, you should try to optimise and see what happens.
i is just closed candle, the arrow is drawn on i+1. There will always be a lag, you need to try and optimise, see what happens.
I am trying)
Good afternoon. Can you tell me how to find an open position the furthest away in pips fromthe current priceand close it. Regardless of which currency pair and which way it is going. Thank you.
You have been answered in your topichttps://www.mql5.com/ru/forum/334987
moderator using SBhttps://www.mql5.com/ru/docs/standardlibrary/tradeclasses
I wrote an example based on the help
if the question is how to close a position, again the help ishttps://www.mql5.com/ru/docs/constants/tradingconstants/enum_trade_request_actions