forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Forum

Forex Software, Forex Strategies, Expert Advisors Generator

You are not logged in. Please login or register.


Forex Forum → Portfolio Expert → Portfolio Expert - Wish list

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 13

Topic: Portfolio Expert - Wish list

Hello Traders,

This topic is designated for a discussion about adding new features and protection for the Portfolio Expert.


I'll start the topic with one feature already implemented - "Max Open Positions".

2 (edited by GD 2021-11-29 07:23:36)

Re: Portfolio Expert - Wish list

Hi Popov

I think

1. a Supreme Maximum spread can be also useful to add
2. Risk % overall to enter
2. Time/date of trade execution common to all EAs relative to spread problems different per trader and each market
4. and of course the Total Report which will help to decide over all above.

I attach you a code I wrote based to found ideas here etc.

I will be happy listen opinions.

//+------------------------------------------------------------------+
//|//////////////////////////////////////////////////////////////////|
//+------------------------------------------------------------------+  
void OpenPosition(Signal &signal)
  {
   if(!IsWithinMaxSpreadO())
      return;
....
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void ClosePosition(Position &position)
  {
   if(!IsWithinMaxSpreadC())
      return;
......
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsWithinMaxSpreadO()
  {
   bool WithinMaxSpread=true;

   for(int attempt = 0; attempt < TRADE_RETRY_COUNT; attempt++)
     {
      if(Maximum_Spread_Points > 0)
        {
         MqlTick tick;
         SymbolInfoTick(_Symbol,tick);
         double spread = NormalizeDouble(((tick.ask-tick.bid) / _Point), 0);
         //Need NormalizeDouble here because of rounding errors in MT4 that otherwise occur (confirmed in several backtests).
         WithinMaxSpread=true;
         if(spread > Maximum_Spread_Points)
           {
            Sleep(TRADE_RETRY_WAIT);
            // Print("Spread_O ", DoubleToString(spread, 0), "higher than the maximum allowed ", DoubleToString(Maximum_Spread_Points, 0), "points. Try ", IntegerToString(attempt + 1), "of ", IntegerToString(TRADE_RETRY_COUNT), ".");
            WithinMaxSpread = false;
           }
         if(spread <= Maximum_Spread_Points)
           {
            attempt= TRADE_RETRY_COUNT;
           }
        }
     }
   return(WithinMaxSpread);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsWithinMaxSpreadC()
  {
   bool WithinMaxSpread=true;

   for(int attempt = 0; attempt < TRADE_RETRY_COUNT; attempt++)
     {
      if(Maximum_Spread_Points > 0)
        {
         MqlTick tick;
         SymbolInfoTick(_Symbol,tick);
         double spread = NormalizeDouble(((tick.ask-tick.bid) / _Point), 0);
         //Need NormalizeDouble here because of rounding errors in MT4 that otherwise occur (confirmed in several backtests).
         WithinMaxSpread=true;
         if(spread > Maximum_Spread_Points)
           {
            Sleep(TRADE_RETRY_WAIT);
            // Print("Spread_O ", DoubleToString(spread, 0), "higher than the maximum allowed ", DoubleToString(Maximum_Spread_Points, 0), "points. Try ", IntegerToString(attempt + 1), "of ", IntegerToString(TRADE_RETRY_COUNT), ".");
            WithinMaxSpread = false;
           }
         if(spread <= Maximum_Spread_Points)
           {
            attempt= TRADE_RETRY_COUNT;
           }
        }
     }
   return(true);
  }
//+------------------------------------------------------------------+
//|//////////////////////////////////////////////////////////////////|
//+------------------------------------------------------------------+  

Re: Portfolio Expert - Wish list

> 1. a Supreme Maximum spread can be also useful to add

This is a good request.

We can make a "Prevent Entry on High Spread", where we can set a value of points. If we have a volatile situation with a higher spread, the expert will not execute entry orders.

Re: Portfolio Expert - Wish list

On protective option from the FSB's experts: "Stop trading at min account"


// If the account equity drops below the value,
// the expert will close out all positions and will exit.
// The value must be set in account currency. Example:
// Example: Protection_Min_Account = 700 will close positions
// if the equity drops below 700 USD.

static input int Protection_Min_Account = 0; // Stop trading at min account

Re: Portfolio Expert - Wish list

Popov wrote:

> 1. a Supreme Maximum spread can be also useful to add

This is a good request.

We can make a "Prevent Entry on High Spread", where we can set a value of points. If we have a volatile situation with a higher spread, the expert will not execute entry orders.


i use this code for max spread protection..

bool MaximumSpread()
  {
   const double spread = (Ask() - Bid()) / _Point;
   if(spread > Maximum_Spread)
     {
      Print("The current spread ", DoubleToString(spread, 0), " is higher than the maximum allowed ",Maximum_Spread);
      return(true);
     }
   return(false);
  } 

this must be here:

void OpenPosition(Signal &signal)
  {
//---  
     if(useMaximum_Spread)
     {
      if(MaximumSpread())
         return;
     }..........

and this inputs.

static input bool          useMaximum_Spread = false;                
input int                  Maximum_Spread    = 10;

Re: Portfolio Expert - Wish list

Popov wrote:

On protective option from the FSB's experts: "Stop trading at min account"


// If the account equity drops below the value,
// the expert will close out all positions and will exit.
// The value must be set in account currency. Example:
// Example: Protection_Min_Account = 700 will close positions
// if the equity drops below 700 USD.

static input int Protection_Min_Account = 0; // Stop trading at min account

here i use this

void OpenPosition(Signal &signal)
  {
      if(useMinimumEquity)
     {
      if(CloseAllMinimumEquity())
         return;
     } 

the function is

bool CloseAllMinimumEquity()
  {
   double equity = AccountInfoDouble(ACCOUNT_EQUITY); 
   if(equity < MinimumEquity)
     {
      CloseAllPositions();
      Print("Minimum Equity is below ",MinimumEquity);
      return(true);
     }
   return(false);
  } 

and this inputs

static input bool          useMinimumEquity           = false;                // Use minimum equity stop
input int                  MinimumEquity              = 100;                  // Set minimum equity to stop

so ea will close all positions when equity reached x...


maybe some have better code.

Re: Portfolio Expert - Wish list

my features for portolio.

1. Lot calculation of percent based on equity or account balance or risk percent depend on stoploss strategie use..option her for maximum lots.
2. if reach xx amount from all open positions close all and stop trading for rest of the day
3. set max long position to open..so we can decide how much open..or say 0 to open only sells
4. set max short position to open.
5. set max open positions at a bar.. so when have 200 strategies..one bar i can have 50 open positions at once..to avoid this u can use this option.
6. i dont know if it is but i have sometimes problems with brokers..volume check. tp sl check..money check..before send an order.
7. check if use hedging account. else ea stop
8. hidden tp&sl option
9.testing separate each strategy in backtester..for eg..20 strategies in portfolio..in input is use backtest 1,2,3,8,9,10

Re: Portfolio Expert - Wish list

> 1. Lot calculation of per cent based on equity or account balance or risk per cent depend on stop loss strategy use. An option here for maximum lots.

We need to figure out the best approach.


> 7. check if use a hedging account. else ea stop

Yes, agree. I'll add this.

> 9.testing separate each strategy in backtester..for eg..20 strategies in portfolio..in input is use backtest 1,2,3,8,9,10
I have plans for a simple Portfolio Editor. It may help with separating strategies or merging portfolios.

9 (edited by GD 2021-12-01 05:28:09)

Re: Portfolio Expert - Wish list

Hi Popov

Yesterday there was a big bar change in EURUSD cause of NEWS.
My  portfolio EA cause of that did not proceed well for 5-6 bars and lost few trades.
I think we need to add such a case i.e.
Do not trade after a big change in previous bar larger than 50 pips or relative to some other %change

Re: Portfolio Expert - Wish list

Hi Popov,
I've intensively use your great software for four months now and I have a few suggestions relative to portfolios

1. be able to see journal of all transactions for a portfolio (use case : check easily when I have differences between reality, backtest and/or mt4 tester without checking all strategies one by one)
2. more complicated, but would be a huge improvement for me : find the best portfolios from a collection. My dream would be to have a collection of portfolios that meets acceptance criteria (the same as individual strategies) and be able to choose the best one. I love the portfolio feature, but sometime it takes a lot of time to find the best combination of strategies that meets some criteria (like less drawdown for the highest net profit, or maximum month on profit, ...) so having a new tab like "Porfolio collection" where the software calculates all combinations of the strategies included in the collection and keeps those that meets acceptance critera would be awesome :-)

Thank you very much for your software which is already awesome. I really love to work with it.
Have a great day
David

Re: Portfolio Expert - Wish list

@GD

> Do not trade after a big change in the previous bar larger than 50 pips

You can use ATR (1) and Level = 0.0005 with the logical rule "ATR is lower than level"

12

Re: Portfolio Expert - Wish list

Thanks You

13

Re: Portfolio Expert - Wish list

Dear Mr. Popov,

I believe that showing the aggregate drawdown curve on the portfolio balance chart, as shown on the single strategy balance chart, would be a valuable addition.

Best regards,

MW

Posts: 13

Pages 1

You must login or register to post a reply

Forex Forum → Portfolio Expert → Portfolio Expert - Wish list

Similar topics in this forum