forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


(Page 2 of 2)

Forex Software → Portfolio Expert → New Portfolio Expert with Protections and a News Filter

Pages Previous 1 2

You must login or register to post a reply

RSS topic feed

Posts: 26 to 38 of 38

Re: New Portfolio Expert with Protections and a News Filter

> Question: is F3 the final solution? Or just a temporary workaround?

The expert should remove the trade hold at midnight if it runs properly.
I'll try to see how to make it more robust.

Re: New Portfolio Expert with Protections and a News Filter

did you guys have the same problem that ea does nothing in mt4 tester? i have to change in code

void OnTick(void)
  {
   if(ArraySize(Time) < requiredBars)
      return;

   if(!MQLInfoInteger(MQL_TESTER))
     {
      UpdateAccountProtection();
      CheckAccountProtection();

to

void OnTick(void)
  {
   if(ArraySize(Time) < requiredBars)
      return;

   if(MQLInfoInteger(MQL_TESTER))
     {
      UpdateAccountProtection();
      CheckAccountProtection();

than ea open trades.

28 (edited by Roughey 2024-09-06 09:03:10)

Re: New Portfolio Expert with Protections and a News Filter

@Popov there must be a bug in Position Calculation. Can someone check. When i make visual MQL Tester .
The Position calculation is wrong and it not show Profit

I check again. when i leave in settings all to 0 it is calculating positions wrong and not show Profit. When i use 10 positions than it shows profit and calculate good..So if we use Posit stats true only it is calculating wrong


i justed check code

in OnTick this line must be deleted and it worked.

   if(MQLInfoInteger(MQL_TESTER))
     {
      UpdateAccountProtection();
      CheckAccountProtection();

      const datetime time = TimeCurrent();
      if(time > lastStatsUpdate + 3)
        {
         lastStatsUpdate = time;
//         if(Max_OpenPos > sigma || Max_OpenLots > sigma)
            SetPosStats();

         UpdateStats();
        }
//         if(Max_OpenPos > sigma || Max_OpenLots > sigma)

In in your behaviour cause u let us set PosStat ON/OFF it have to be

if(Pos_Stat)
            SetPosStats();

I think ;-)

29 (edited by Roughey 2024-09-07 09:06:02)

Re: New Portfolio Expert with Protections and a News Filter

Daily Loss:

Now i checked why is when i set Daily Loss 1000. Than it show eg 3000 and activate to late? Normally it should close and suspend at 1001.

BTW: What the difference between MaxOpen Lots and Max Positiions?

Re: New Portfolio Expert with Protections and a News Filter

There must be a BUG.

The globalVariables are not initialized @Popov

You have forgot to call the function in OnInit!

   InitGlobalVariables();

<--

Re: New Portfolio Expert with Protections and a News Filter

I'll work on the MQL code next week.
Thank you for the reports!

32 (edited by Roughey 2024-11-12 20:14:52)

Re: New Portfolio Expert with Protections and a News Filter

Popov wrote:

I'll work on the MQL code next week.
Thank you for the reports!

Hey i hope you are well. When will you update code? And i found another BUG.

It is not Showing results and when i close manually it is not calculate position size correctly.

Post's attachments

1.png 38.06 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: New Portfolio Expert with Protections and a News Filter

when close manually it will not show positions correctly also lotsize

Post's attachments

2.png 70.36 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: New Portfolio Expert with Protections and a News Filter

I'll check that.

Thank you for the report!

Re: New Portfolio Expert with Protections and a News Filter

Popov wrote:

I'll check that.

Thank you for the report!


Is this fixed already i just checked but it is not working and calculate the Profit

36 (edited by Roughey 2025-01-11 14:18:57)

Re: New Portfolio Expert with Protections and a News Filter

Hey Popov,

there must be a bug in LotCalculation also posStatCount posStatLots and posStatProfit not working correctly-

when i use this function for counting profit it works

double CountProfit(void)
  {
   const int minMagic = GetMagicNumber(0);
   const int maxMagic = GetMagicNumber(strategiesCount);
   const int posTotal = PositionsTotal();
   double count = 0;

   for(int posIndex = posTotal - 1; posIndex >= 0; posIndex--)
     {
      const ulong ticket = PositionGetTicket(posIndex);
      if(PositionSelectByTicket(ticket) && PositionGetString(POSITION_SYMBOL) == _Symbol)
        {
         const long magicNumber = PositionGetInteger(POSITION_MAGIC);
         if(magicNumber >= minMagic && magicNumber <= maxMagic)
            count += PositionGetDouble(POSITION_PROFIT);
        }
     }

   return count;
  } 

but when i check all other thinks something is completely wrong with calculation of lots open trades and so on.
also its not counting positions correctly.

i checked on mql5

Re: New Portfolio Expert with Protections and a News Filter

Thank you for the report!

I'll check the code and fix any problems I may find.

Re: New Portfolio Expert with Protections and a News Filter

Popov wrote:

Thank you for the report!

I'll check the code and fix any problems I may find.


hey.. i have now checked again. for some reason i used netting account..hedge is working..

But i only the Profit Calculation is wrong or sometimes not working..maybe some other user can check also

Posts: 26 to 38 of 38

Pages Previous 1 2

You must login or register to post a reply

Forex Software → Portfolio Expert → New Portfolio Expert with Protections and a News Filter

Similar topics in this forum