Calculate EA profit every time EA Restart in same day
-
Hi.
Mto EA have a feature to close ALL positions and pending orders when specific profit or Loss is reached. This is easy to do using bucket os orders or For each closed position, when I run EA Just once a day. The problem is that, when my EA is closed, It Restart in same day (lets call cycle 2). And now I.need to calculate the specific profit/equity from this cycle after EA start again. How can this be achieved?
B.R.
-
@trdjb3 I’m no expert (yet!) but couldn’t you add two sets of time filters 1 for cycle 1 and 2 and duplicate the blocks to each time filter. So the EA automatically calculates for timed session
-
HI
Thank you for your reply. I cant use arbitrary time, i need to calculate exactly from the moment EA starts again (that depends if it is closed during day with Profit os loss), understand?
-
@trdjb3 https://fxdreema.com/shared/Qc1ep8eDb in here you will see how to save details into a txt file and then read, you will need to reset when finished with data.
-
Thank you for your reply. This is a litle complex to me for now.
I found this post:
https://fxdreema.com/shared/6N55Sodxd
I'm triyng to do the same, store timestamp (after close all orders) in a variable, and then using this variable inside a bucket of closed positions, should it work, right? (it is not in my tests)
Here an example:
-
@trdjb3 This will work while the EA is left on as soon as removed it will loose data, you could use terminal (global) variables to save a number, not well practiced at this but you can do with standard blocks, save with terminal variables in output and communication-read with a condition block.
-
Hi.
I undererood what you said, but in this case EA Will not be removed. Only Will start again with New orders. I can print in chart the time (as a number) so I know that the data is being stored in the New EA cycle variable, but It seams that this number is not recognized by bucket of orders as a valid time. Maybe bucket of orders dont accept time as a number?
-
@trdjb3 If the EA is staying on chart, you can put value in a variable then read when necessary, put your variables in a comment so you can check what is happening.