Get the balance from the history tab ?
-
Hello admin from fxdreema @fxdreema, I would like as a last chance to know how to print on the screen using the block "coment" the value of the sum of the "Profit" field that is in the "history" tab
I marked in red in the image exactly what and where I want it, is this possible? if so can you guide me on how to do it?
I have tried in countless ways and failed.
-
@fabiobioware Does your history tab select profit from today, last week, last month, or life-time?
-
@roar Does that matter? OrdersHistoryTotal() can only return what is selected on the history tab.
-
@trader-philipps Oh, right, OrdersHistoryTotal() is the way to go here!
I was thinking about the total lifetime profit so that he could put AccountBalance() to OnInit tab and then run it again in OnTick to get the difference
-
@roar The profit I want to check is daily.
For this I am filtering on the metatrader itself.
The problem is that this balance appears on the screen. -
@fabiobioware Store your balance in a variable once per day, and then compare your current balance to that variable:
https://fxdreema.com/shared/gCCnR5R6d -
@roar said in Get the balance from the history tab ?:
Store your balance in a variable once per day, and then compare your current balance to that variable
@roar Did not work.
Follows the screen image.
-
@fabiobioware it only works with the future trades, it doesn't check the history before the EA.
If you need to check the history, you have to use the OrdersHistoryTotal() functions.
-
-
@roar is the configuration correct?
replace OrdersHistoryTotal() with OrdersHistoryTotal() functions ?
-
@roar or use OrdersHistoryTotal() functions - startbalance ?
-
@fabiobioware OrdersHistoryTotal() is the function @roar meant. Without the word function!
-
@trader-philipps said in Get the balance from the history tab ?:
@fabiobioware OrdersHistoryTotal() is the function @roar meant. Without the word function!
@roar and @trader-philipps I tested the first one and it seems to be working, but now I want to take the amount that he printed on the screen and multiply it by the number 5 and he is not performing the account correctly, can you tell me how to do it ?? follow the print of how I'm trying to do.

-
@fabiobioware If you want to multiply the intraday profit, just copy-paste that whole string of code into the formula field.

-
@roar said in Get the balance from the history tab ?:
If you want to multiply the intraday profit, just copy-paste that whole string of code into the formula field.
ok nowwww @roar

Thank you very much @roar and @trader-philipps for help me in this resolution.
-
@roar @trader-philipps one last question:
I noticed that the numbers are appearing in the double format, even though I put int in the variables and constants, I need the numbers to be integers.example: in the image is 1199.0
i need 1199 to appear only .0 should not appear, how can i make this happen ??
-
@fabiobioware Dont know why this happens, maybe the comment block adds the decimal.. You can try the MathRound function: in your comment field, put
MathRound(comment) -
@fabiobioware said in Get the balance from the history tab ?:
@roar The profit I want to check is daily.
For this I am filtering on the metatrader itself.
The problem is that this balance appears on the screen.For the daily profits I made this block "Check profit (period of time)". As it name suggests, it checks the profit that is made in certain period of time. There are Time 1 and Time 2. By default Time 1 is 00:00 at the current day and Time 2 is the current time.
-
@fabiobioware I followed the examples above and did not succeed in seeing the balance closed. Could you share the example of the finished project?
