[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 403

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
It's just that these labyrinthine programmers don't have the heart to come in even once a week and earn their schtick. They're so sick of it that they just want to make money.
What about the balloon?
This is my idea:
I open an order, and then it depends on what balance it closed in.
If the balance is less than zero, we record the loss, and if it is greater than zero, we start working from the beginning.
If our loss is less than zero, we have fixed it and assigned to a variable, for example: Minus
Minus = OrderProfit (- 45 cents);
AccountAqviti + Minus + my value (my conscience)
further on the next order
if the profit of this order is higher than AccountAqviti + Minus + my value (my conscience), then we close the order; if not, go higher than zero, then we fix it:
(AccountAqviti + OrderProfit) - (AccountAqviti + Minus + my value (my conscience)) = Minus
if Minus >= 0, then Minus = 0;
That's what my idea is all about:
Good afternoon! I would like to create an indicator that displays a channel on indicators like MASD, AO and similar. This indicator is superimposed on the window of basic indicators (MASD, AO and similar) and is drawn as parallel lines above and below 0. These lines are defined as an average of maximum peaks (above 0) and minimum troughs (below 0) for the specified period.
I am trying to use AO indicator as an example but it does not work.
Algorithm:
we write the indicator readings to an array,
we run through this array searching for peaks / troughs,
we write them to certain arrays,
we find the average value of peaks, then troughs,
we assign the obtained value to the indicator buffer.
At this step, it is not the channel (sticking to 0) on the indicator that is defined in the code, but the average value of maximum peaks and average value of minimum troughs.
The definition of peaks and troughs can be removed from the code and executed as a function, but for now I have left it that way - it does not change the matter.
Problems:
1. terminal hangs (considerably)
2. lines are not displayed as an average; they appear as max/min for a period.
Took a long time to figure it out, but I can't figure out the cause of the problems. Can you please help me to correct my code or give me a link to the source code of similar issues and I will try to correct it further. Thanks in advance.
ExistInHistoryToDay().
Good afternoon!
Problems:
1. terminal hangs (significantly)
Increasing an array's size in a loop is cruel, that's why it hangs. Increase the size once at once. Or use timeseries at once
P.S. see personal messages
How do I loop through a variable of type string?
Example
How do I replace this construction with a loop?Good afternoon, could you please tell me how to write a condition whereby if the profit of an open order is one pungent, then close that order?
Using the function.
https://www.mql5.com/ru/forum/131859/page3#434225
How do I loop through a variable of type string?
Example
How do I replace this construct with a loop?