Close Last and Newest trade
-
Hello guys,
Ive been working around this project but i seem not to get it.
How can I make a condition that the total Buys (unrealized) profit is 4$ > for the sell trades and then thats the time it will close?
now it should first check / delete the oldest against the newest trades
https://fxdreema.com/shared/GnadWI6Jd
credits: This project is made by roar and im working around with it.
-
Add to what you have from a loop yellow, because it goes to this once the loop has finished, another loop that collects the running profit, then off yellow use condition to check if the variable profit is>$4 to another loop to deleting trades from the oldest.
-
@jstap this is where i get confused on how i can I collect the running profit.
I do not understand add a loop from yellow. Hope you can help.
-
This should do it, add this into your bot: https://fxdreema.com/shared/oqT60bwOb
-
@jstap thank you for your help.
I was looking for something like this.
there are 10 buy positions. the #1 + #2 + #3 buy has running loss of 5$
there are 15 sell positions. the latest trades, lets say sell #12 + #13 + #14 + #15 has running profit of $9check total profit > 4$
close those trades and ofcourse there will be some trades left which are negative trades.
i tried editing and couldnt make it work.
https://fxdreema.com/shared/7P9FCHVQcThank you.
-
It has no way of creating more than 1 position, this should create more than 1 and close when profit is above the price. this is only a test project, you will need to test and change until it's how you want: https://fxdreema.com/shared/ttZkTguNd
-
@jstap what do you mean by it has no way of creating more than 1 position?
can the sell profit be compensated and closes the buy position also if the profit is > $4?
-
Look at the link I sent this can add more than 1 position at a time, yours was limited to a single position at a time