Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1505
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thank you for the answer. But I still can't figure out the right formula string that calculates this, I'm not familiar with many things. Could you spell it out here like.
***
Thank you for the answer. But I still can't figure out the right formula string that calculates this, I'm not familiar with many things. Could you spell it out here like.
***
I miscalculated here, in addition to the profit/loss for the day I need the account balance at the beginning of the day. :((( Help))
Account balance() - changes constantly, how to fix it for example on Hour==1 ?
Thank you for the answer. But I still can't figure out the right formula string that calculates this, I'm not familiar with many things. Could you spell it out here like.
***
Profit calculation...
if you want the current day's profits, then
I miscalculated here, in addition to the profit/loss for the day I need the account balance at the beginning of the day. :((( Help))
Account balance() - changes constantly, how to fix it for example on Hour==1 ?
Afternoon. Can you please tell whether an indicator can forcibly start the Calculate event by pressing a button on the chart that is handled in OnChartEvent?
ChartSetSymbolPeriod with the same symbol and timeframe can be used to update the chart (similar to the Refresh command in the terminal). Updating the chart in turn triggers recalculation of the indicators attached to it. Thus, you can recalculate the indicator on the chart even when there are no ticks (for example, on weekends).
Profit counting...
If you want the current day's profits, then
Not exactly what I want. I want "if PROFIT FOR THE DAY has exceeded a certain percentage (already calculated) of the BALANCE at the beginning of the day, then stop trading, or vice versa, until it has not exceeded - then trade (function already exists, too). I really hope there are some ideas.
IT IS NECESSARY TO FIND THE ACCOUNT BALANCE AT THE BEGINNING OF THE DAY!!! Accountbalance changes all the time and therefore it cannot be used, you need a formula where it is set for a certain time probably. e.g. 00:01.
Here it is, but it gives an error, help me fix it
error
That's not quite what I need. I need "if PROFIT FOR THE DAY has exceeded a certain percentage (already calculated) of the BALANCE at the beginning of the day, then stop trading or vice versa, while NOT EXCEEDED - then trade (function also exists). I really hope there are some ideas.
IT IS NECESSARY TO FIND THE ACCOUNT BALANCE AT THE BEGINNING OF THE DAY!!! Accountbalance changes all the time and so it cannot be used, you need a formula where it is set for a certain time probably. e.g. 00:01.
I told you
you need a formula that gives you the account balance as of the beginning of the day
I told you.
subtract the current day's profit from the current balance and you get the balance at the beginning of the day
look, the problem is that the percentage that I want to set, for example (1%) changes numerically and if
at each new trade the BALANCE will increase and so will the 1%. So my function will not work because there is no FIXED SET POINT.