One market trade cancels the other at a given level
-
Hello team, thanks for all your help in the previous threads.
Can somebody please help me compile a working EA with the following intended goal.When min1 candle crosses above the hourly candle open - buy and (close sell ) if any.
When min1 candle crossess below the hourly candle open - sell and (close buy) if any.No SL for both as one market entry cancels the other but can have TP.
The intention is to have trades in a given hour with different TP options i.e with ATR, Trail SL and close of day.
All trading activity begins at 0200 and ends at 2300 server times.Here's a link of my incompete work, THANK YOU!
https://fxdreema.com/builderImages of project and error warnings here:

-
@sleek Your shared link just opens builder, open shared link in a web page, copy from there.
Warnings wont stop the EA working, only errors will. -
Thx@jstap
Sorry about the link, everytime I click on it, it takes me directly to the project. Tell me where you land when you click on the link above and here https://fxdreema.com/builder. It's the same in all browsers.Am aware the warnings are not broken code and hence to not affect the workings of the EA, however for all the backtests I have run this has refused to do its intended task which is; To open trades when the min candle crosses above or below the hourly open. and close the opposite trade.
It takes one trade and stops or takes loads of fleating minute trades which close as soon as they are openned or it does nothing at all.
This is a REAL tried and tested startegy that we used at my old prop firm and would like to automate it.Can U help?
Thx -

Does nothing at all on testing.
What am doing I wrong?? It's similar to FxDreema examples!!!
Just want this strategy automated.....
-
@jstap Phew! Finally got what you meant. Got the link.
https://fxdreema.com/shared/KRNPzGg6dLet me know what I need to do to get this to work. Thank you

-
@sleek You don't need a blue block above pink but you do need a pink for each trade, do you need your type to close trades?

-
@jstap Thanks for that, I've changed it as you can see. YesI would need "type to close trade", infact upon your promt I went ahead and changed both, however I don't understand why upon testing it, it produces numerous open and closed trades???
All I need is (open a buy when min1 crosses above H1 open and close all sells, do the opposite when min1 crosses below H1 open)

Please see image of backtest:

Thx @jstap You are a STAR!!! -
@sleek I would think this is only opening one of each type maximum, may be share the no trade block, so can only place a buy or a sell, if it's still not doing as required put a shared link here.
-
@jstap Bummer! I shared the No position block as suggested and it went berserk.
Link to project here:
https://fxdreema.com/shared/L5XXS5kpcI've included the "everytick backtest screenshot too so you can get a visual.
It's taking buy and sell trades every tick and closing them, random!
I do appreciate you taking time to help out, really!
Also, probably needs a different thread, can I incorporate a script I made with FXdreema (Hourly open line) in the EA without getting over 20 something errors?? How?
Ta. -
@sleek This is working as expected, it places a trade then when it closes it places another, on back test you cannot compare 2 timeframes to view if things are doing as wanted, maybe add a once per bar block to limit it to one trade per candle.
You can add all from a FX script providing it is from a corresponding tab, if not may still work if put in the right place, Maybe you just need the logic involved, put here what exactly the script does.