If position Close or Trail Trade Mgmt MT5
-
Hi everybody, @fxDreema
trying to build an EA, if trade was successfully opened that it closes either by Heiken Ashi Candle or by ATR *1,5 or *2 Mulitplier Trailing Stop.
Please ignore entry condition this would be just placeholder only looking for a solution from Block Buy/ Sell once Trade is opened.
For HA i currently dont use it for Entry conditions only looking for Trade Management e.g. for Buy Trade if Bearish Candle 1 Closes and Sell Bullish Candle 1 closes.
For ATR SL would like to give it enough space for market to breath, dont wont it to trailing to Break even only ATR 14 Range Multiplier.
When testing in Buy/Sell Block ATR 14 with *2 to place Stop works perfectly fine.
Question is which version in need to use:
1.)Do i need " If position" statement block additionally to opening condition side,
2.) Do i need " If position" + " Or" statement to either close it by Condition or Trailing Stop
3.) or can i just make it on instance below the Buy/ Sell Block?
This would be 1 example.
https://fxdreema.com/shared/pugWuIrXc
Thx
-
The trailing stop block is checking any open trade by itself so you don't need to connect it below that 'is position'. Even more, I recommend to separate it from there and connect it separately. For any other open trade that is not supposed to be modified by the trailing stop you definitely need that 'if position' block.
-
Thank you. If i got you correct the trailing stop should be seperate next to the main signals?
But how does it differentiate between the main exit signal and the trailing Stop as backup exit?I would like to make that trade is either close by Heiken Ashi or the trailing stop.
Like a Close by Heiken Candle or if not by ATR trailing stop.The idea is that Heiken Ashi stays quite consistent when trending and color rarely changes.
The Trailing Stop would be the emergency "safety net" if Momentum Candle would switch direction so quick that Heiken Ashi Color has not yet changed but price has dropped way back and therefore Take Profit would still be quite good.
What have noticed from backtesting, it doesnt help to trail Stop to break even as "safety", because often market tends to come back to entry level before moving in trend direction.
Also tested trailing stop based on fixed pip parameter would restrict market as well to early.Heiken Ashi could be the "main" exit signal but trailing also Trailing Stop would be the backup if Heiken Ashi still hasent changed signal.
Often noticed, that when there is huge Momentum Candle, often Price retraces faster in previous direction again.
But most of the times Heiken Ashi would stay very stable and candles would rise normally.

-
@fifeivkbdedwcf Exactly this is what you need:
https://fxdreema.com/shared/KqQmCbqne
This way both closing strategies will be working together so whatever happens first will be closing the trade.
-
Hi thank you very much for your help.
So if i get you right, this section need to placed next to actual entry conditions block right?
Do you have to connect the " For each trade" row
and the "pass" row with the actual entry section on the left?
So after a trade was entered by Buy/ Sell Market Block, do you have to connect it as well or can it be simply added without connection like in your example?

-
Forgot ask,
so if condition block closes trade either by Heiken Ashi or trailing Stop
i need to select "no Take Profit" under the Buy/Sell Block as well right?

-
In no case you should connect the separate structures because they are working independently. That will work for all trades no matter what they are doing. I don't understand why you need to change the 'no TP' option. You already selected that option in your first post.
-
So i would just place the trees next to each other like on the screenshot right?
For No Take Profit, fought because the middle row "for each position" has the HA Close Buy/ Sell as condition already.
As mentioned earlier it seems not to be working to just use Heiken Ashi Candle ID1 in Custom Price level in Buy/ Sell Block as TP.
As i get right, i need to add middle row to close by Heiken Ashi right?
-
The position of the trees on the builder is irrelevant. You can position them at will. What is fundamental is the number ID of the blocks on top. 'No position' block number needs to be the lowest one. Then the 'for each position' block number needs to be higher and finally the 'Pass' block number. This means those blocks trees will be executed in that order.
On the TP issue, I guess the only option is asking the admin directly why it doesn't work. Personally I never tried it that way. -
Ok, so with block id number you looking at it as a row from top to bottom, and then its counted 1,2,3,4.... as ID

-
In your picture the order would be: 2,1,9,5,10,11
-
@jstap Exactly
-
Ok got it, so you dont mean the entire row only counting each piece by itself.
But why do you continue from 10 after 5, just asking because the tree is seperating after once per bar, arent they equally counted?
-
Order runs from the order lines run, until you get to a double (or more) connection, then lowest number will activate first, followed by the line before going back to next lowest number.
-
Ok, so if i got you right it would continue because of the double conenction path because this is where signal would be processed next right?
-
Your picture shows it, start at 2, then down the line to 1, then 9 because lowest number connected, then down the line to 5, then back to 10 and down the line to 11.
-
Ok thx, just asked for curiosity, so i can understand how it functions.