Detecting Range
-
Hi everybody,
I'm trying to build an Open Range Break Out EA.
It's detecting the range between 0 an 9 o'clock.
If the candle closes above the highest price level of that range -> open buy trade
If the candle closes blow the lowest price level of that range -> open sell trade
SL = highest/lowest price level
TP should be 1.5 the range size.Here's where I'm struggling:
- detecting the distance between highest/lowest range price
- only one trade (buy or sell) should be executed - actually that does not work
Any help would be appreciated
-
@gajus Your no trade block should limit to only 1 trade, using market properties and candle ID you can get the high and the low candle, high - low will give you the distance.
-
@jstap Thanx for your immediate reply

I'm now calculating the range shape with market properties highest/lowest price and that works nice.
I also tried those properties for getting the range size into a variable "RangeSize" via the "formula" block for using as SL and TP, but that does not work as the trades are closed immediately... -
@gajus You need a label in the comment or nothing displays, the distance is already a price fraction so you only need to display the numeric value:

-
@jstap Thanks for your input, comment now works. I just put it in to see what range size is detected. But it gives me the wrong range size. As you see in pic 1 the range size is determined BEFORE the range has ended. The size will be correctly saved in the "RangSize" variable, TP is set correctly, but depending on the wrong range size. And although there is a "Once a day"-Block trades are open only on a few days...

-
@gajus The comment block is limites to work just once per day when you need it to show the results all day, you should remove it. That 'pass' block is also unnecessary. What do you exactly mean the range is not 'ended'? The range is in formation until 09:00 as per your blocks settings. How can it not be 'ended' before that time?
-
@l-andorrà said in Detecting Range:
@gajus The comment block is limites to work just once per day when you need it to show the results all day, you should remove it. That 'pass' block is also unnecessary. What do you exactly mean the range is not 'ended'? The range is in formation until 09:00 as per your blocks settings. How can it not be 'ended' before that time?
Thanks to your hint I now managed it to work: Changed the "once per day" time and the candle-id's within the formula block. Now the range size is correct. But still opens up more than one trade per day...
-
@gajus said in Detecting Range:
Hi everybody,
I'm trying to build an Open Range Break Out EA.
It's detecting the range between 0 an 9 o'clock.
If the candle closes above the highest price level of that range -> open buy trade
If the candle closes blow the lowest price level of that range -> open sell trade
SL = highest/lowest price level
TP should be 1.5 the range size.Here's where I'm struggling:
- detecting the distance between highest/lowest range price
- only one trade (buy or sell) should be executed - actually that does not work
Any help would be appreciated
open range breakout EA, where in the world did you get that idea?
-
@tipsywisdom hahaha, don't know. The idea came suddenly into my mind...
For me it's a start to get deeper into ea programming using fxdreema - that's the reason why
-
@gajus Then use a 'no trade' block to stop more trades to be open.