Is it possible to enter a trade based only on a single price, and

 

have the EA determine from the direction of price movement relative to the value of the entry price, decide which trade (BUY or SELL) to make ?

.

.

I have seen some EA's while trying to solve this problem and they all so far enter a trade based on the values of indicators or otherwise, regardless of price.

.

Is there an EA which does this that I could learn how to do it from ?

thankyou

 

MG

This is a price-driven EA https://www.mql5.com/en/code/9899


> have the EA determine from the direction of price movement relative to the value of the entry price

Not as simple a question as you may think!

At its simplest, you could take this example, where the current bar opens above/below your entry level then prices crosses your level...

if (Open[0] < YourEntryPrice)
if (Bid > YourEntryPrice) OrderSend 'Buy'


if (Open[0] > YourEntryPrice)
if (Ask < YourEntryPrice) OrderSend 'Sell


FWIW

-BB-

 
BarrowBoy:

MG

This is a price-driven EA https://www.mql5.com/en/code/9899


> have the EA determine from the direction of price movement relative to the value of the entry price

Not as simple a question as you may think!

At its simplest, you could take this example, where the current bar opens above/below your entry level then prices crosses your level...

if (Open[0] < YourEntryPrice)
if (Bid > YourEntryPrice) OrderSend 'Buy'


if (Open[0] > YourEntryPrice)
if (Ask < YourEntryPrice) OrderSend 'Sell


FWIW

-BB-


thanks BarrowBoy:

I will give that a look.

Im finding out just how unsimple it is. I have done loads of logic solutions which work on paper, but I can't work it out, and I am currently looking through loads of EA code. it is fun but it is time consuming :-). thanks again.

 

Codeing is like learning the sequence of nerve cells to fire in oder to open a door and then find the floor is full of obsticles to avoid.

 
Ickyrus:

Codeing is like learning the sequence of nerve cells to fire in oder to open a door and then find the floor is full of obsticles to avoid.


lol
Reason: