compare And update Variable
-
Hello,
please help me with the following problemI created a variable named maxprofit that I want its value to be updated in every tick so that it can be compared with current profit in every tick.
How can I define this variable?
and EA relative to this new variable value and compering them close positions -
How is that variable supposed to be calculated? What is it measuring?
-
@Elham
There are already blocks to check profit, and no need to reinventing the wheel -
Hello
As you said, there are windows to check the profit at any moment, so I found these few in the picture.
What I want is that considering that the variables can be changed, I need it save the highest profit touched in a transaction in itself, so that I can define in other blocks such as a conditions that compares the current profit in each tick to the maxprofit of That special transaction (((Assuming we only have one open trade)))Now, due to the fact that the variable amount is updated every moment, I can compare this amount with my current profit , and when the (n) percent between these two gaps is created, I will exit the transaction.
-
Please someone help me in this matter
In addition, I do not know how to attach the photo taken from the open windows discussed above?
I hope someone CAN solve this problem -
@Elham
Hello, if I understood correctly, what you should do is to first define your variable, then set a condition that if a new variable comes and is larger than your variable, it will be identified as a larger variable, which is also possible with the definition of a larger variable in new variable -
@ehsan1362
Of course, don't forget to reset the variable after doing the whole process -
@Elham You can share the link to your project this way:

-
@l-andorrà
I know how to share the project but what I wanted to show you were the blocks related to profit and percentage.
My question is not about a specific project, this is an idea that I have and it can be implemented in any project with any strategy and be a part of it to prevent big losses, so I wanted a photo of the desired blocks that you mentioned above ،اthat I want to Share you to see if I missed something? or is there any other blocks that I didn't see? -
@ehsan1362
hi ehsan
You got it right
I know that I have to define the variable in such a way that every tick its amount that is updated and from this moment on, the comparison reference can be with the current profit of the transaction. -
@Elham So if I get it right, you want to see on chart two figures. One is current price right now that will change from tick to tick and then the maximum profit that has bin hot so far regardless the current price. Is that correct?
-
Hiiiiiiii

Can someone please answer my question?
Our talks remained incomplete and I did not receive an answer. I explained that I do not have a specific project . This is a way to avoid big losses. It can be for any project.Please

-
@Elham yes you are right

-
l'andorrà@ you got what I mean please Please guide me how to implement this concept in fxdreema
-
@Elham Ok Then you need something like this for the profit at this moment:
https://fxdreema.com/shared/bKbTjhrse
This example is counting pips instead of money but you can change it accordingly. Please confirm it's doing what you need and we can move on.