how set stop lose at the opening price of the previous position?
-
helo all freinds
this is a very simple EA , it opens an initial buy and sell trade and the EA must open a new trade when the initial trade arrives a cetain profit limit called "delta ff" as a variable.
my problem is this :
how set stop lose of a 2nd position at the opening price of the previous position opened in the same direction..?
this is the project link: https://fxdreema.com/shared/TtMjhfHpe
sure of your help ..tks
rgds
bachar -
pink for each trade or for each closed trade - buy/sell block with the SL got from a loop
-
thank you Mr Jstap for your help
you say: "pink for each trade or for each closed trade - buy/sell block with the SL got from a loop" , kindly try to specify exactly if i have to add other blockes!! where ? or if i have to change connections..? which one and how ? i did try in toooo many modes but i do not succeed ...
what i need is : "to put for the 2nd trade a SL same of the opening price of the previous trade made in the same direction"...!!
this is the project link did not change : https://fxdreema.com/shared/TtMjhfHpe
pls help -

-
MR JSTAP : YOU ARE GREATE , I DO NOT KNOW HOW TO THANK YOU...
THANK YOU -
You are welcome
-
good day,
i did exactly as you instructed above, unfortunately the EA still do not put a stop loss for the new trade equal to the opening price of the previous trade made in the same direction..!!hear is the EA made as per your instruction : https://fxdreema.com/shared/8oEhjwW3c
kindly tell me what is wrong ? how to solve t his problem...tks.
pls see how the EA do not put the SL ...!!!!.....tks
Kind regards
-
@bacharchoura1 You can store the value on a variable and use immedietely before opening the trade. This is an example for buys:

You will have to replivate it for sells with a different variable, of course.
-
Dear Mr Landorra
As you can see I did as you instructed but unfortunately the EA stopped opening even the 2nd trade…!!! Rather than the 3rd …!!!
Pls note that the EA must work exactly as following:
1- Open a first buy and first sell trade.
2- If the first trade (buy or sell) go in profit for the variable value “DELTAFF” in dollar , the EA must open a 2nd trade in the same direction of the wining trade and put a stop lose at the opening price of the first trade…
And so on…to continue opening a next trads in the same direction of the previous winning trade and put the previous wining trade open price as a stop loss for the next one.Pls Mr Landorra, have a look at the EA as I modified according to your instruction and tell me how to make it work properly, tks.
this is the link for the modified EA : https://fxdreema.com/shared/aSlb88rKc
kind regards
bachar -
You need to remove the additional 'For each position' blocks 12267, 12269, 12271 and 12273, as you already modified those on top. Then you need to change the option selected on all pink 'pips away from open price' blocks from its current 'custom (price fraction)' to 'fixed value' instead.
-
Dear Mr L'andorra
this is the link of the EA modified exactly as per your instruction : https://fxdreema.com/shared/U1dzRunvd
as you can see from the below emage , the EA do not open the 2nd nor the 3rd trade even thought the "DELTAFF" did arrive several times (also pls consider that latter i will add up to 100 trades..!!).PLS HELP ME , HOW I CAN MAKE IT OPEN NEW TRADES ONE BY ONE A "DELTAFF" PRICE DISTANCE...!!!
THANK YOU

pls help...tks
rgds
bachar -
GOOD DAY
KINDLY TRY TO ANSWER ME.. THANK YOU -
Is this the whole project or just part of it?
-
Dear Mr l’andorra
The only missed part is the exit part , below is the complete project:
1- Open a first buy and first sell trade on the EA start.
2- If the first trade (buy or sell) go in profit for the variable (and optimizable ) amount of “DELTAFF” in dollar ; then the EA must open the 2nd trade in the same direction of the wining trade and put a stop lose at the opening price of the first trade…
And so on… the EA must continue opening a next trade in the same direction of the previous winning trade and put the previous wining trade open price as a stop loss for the next one.
3- Exit :
-the EA must close all buy trades if the stop loss of the last open BUY trade is triggered
And
-the EA must close all sell trades if the stop loss of the last opened SELL trade is triggered
PLS HELP, TKS -
good morning ,hope you can replay telling me as detailed as possible, tks
-
If my suggestions don't work the reason must be somewhere else in the srtucture. If I can't see it, I cannot be more helpful, sorry. Your current loginc is correct and should work.