[Archive] Programming in mql4 (free) - page 8

 
yurec1984:

Hi. To the point: after a specified time after the opening of a candle, the Expert Advisor checks its direction and therefore opens a position (buy up, sell down)

time is optimized (about 10 minutes, the timeframe is thought to be 1H)

tp and sl is also subject to optimization

then at the time that is set before the end of the candle (optimum), if the order is not closed by the Stop Loss or TP, we check the profit

if the profit>=0, we close it.

i.e. we check this condition before the order opening time, i.e. the set order opening time and close the position at the last moment with any profit so we will not lose the opportunity to open it on the next bar.

Questions:

- how should I make only one order open?

I guess I should check and compare the value of variable KOL with the number of open orders? How should I specify it?

does it have to be checked at the very beginning of start?

- i have just got it (when i was writing), for an open position you should set a narrow time interval, otherwise, when the order closes on a position and the candle hasn't closed yet, the condition for opening will become true again and a new position will be opened; if the closing condition is also fulfilled, it will be great: open - close (if the profit>=0)

If someone says something nonsense, please, it's the first time I've started to write something, I've just opened the manual yesterday, and I want to check my personal observation that the tails of the candles (half an hour, hour, 4) are drawn at a time close to the opening and closing of the candle and try to catch the price movement within the body.

Thank you.



Are we spamming? Especially since the answer has already been given
 

Vitya, why don't we shut it down as ideologically harmful?

After all, they've already shut down about 10 of them, and they dug up another one, damn it...

The author of this thread has long forgotten about it, and the one who raised it from the grave is already banned.

 
Mathemat:

Vitya, why don't we shut it down as ideologically harmful?

After all, they've already shut down about 10 of them, and they dug up another one, damn it...

The author of the thread has long forgotten about it, and the one who raised it from the grave is already banned.


Agreed
 

This thread is now closed. If you want to get a free code, please contact the author of this thread in person.

All messages after this will be deleted without warning.

 
/* branch closed/
Files: