Project option's bug
-
I found a bug when customizing some project options. Pip counting is wrong when combining different charts. All details can be seen at this thread:
-
I tried it by using terminal variables, but the bug persists.
-
Can this be backtested?
I wonder what values are added to the variables, for example in block 3. What is the profit for the trade there? I can suggest to put let's say Comment block after this block to see the value, but immediately after Comment to connect Delay, so each iteration of the loop would be paused for a while.
-
Unfortunately it cannot be backtested as designed to be used. I want to run the EA on different charts simultaneously so it cannot be backtested. It can when tested on single charts, but as I showed in my thread of the first message, then it works well. For some reason I don't understand, the combination of more than one chart makes it go crazy.
On the other hand the variable in block 3 is always initialized as 0. It is reinitialized as 0 once the target pip or the time period have been reached, whatever happens first. As you can see in this picture, it is correctly counting those pips belonging to the open trades:
http://i67.tinypic.com/2e3bw4j.png
But it works well just because there is this single chart. Problem arises when different ones are combined.
-
I can confirm there is a bug in the "Project Options" tab, specifically when you try to modify point format rules. I tried it with GBPJPY by using in my FXCM MT4 platform. According to the value by default, 0.001 = 0.01. Well, I tried it equals 0.1 and 1.0 but nothing changed.
For some reason I don't know the point format rules just work for some cases and not for others.
-
You know, I think you want to just use that block "Check profit (period of time)". And why are you trying to work with pips, when it's easier to work with profits - the symbol doesn't matter.
-
About the point rules, I found that if you write equal sides, for example 0.001 = 0.001, then this row disappears. This is probably intentional, but now I think it can be confused for someone that does not expect that. I checked different variants and it seems to work, but when one row disappears, I get confused with the row that was below it.
-
@fxdreema said in Project option's bug:
You know, I think you want to just use that block "Check profit (period of time)". And why are you trying to work with pips, when it's easier to work with profits - the symbol doesn't matter.
I need to work with pips because that way I'll be able to manage different accounts regardless their balances and leverage. I want to introduce myself as a trader getting 200 pips per week, no matter your brokerage, leverage or deposit.
-
@fxdreema said in Project option's bug:
About the point rules, I found that if you write equal sides, for example 0.001 = 0.001, then this row disappears. This is probably intentional, but now I think it can be confused for someone that does not expect that. I checked different variants and it seems to work, but when one row disappears, I get confused with the row that was below it.
I don't know if this is a problem. I will show you where the problem by using a few screenshots. But firstly, let's begin with a simpler versions of the EA:
https://fxdreema.com/shared/f6DIpNNDcThis one is designed to do the basic thinhs I need.
- Counting how many pips are right now at open trades.
- Counting how many pips belong to closed trades.
- Closing all trades when the weekly target (open pips - closed pips) is achieved.
I will upload the screenshots in the following messages.
-
This is my example.
Bokerage: Admiral Markets.
Trades: Opened manually.
Conditions: The EA is running on a single chart and one only trade will be open. This way we will see how all three variables (open pips, closed pips and total pips) are calculated.These are the point rules applicable (they have been customized).

-
Case 1. Forex, five digits. An EURUSD trade is open and appartently everything works perfectly.

The two digits number showing the pips open right now is correctly transformed into real pips. In this example, the number 16 means 1.6 pips as is wished.
Variables status:
a) Profitopen: Correct. -1.6 pips are open right now.
b) Profitclose: Correct. 0 pips are closed so far.
c) ProfitAll: Correct. -1.6 pips are the overall result do far.This trade is manually closed with a final result of -2.9 pips.
-
Case 2. Gold, three digits. This chart was specifically included at the customized point rules (see message above). The first problems arise.

Now only one of the variables is correctly transformes, whereas the other two are clearly wrong.
Variables status:
a) Profitopen: Correct. -3 pips are open right now (correct transformation).
b) Profitclose: Wrong. The loss of 2.9 pips belonging to our previous trade are suddenly transformed into -0.0029. The correct result here should be -2.9, and not this one.
c) ProfitAll: Wrong. -3.0029 pips is a correct sum, but because of the wrong value of Profitclose, the final result is incorrect.Tha trade is manually closed with a final loss of 1.8 pips. That means the total closed pips so far are -2.9 -1.8 = -4.7 pips.
-
Case 3. Nikkei Index, no digits. This chart was also customized as the previous one. Things are getting much worse:

