Without more details I doubt that anyone can help you.
Can you show the relevant code?
Without more details I doubt that anyone can help you.
Can you show the relevant code?
OK GumRai, here are the relevant details from the code:
void Comput_Profits_of relevant_Pair()
{
ProfitB1=0.0;
for (j = 0; j < OrdersTotal(); j++)
{
OrderSelect(j,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber_A && OrderSymbol() == "EURUSD") ProfitB = ProfitB+OrderProfit()+OrderCommission();
}
return(0);
}
Comment "ProfitB = $ " + DoubleToStr(ProfitB1,2) +
And as I wrote I see on the screen the profit without the commission.
BTW at the moment The screen is correct, but 6 hours ago it was shown as I wrote!!
Any idea...?
Thanks
OK GumRai, here are the relevant details from the code:
void Comput_Profits_of relevant_Pair()
{
ProfitB1=0.0;
for (j = 0; j < OrdersTotal(); j++)
{
OrderSelect(j,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber_A && OrderSymbol() == "EURUSD") ProfitB = ProfitB+OrderProfit()+OrderCommission();
}
return(0);
}
Comment "ProfitB = $ " + DoubleToStr(ProfitB1,2) +
And as I wrote I see on the screen the profit without the commission.
BTW at the moment The screen is correct, but 6 hours ago it was shown as I wrote!!
Any idea...?
Thanks
I don't believe that is your code
void Comput_Profits_of relevant_Pair()
It will not compile with the space between "of" and "relevant"
Also
void Comput_Profits_of relevant_Pair() { ProfitB1=0.0; for (j = 0; j < OrdersTotal(); j++) { OrderSelect(j,SELECT_BY_POS,MODE_TRADES); if (OrderMagicNumber() == MagicNumber_A && OrderSymbol() == "EURUSD") ProfitB = ProfitB+OrderProfit()+OrderCommission(); } return(0); } Comment "ProfitB = $ " + DoubleToStr(ProfitB1,2) +
You set a variable named ProfitB1 to zero before the loop but use a different variable, ProfitB for the running total in the loop.
As you use ProfitB1 in your comment ( which I assume is within another function and not as it shows here), your comment will always show zero. Unless the value is changed elsewhere.
crossy: here are the relevant details from the code: |
| ||
GumRai: I don't believe that is your code | And you can't return zero from a void function. |
I don't believe that is your code
It will not compile with the space between "of" and "relevant"
Also
You set a variable named ProfitB1 to zero before the loop but use a different variable, ProfitB for the running total in the loop.
As you use ProfitB1 in your comment ( which I assume is within another function and not as it shows here), your comment will always show zero. Unless the value is changed elsewhere.
Hello GamRai,
You are correct. What I wrote is not exacly the function (from the EA) that I use. The truth is that
I cann't attach the ful EA since it is not my purpose. So what I did was: taking the main part of it and try to show you the main line code that can help you to solve the problem.
I paste again the problem:
void Comput_Profits_of relevant_Pair()
{
ProfitB1=0.0;
for (j = 0; j < OrdersTotal(); j++)
{
OrderSelect(j,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber_A && OrderSymbol() == "EURUSD") ProfitB1 = ProfitB1+OrderProfit()+OrderCommission();
}
return(0);
}
Comment "ProfitB1 = $ " + DoubleToStr(ProfitB1,2) +
and thre problem is:
I set
ProfitB1 = rderProfit()+OrderCommission();
The value of the parameter "ProfitB1" is seen on the screen.
The problem is sometimes that the value of "ProfitB" is seen (and computed) without the Commission value.
Any idea, please?
Thanks
"I paste again the problem:"
and once again
It will not compile with the space between "of" and "relevant"
You are not copying and pasting working code. If you want help, then copy and paste from your actual code that has compiled with no errors
"I paste again the problem:"
and once again
It will not compile with the space between "of" and "relevant"
You are not copying and pasting working code. If you want help, then copy and paste from your actual code that has compiled with no errors
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello freinds,
I set
ProfitB = rderProfit()+OrderCommission();
The value of the parameter "ProfitB" is seen on the screen.
The problem is sometimes that the value of "ProfitB" is seen (and computed) without the Commission value.
Any idea, please?
Thanks