Reply

Closing Order when price didn’t move forward after some bars

3 replies

Conmariin

Subscriber, bbp_participant, community, customer, 54 replies.

Visit profile

5 years ago #237151

Hi,

I want to close an order after x bars when price is not moving in my direction for example when a trend reversal occurs. How can I achieve it in an EA? Is that possible? Any Ideas?

Thanks 🙂

 

 

Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de

0

Conmariin

Subscriber, bbp_participant, community, customer, 54 replies.

Visit profile

5 years ago #237152

I forgot I know how to close after x bars. I want to know how to Code that the ea is realizing that its not going anymore in the opened direction.

Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de

0

Ilya

Customer, bbp_participant, community, 105 replies.

Visit profile

5 years ago #237157

Hi,

First of all, for me, that is what an SL is for. if you base it on ATR, that could give your EA a good idea that you’re wrong with your assumption and the need to exit a trade is present.

But if you want a specific exit rule that contains “IF x bars has passed after order opened AND Another-Condition THEN close order ” that would depend on the trading strategy you are trying to code, and what would be an indication of “going the wrong way” or a “reversal” for you.

For example, maybe you want to use Fibonacci levels (38.2%, 50.0% and 61.8% ) to determine a bar closed beyond/above them which means reversal probability for you? Maybe pivot points is best for that assumption? maybe candlestick patterns? (Though IMO they’re useless).

So have your strategy in mind, and you can code it..

Ilya

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #237177

As Ilya mentioned the simplest solution is usually the best – meaning use a simple stop-loss

Another option would be to combine Open P/L < 0 & Bars Since Order Open > X => close a position

Let me know if you need any help with the setup

0

Viewing 3 replies - 1 through 3 (of 3 total)