Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 355

 
Sepulca:
Frankly, it's a bit creepy, even though bitcoin has been going up like ....

Well, that's a matter for the owner.
 
Positions are closed immediately on crossing. I need them to close only at the end of the candle. Sometimes in the moment the muwings are crossed, but not at the end of the candle. How to improve the code, Sepulca? Please advise, if you don't mind.
 
okidoki543:

The original EA seems to be working fine. It opened my bai on the minute. Now I have switched it off, leaving only my own, spiked. It should close these bai when the muving crosses back. We'll see.

artmedia70, thanks.

Very interested in the answers to the questions:

I cannot test the source code (which both opens and closes positions) on the MT4 tester. When I press "Start" I get a beeping sound (like a bird) and that is all, nothing is tested. What should I do?

I noticed that the EA attached to the chart when I logged into my demo account remains active even when I log into my real account. It turns out that it will work on a real account? If so, we need different programs (2 copies of the program) for Demo and for Real, right?

There are settings in the terminal. I want to disable Expert Advisors when modifying an account. I do not have my terminal running now and I am too lazy to run it. Look in the settings - there are not many of them, do not get lost.

About the bastard beeping in the tester - maybe it's hungry? Who knows what's inside it. I haven't seen it, and I'm too lazy to figure it out - I've got my own codes.

 
okidoki543:
I see, so it's a difference of opinion. I'll check that for a minute as well.

Whose opinions are divided? I hadn't noticed.
 
artmedia70, yes, found those settings, thanks.
 
okidoki543:
Positions are closed immediately on crossing. I need them to close only at the end of the candle. Sometimes in the moment the muwings are crossed, but not at the end of the candle. How to improve the code, Sepulca? Please advise, if you don't mind.
Take the MAs from the first bar and the price of the first candle, and not from the current bar.
 
okidoki543:
Positions are closed immediately on crossing. I need them to close only at the end of the candle. Sometimes in the moment the muwings are crossed, but not at the end of the candle. How to improve the code, Sepulca? Please, tell me, if you don't mind.

Try MA1_Price=PRICE_OPEN; and MA2_Price=PRICE_OPEN; or, in the EA settings, set these parameters = 1. The same thing. This is a quick solution. We do not use the current bar. The reason is that Close of the previous bar is almost equal to Open of the next bar, maybe the size of the tick differs...
 
artmedia70:
Take MAH data from the first bar and the price of the first candle, not from the current bar.

I do not know how to write it in the code.
 
Sepulca:

Try MA1_Price=PRICE_OPEN; and MA2_Price=PRICE_OPEN; or set these parameters = 1 in the EA settings. The same thing, in principle. This is a quick solution. We do not use the current bar. The reason is that Close of the previous bar is almost equal to Open of the next bar, maybe the tick size is different...
Thank you, but I would like to see the exact solution. So that the current bar is not considered, and only previous bars are considered.
 
Tried changing MA1_Shift=1 parameters of both muwings. It seems to help. I'll test it on the minute.
Reason: