2 candles after cross and other conditions - EA problem
-
Hi, I've been trying to develop in FxDreema for a while now and I'd like to solve this strategy. Could you help me with the conditions? I've drawn it on a chart for better understanding.
I need to meet the conditions:
After the buy cross - find 2 consecutive sell candles (candle 1 < candle 0)
= highest HIGH since the cross - after 2 consecutive sell candles = > on this HIGH put an entry BUY pending order
SL = Lower low before cross
or 2 last low FractalAfter the sell cross - find 2 consecutive buy candles (candle 1 > candle 0)
= lowest LOW since the cross - after 2 consecutive buy candles = > on this LOW put an entry SELL pending orderSL = higher high before cross
or 2 last high FractalRisk per position = 1%
If an order is placed and we break the level where SL is - at SELL high and at BUY low, then if the price breaks this before activating the trade = we delete the order.
If a SELL position is opened and the conditions for opening a BUY position are met = BUY is activated, then close the SELL position immediately.
And also if a BUY position is opened and the conditions for opening a SELL position are met ´= SELL is activated, then close the BUY position immediately

my efforts
Simple version:

Old version:

-
You are requesting the crossing and the consecutive candles to happen at the exact same time when they are supposed to happen at separate moments in time. You will need either variables controlling those events or loops searching for them in the past. I don't see any of those in the simple version and not sure of it on the old one. Can you please confirm?
-
Yes, I need help with this. I used variables in the old version, but according to the line I found that it didn't work properly.
I'm attaching the version where I should search for a crossover, because I deleted the old version. I didn't know how to solve it anymore
-
@l-andorrà To understand - The trade will always be entered only when the condition is met - cross + 2 opposite candles in a row.
Cross is clearly given. 2 opposite candles are at most 20 candles away from the cross. Otherwise the trade is invalid.Risk is 1% and TP to SL is 1:1
I probably forgot to write these things.If a cross occurs, I had the variable Buy_cross = 1 and Sell_cross = 1
because these variables were by default with the value 0.
And after 20 candles they were reset to the value 0.That was my logic, but it didn't work for me, because I couldn't configure it correctly in the blocks
-
Well, that was a good idea. You definitely need variables to confirm the crossing is valid. This is what you need (general idea)
- Buy crossing happens. That means Buy_cross = 1 and Sell_cross = 0
- On a different branch tree block, you need to use a condition block requiring Buy_cross = 1 AND then another block searching for the consecutive candles. If conditions happens a buy is open.
- When a sell crossing happens, then Buy_cross = 0 and Sell_cross = 1. You don't need to count 20 candes anymore.
-
Yes, great, so I added it back and used it as a condition.
https://fxdreema.com/shared/jF2BVfnGb
Now I need to determine the highest high from the buy cross condition to the 2 sell candle condition next to each other - which will be the buy pending order price level
How to do it?
-
@l-andorrà
Here is update:https://fxdreema.com/shared/vbS52wrR
solved ? :
if cross to buy
2 consecutive sell candles (candle 1 < candle 0)
If cross to sell
2 consecutive buy candles (candle 1 > candle 0)
counting max 20 candles
Risk 1 lot = 1%I NEED:
× If a BUY is opened, close the SELL position (if it is open)
× If a SELL is opened, close the BUY position (if it is open)× for SELL
SL = high before crossover
or 2. the last high of the Fractal× for BUY
SL = Low before crossover
or 2. the last low of Fractal(SL it is good to see in the picture above)
Thanks for help
-
Sorry for not having noticed toyr last request. Can you please confirm the previous link is the last version of your project?
-
@l-andorrà Yes, it is last version my project