We need to write an uncomplicated expert - page 3

 
Mathemat:
Qrob wrote (a): And so - what kind of questions and attitude to me, such are the answers and attitude to you from my side.

It's just the opposite: what your demands are, are the answers. If you have not yet understood that the real creativity in creating an MTS is the right idea, which can be coded without any creativity on the part of the coder, you have yet to realize it.

Please read everything I wrote BEFORE. Quote: "If it can't be done (by the unformed bar), then write so, instead of asking me dumb questions, trying to make me look like an idiot and yourself a "cool and clever dude" - after all, who is the programmer: you or me ?"

And the requirements are perfectly acceptable and well within 4 points. I just didn't expect to have to explain everything. I especially did not expect that I would try to make a fool of me, when I never had anything to do with programming, with questions like: "how do you imagine it?" - that's the quote above.

 
Qrob:

So I explain how to get out of this situation, for those who do not understand: you need to program it so that the trade is conducted on the unformed bar after 4 minutes of its opening, according to the algorithm, which is on page 1 of the topic.

I'm the one who didn't get it!

It turns out that a 4 minute wait is added to the original entry conditions (one third of a bar)? - For a five minute bar?

I once made such an Expert Advisor: entry also occurs at a given time after the opening of the bar, depending on whether the current price is above or below the open price. At first glance it seemed to be a good solution. However, the Expert Advisor has lost profit. Entries were random anyway. It is like flipping a coin.

Of course, optimization will give profits. But it is only when optimizing...

 
rid:
Qrob:

So I explain how to get out of this situation, for those who do not understand: you need to program it so that the trade is conducted on the unformed bar after 4 minutes of its opening, according to the algorithm, which is on page 1 of the topic.

I am the one who didn't get it!

It turns out that a 4 minute wait is added to the original entry conditions (one third of a bar)? - For a five minute bar?

Exactly right! This is the kind of question that shows respect and understanding. I will be glad to do business with you.

 
rid:
Qrob:

So I explain how to get out of this situation, for those who do not understand: you need to program it so that the trade is conducted on the unformed bar after 4 minutes of its opening, according to the algorithm, which is on page 1 of the topic.

I made such an Expert Advisor: enter also after a certain time after the opening of the bar, depending on whether the current price is higher or lower than the open one. At first glance it seemed to be a good solution. However, the Expert Advisor has shown losses. Entries were random anyway. It is like flipping a coin.

Of course, optimization will give profits. But it is only when optimizing ...

Take into consideration Volume and MFI, so you shouldn't make a random entry.

 

Unfortunately, I can't attend to your idea at the moment. But I have found one of my first designs.

The current price moves up or down by specified number of points from the opening price of the current bar toenter the market. This is parameter " n " in PROPERTIES.

Long and short positions can be disabled. A trailing stop with start threshold is provided. If desired and interesting, somebody among those present here may easily add conditions on your indices to the code.

And provide for "4 minutes" rule instead of "n" parameter.

Exactr is able to work under Market Watch constraints (don't kick me hard for implementing such a solution !)

 
rid:

Unfortunately, I can't attend to your idea at the moment. But I have found one of my first designs.

The current price moves up or down by specified number of points from the opening price of the current bar to enter the market. This is parameter " n " in PROPERTIES.

Long and short positions can be disabled. A trailing stop with start threshold is provided. If desired and interesting, somebody among those present here may easily add conditions on your indices to the code.

And provide for "4 minutes" rule instead of "n" parameter.

Exactr is able to work under Market Watch constraints (no strong kicking for implementation of such a solution !)

For some reason I don't see any EAs in the attached fills...

 

Excuse me. Who had time to download in the previous message. - delete it. There was an error.

Here is the correct version, in the download.

I must warn you that the initial stops work only when Expert Advisor is online. If the connection to the internet is disconnected, large drawdowns are possible.

Files:
 
rid:

Excuse me. Who had time to download in the previous message. - delete it. There was an error.

Here is the correct version, in the download.

I must warn you that the initial stops work only when Expert Advisor is online. If the connection to the Internet is disconnected, large drawdowns are possible.

Thank you!

After a lot of clarity we can say the start has been made, the only thing left to do is to tweak...

 

So all that has already been figured out again (TK):

Part I (When a bar is formed)
1) We divide the bar into 3 equal parts - 3 sectors.
2) If the opening and closing prices are positioned in 1 sector or in 3 sectors, and if the market was directed upwards (downwards), we place a sell (buy) order.

Determine where the market was headed by comparing the last 2-3 bars to the closing prices. It is like an elementary function: if the price was constantly increasing (last 2-3 bars), then the market was going up; if the price was constantly decreasing (last 2-3 bars), then the market was falling. We can set a double inequality: X1(t)<X2(t)<X3(t) - the market was growing and X1(t)>X2(t)>X3(t) - the market was falling where Xn(t)- closing price that depends on the time.

II part (Bar in the formation stage - a 4-minute wait for the 5-minute bar, ie the algorithm begins to work after 4 minutes from the opening bar)
1) If the volume of the bar is higher than the previous one, and the octo-opening price is in sector 1, and the closing price is in sector 3, we put a sell order.
If MFI(Money Flow Index) is down, volume is up (pink), we ignore the signal.
2) If the Volume of the given bar is higher than the previous one and the octo-date is in sector 3 and the close price is in sector 1, we put a buy order.
But if MFI is down, volume is up (pink), we ignore the signal.

If at least one order is opened, the others are not opened.

Profit 10 points, Loss 10 points. (But these data should be entered by the trader, as well as the lot size)

 
Qrob:
YuraZ:

question 1

Please tell me how I can tell if the market is going UP or DOWN because everything is clear in this point except your clarification.

1) This is already your task

Why would I want to do that? You determine it somehow... I understand you are trading on your strategy

so you have an algorithm... and if you have an algorithm i will program it....

---

oops now i see

Qrob wrote (a):

Determine where the market was headed by comparing the last 2-3 bars to the closing prices. It's like an elementary function: if the price was constantly rising as time increased (last 2-3 bars), then the market was going up; if the price was constantly falling as time increased (last 2-3 bars), then the market was falling. We can set a double inequality: X1(t)<X2(t)<X3(t) - market went up, X1(t)>X2(t)>X3(t) - market went down, where Xn(t)- closing price, and it depends on time.

---

Qrob wrote (a):

3) These are the same concepts, believe me. And the MFI shows what I need

I can't take your word for it, if there is a clear written description, here's what the developers write in the documentation

double Volume[]
Массив-таймсерия, содержащий тиковые объемы каждого бара текущего графика.

the thing is that the Volume on FOREX, it's not the number of trades or lots or whatever, as you imply...,

or rather as implied by the MFI indicator the whole point of which is real volumes

in MT4 Volume is the number of price movements in one direction or another

That is, roughly speaking, as soon as the price changes, Volume adds +1 and it does not matter whether the jump of 100p 50p 30p 10p or 1p Volume is simply +1

and it does not matter where it went up or down

Do you know how much money we need to put into the market for the price to move, say, by 10 points and 30 points in one hit?

but we will not see in the Volume a reflection of the volume that has entered the market , we will see a stupid +1

it means indicators based on volumes just fails

besides Volume is different in each brokerage company, alas, it confirms the fact that Volume does not reflect real volumes

Volume is just the number of ticks.... - of change in price per unit time

Would you agree?

---

well even if the Volume is just the number of ticks - i.e. number of "jerks" of the price in one direction or another

and it doesn't bother you, then it's realistic to write what you're asking ...

another question whether it will work profitably