__Please, go to the examples and check those blocks - the purple "bucket" blocks and pink "for each..." blocks. There are some examples and each example have description.
In short, "For each... " blocks are used when you want to iterate throuhg trades, one by one, and do something with each one of them.
"Bucket" blocks are to be used when you want to get value (min, max, averate or total) out of a group of trades.
"Check profit (unrealized)" does everything inside - loads trades, collects data and checks the result.
Also check how to work with Variables. You can define as many variables as you want and modify them as you want. This is low level stuff and I will always recommend to not use Variables (at least not too many of them), but I will not add such functionality to collect profits over time.
What is the idea. If you have variable named "MyVar", then on each tick calculate the total profit and if the total profit is > than the value of MyVar => set the value of MyVar to that profit. This is simple. What is not simple is when to reset the value of that variable, because you have trades that will be closed and trades that will be opened. It sounds boring, but it depends.[/quote:29srlbfe]
Hi there,
Iยดm now having issues with writing my custom variable. The reason is that I cannot find how to pull out the value of the "Check profit (unrealized)". When you work with formulas, you can set it to write the value of the calculation into a variable. I can see that in the block, you can edit variables as well. Attached an image, from which my guess is that the value of "compare" (or P11) is the value of current unrealized profit. So, will I simply put P11 in the orange field of my variable?
Now, how to call custom variables from formula block? As in terminal variables, it clearly says "This is NOT for variables"
I suggest to review how your "trail stop group of trades" block works. It really has flaws when using it real time.
I found the block "trailing money loss group of trades", that my understanding is that it DOES keep record of the maximum profit from a filtered group of trades, and this may work out for me as well.
Many thanks for your help as always
EDIT: Following the image here, I set P11 in the orange box as drawn, but got a compile error. 'Compare' - Undeclared identifier
{
v::MAXProfitBuy = Compare;
block98(103);
}
......
variables.jpg