Same as before. Only one of the variables is correctly transformed, whereas the other two are again wrong.
Variables status:
a) Profitopen: Correct. -8 pips are open right now (correct transformation).
b) Profitclose: Wrong. I simply can't understand where this number comes from. Not a single clue why the EA considers that more than 8 pips have been closed so far.
c) ProfitAll: Obviously Wrong. Once more the shown number pips is a correct sum, but because of the wrong value of Profitclose, the final result is incorrect.This is the final screenshot showing the results af all three trades:

-
As you can see in the previous examples, the point rules work perfectly for open trades, but they simply fail when counting closed trades. Each chart is considered in a different way, no matter I specified how should they be transformed at the project options.
If only the closed trades were correctΓ±y transformed as per the point rules, this problem would vanish immediately.
-
@isp00rt You can still work in dollars... in % of the account balance for example
And I guess that people prefer % instead of pips. Pips are often confusing, we can see in in this very forum topic 
"For each Closed Trade" - I understand that you want to get all closed trades from all markets, but this block has no limit and it simply loads all trades ever closed, even if they are 6 months old. Is it possible that the block calculates more closed trades than you actually want?
-
I think I found the problem and fixed it. Sometimes the numbers appear with many 99999, but I added NormalizeDouble() and it still happens... I don't know why.
And I still think that working with profits is better. I was testing this in MT5 because in Saturday this is the way to work with multiple symbols and I worked with EURUSD and USDJPY (Gold is missing). As a result when I have 10 pips loss in USDJPY, the loss as money is something like -89... very disconnected and confusing.
-
@fxdreema said in Project option's bug:
@isp00rt You can still work in dollars... in % of the account balance for example
And I guess that people prefer % instead of pips. Pips are often confusing, we can see in in this very forum topic 
"For each Closed Trade" - I understand that you want to get all closed trades from all markets, but this block has no limit and it simply loads all trades ever closed, even if they are 6 months old. Is it possible that the block calculates more closed trades than you actually want?
-
I know working with account balance percentage is easy and common. Unfortunately, I was specifically requested to offer my results in pips in order to collaborate with a group of professional traders (wish me luck!).
-
I already knew how For Each Close Trade works. This is why I select a custom period of profit results shown at the MT4 platform. In my case, one week. That way I can be sure no unwanted trades are included.
-
-
Here I am again after some testing has been done. Certainly it works better now, but no completely fine. Let me show you my results.
Test conditions:
-
Automatic trades instead of manual ones. I used a different EA opening trades an then, on a separate chart, the pipcounter EA. Obviously the same magic number was used on all of them.
-
A total of 5 charts were used simultaneously, all of them having different point rules.
-
No previous closed trades were available for the test. That means the number of pips for closed trades at the beginning was exactly 0.
And this was the outcome. After a few hours, three trades were closed, with the following results:

These are the numbers. The USDJPY trade was closed with a positive 5.5 pips. The first JP225 trade was closed with a negative 10 pips an the second one with a negative 26 pips. That means the overall resul for closed pips should be 5.5 - 10 - 34 = -38.5 pips.
Sadly, this is what I got:

This is a screenshot including a fourth open trade correctly counted, as you can see. The problem is, once again, the count of closed pips. At first glance, the number shown (506) seemps completely random, but then I tried to figure out why it was so. This is my bes guess of how it was counted:
550 pips for the positive USDJPY trade minus 10 pips for the first JP225 and minus 34 for the second equals exactly 506.
That means that both JP225 trades were correctly counted once closed, but that was not the case with the USDJPY that was multiplied by 100. Then I took a look at the point rules for three digit charts and I confirmed that they were 0.001 = 0.01. And this is not the correct result.
Any idea why the EA is only partially counting pips correctly?
-