How do I set the initial account balance? I want to set the lot size depending on the total profit of the account. So how do I determine the initial balance correctly?
tor4en: How can I determine the initial account balance? I want to specify lot size depending on total profit of my account. So, how to determine this initial balance correctly?
The result of testing with the visualization is as follows: 1) there is no position: classtype=no position, functype=no position // as expected 2) there is a sell position: classtype=BUY, functype=SELL // classtype has incorrectly determined the position direction 3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for it to correctly determine the direction of sell?
I'm confused about myposition.Type(). Did the following thing to check:
When testing with visualization, the result is as follows: 1) there is no position: classtype=no position, functype=no position // as required 2) there is a sell position: classtype=BUY, functype=SELL // classtype has erroneously determined the position direction 3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for correct determination of the sell direction?
If you look closely at the CPositionInfo class "with X-ray", you may notice that the Type() method doesn't return the position type (unlike the PositionType() method).
If you look closely at the CPositionInfo "X-rayed" class, you will notice that the Type() method does not return a position type (unlike the PositionType() method).
Thank you very much. It worked with your tip! I was guided by the article How to Use the Standard Library Trade Classes When Writing an EA, and there in the section "1.6 CPositionInfo Class" there is myposition.Type(), which probably needs to be corrected.
After changing the language in Metaeditor, did you reboot it?
Let's check.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters.
You probably need the DoubleToString() function.
I have written this code to check the position:
But for some reason in the comment the values appear with 4 decimal places. Instead of _Digits put 5 still 4 characters, put 3 - 3 characters
A deposit is accompanied by a record
DEAL_ENTRY_STATE
Sign of status entry
This is the direction to look in.
I'm confused about myposition.Type(). Did the following thing to check:
The result of testing with the visualization is as follows:
1) there is no position: classtype=no position, functype=no position // as expected
2) there is a sell position: classtype=BUY, functype=SELL // classtype has incorrectly determined the position direction
3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for it to correctly determine the direction of sell?
I'm confused about myposition.Type(). Did the following thing to check:
When testing with visualization, the result is as follows:
1) there is no position: classtype=no position, functype=no position // as required
2) there is a sell position: classtype=BUY, functype=SELL // classtype has erroneously determined the position direction
3) there is a buy position: classtype=BUY, functype=BUY // as it should be
I tried putting if (myposition.Select(_Symbol)) instead of if (PositionSelect(_Symbol)), the result is the same. Maybe myposition.Type() should be written differently for correct determination of the sell direction?
If you look closely at the CPositionInfo class "with X-ray", you may notice that the Type() method doesn't return the position type (unlike the PositionType() method).
If you look closely at the CPositionInfo "X-rayed" class, you will notice that the Type() method does not return a position type (unlike the PositionType() method).