In order to calculate the number of continuous events (e.g. the number of bars in a series in which the close is higher than the open and vice versa), I could only come up with the following:
Two questions (if the above makes sense): (1) how to reset the counter reading if the continuous series has stopped; and (2) how to correctly write Buffer[i] - i.e. how can I "see" the result itself?
I.e., if the indicator for a particular bar shows "-3", it means that this is the third bar in a row which closed below the opening; if the next bar after it closes above the opening, the indicator will show "1" ......
In the global variables set the initial value of the lot:
There we assign this value to the variable, which will pass the lot value to the position opening function:
After closing the position we will check it for profitability/loss:
The function itself, thanks to Igor Kim...
One more question:
I got the following order for some reason. The next order is equal to the initial lot multiplied by 2, i.e. 1 lost (0.01) 2 lost (0.02) 3 lost (0.02) 4 won (0.02)
and I wanted 1 lost (0.01) 2 lost (0.02) 3 lost (0.04),
And one more thing:
Please advise whether you can do the following (and if you can please write how) :
1 in the code to prescribe the orders and their sizes in turn, so that if the previous order was unprofitable the next one would open, until you get a profit, and then everything from the beginning. Example:
I got for some reason that the subsequent order is equal to the initial lot multiplied by 2. i.e. 1 lost (0.01) 2 lost (0.02) 3 lost (0.02) 4 won (0.02)
and I wanted 1 lost (0.01) 2 lost (0.02) 3 lost (0.04),
And one more thing:
Please advise whether you can do the following (and if you can please write how) :
1 in the code to prescribe the orders and their sizes in turn, so that if the previous order was unprofitable the next one would open, until you get a profit, and then everything from the beginning. Example:
Please tell me if I understand correctly that the anchor angle is the window angle and not the object angle.
And they are counted from left to right, from top to bottom. Then how do I correctly anchor the object to the lower left corner? I have it, the object, disappears from the window for some reason.
Please tell me if I understand correctly that the anchor angle is the window angle and not the object angle.
And they are counted from left to right, from top to bottom. Then how do I correctly anchor the object to the lower left corner? It disappears from the window for some reason.
The anchor angle is the angle from which the position of the object in the window will be calculated. Angles are counted clockwise from left to right. The bottom left corner will be No. 3 (numbering starts from zero).
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please advise,
In order to calculate the number of continuous events (e.g. the number of bars in a series in which the close is higher than the open and vice versa), I could only come up with the following:
Two questions (if the above makes sense): (1) how to reset the counter reading if the continuous series has stopped; and (2) how to correctly write Buffer[i] - i.e. how can I "see" the result itself?
I.e., if the indicator for a particular bar shows "-3", it means that this is the third bar in a row which closed below the opening; if the next bar after it closes above the opening, the indicator will show "1" ......
In the global variables set the initial value of the lot:
There we assign this value to the variable, which will pass the lot value to the position opening function:
After closing the position we will check it for profitability/loss:The function itself, thanks to Igor Kim...
One more question:
I got the following order for some reason. The next order is equal to the initial lot multiplied by 2, i.e. 1 lost (0.01) 2 lost (0.02) 3 lost (0.02) 4 won (0.02)
and I wanted 1 lost (0.01) 2 lost (0.02) 3 lost (0.04),
And one more thing:
Please advise whether you can do the following (and if you can please write how) :
1 in the code to prescribe the orders and their sizes in turn, so that if the previous order was unprofitable the next one would open, until you get a profit, and then everything from the beginning. Example:
1 Lot 0.01
2 Lot 0.01
3 Lot 0.02
....
15 Lot 1.0
Thank you in advance
Boris.
Give me a hint,
What I would do is this. If I were to catch a series of the last four bars, then
Can someone tell me what my mistake is ( question and code on page 693 )?
Try replacing
if (OrderStopLoss()<pp-(TStop.Buy+TrailingStep-1)*po||OrderStopLoss()==0)
to
if (OrderStopLoss()>pp-(TStop.Buy+TrailingStep-1)*po||OrderStopLoss()==0)
One more question:
I got for some reason that the subsequent order is equal to the initial lot multiplied by 2. i.e. 1 lost (0.01) 2 lost (0.02) 3 lost (0.02) 4 won (0.02)
and I wanted 1 lost (0.01) 2 lost (0.02) 3 lost (0.04),
And one more thing:
Please advise whether you can do the following (and if you can please write how) :
1 in the code to prescribe the orders and their sizes in turn, so that if the previous order was unprofitable the next one would open, until you get a profit, and then everything from the beginning. Example:
1 Lot 0.01
2 Lot 0.01
3 Lot 0.02
....
15 Lot 1.0
Thank you in advance
Boris.
Please tell me if I understand correctly that the anchor angle is the window angle and not the object angle.
And they are counted from left to right, from top to bottom. Then how do I correctly anchor the object to the lower left corner? I have it, the object, disappears from the window for some reason.
Please tell me if I understand correctly that the anchor angle is the window angle and not the object angle.
And they are counted from left to right, from top to bottom. Then how do I correctly anchor the object to the lower left corner? It disappears from the window for some reason.