Opposite direction trade with specific entry
-
Hey all.
Did few very basic EA's , but struggle with one thing which looks too advance for me and don't really know how to solve it.Please advice me.Want to open 1 trade LONG/SHORT with SL based on previous candle low/top and TP 4:1 (400% of SL)
When Bullish candle - BUY with SL on candle low
When Bearish candle - SELL with SL on candle high
this part is easy however I struggle at this pointWant to open second trade which is going to be pending order in opposite direction than first trade (don't want to close first trade)
ENTRY at place where is 2:1 of first trade
with SL at place where is TP of first trade
TP for this trade also will be 4:1 (400% of SL)Due to the fact SL and TP of first trade is set up by % ,would be nice to avoid other measurements like pips.
I'm at this point
https://fxdreema.com/shared/HCWEgSdbbI have a feeling that "pips away from take profit" or "trailing" might be solution,however don't really know how they works.
-
Is the pending order supposed to be programmed at the exact same time the first trade is executed?
-
Yes , both trades open at the same time
-
Heh no one ? Is it that complex ?
-
Just connect the 'buy pending order' immediately below your 'sell now'' block and the opposite below the 'buy now' one.
-
I've worked on it and it looks like it's almost done.
What is completed in 2nd stage: I added pending orders , SL of second trade is at place where is TP of first trade (works correctly) . TP is calculated correctly (4:1) .
Just one thing is not working properly...ENTRY point of second trade.
In the tab for pending orders > "open at price price" - data to adjust Entry is taken correctly from TP of previous trade, however it can only be set by pips (PRICE OFFSET) , so the question now is how to adjust it in % value,or maybe there is other way to figured it outhttps://fxdreema.com/shared/QR0C8fURc
heh "l'andorrà " looks like You place the comment when I was writing mine

-
I was wondering if "pips away from SL" might works here. When set up 200% from SL it would be my level of entry,but don't know how to take the value from that block and paste it into "open at price" tab.
Something like this
https://fxdreema.com/shared/liId9QWTd -
or maybe something like this needs to be modified
https://fxdreema.com/shared/X93K2tjJ -
Which one of the last three projects is the latest one?
-
I have find out how to calculate ENTRY of second trade. The problem now is , EA wrongly calculate lot size. It calculate as it is <0 value

This is the set up

and this is SELL PENDING ORDER

-
The low of latest candle may be above or below your entry price. So you will end up with a negative (impossible) SL and lot size.
-
I don't think that's the case. Trade is open when previous candle was bullish,which is obvious that close of that candle must be above low of the candle, otherwise it will be bearish candle.
Trade is open at specific time let's say 15:00 , when cadle ID is "1" takes data from candle printed at 14:45-15:00 . The fact my trade is open at 15:00 close price of previous candle is my open price and the fact is bullish candle it must be above the low. So how it's possible to be negative then ?2nd acc. reply