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.


Forex Software → Portfolio Expert → Portfolio code Change for more than 100 strategies

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 10

Topic: Portfolio code Change for more than 100 strategies

Hi,

IS IT possible to add more than 100 strategies in one Portfolio?

I know eas generate max 100.

But when i want to combine manually 2x100 strategies Into one.

Only Need to Change strategiescount value?

2 (edited by hannahis 2020-09-30 08:05:11)

Re: Portfolio code Change for more than 100 strategies

Hi Roughey,

You can add up to 300 EA in EA Studio into a Portfolio (go to Tools Tab and under General Setting, set the max number of EA allowed in Collection.

I realised that if I Add All (from Collection) to Portfolio, not all 300 EA will be added.  Often only 100 seem to be added instead.

So one trick I use is, I go directly to the Portfolio Tab and under the Content Tab, I click upload (my 300 collection) and 300 will appear in the Portfolio and I'll export it from there.

Re: Portfolio code Change for more than 100 strategies

yes nice trick..

what i want to make is. i have ea with x strategies and a second with x strategies.

now i want to combine them together without changing the stratgiescount or to much in mql code.

what can i change in code that the portfolio can difference between 2 different signalLists starting with 0?


Portfolio A:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SetSignals(Signal &signalList[])
  {
   int i=0;
   ArrayResize(signalList,2*strategiesCount);
   ArrayResize(signalList,2*strategiesCount2);   
   HideTestIndicators(true);

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":61,"takeProfit":13,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Moving Averages Crossover","listIndexes":[0,0,0,0,0],"numValues":[16,30,0,0,0,0]},{"name":"Average True Range","listIndexes":[1,0,0,0,0],"numValues":[32,0.01,0,0,0,0]},{"name":"RSI","listIndexes":[1,3,0,0,0],"numValues":[18,30,0,0,0,0]}],"closeFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[19,30,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_00();
   signalList[i++] = GetEntrySignal_00();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":93,"takeProfit":12,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[30,69,0,0,0,0]}],"closeFilters":[{"name":"RSI","listIndexes":[2,3,0,0,0],"numValues":[25,71,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_01();
   signalList[i++] = GetEntrySignal_01();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":93,"takeProfit":16,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Momentum","listIndexes":[5,3,0,0,0],"numValues":[28,98.8,0,0,0,0]}],"closeFilters":[{"name":"Moving Averages Crossover","listIndexes":[2,0,0,0,0],"numValues":[8,23,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_02();
   signalList[i++] = GetEntrySignal_02();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":72,"takeProfit":10,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[27,70,0,0,0,0]},{"name":"RSI","listIndexes":[2,3,0,0,0],"numValues":[20,50,0,0,0,0]}],"closeFilters":[{"name":"Moving Averages Crossover","listIndexes":[1,0,0,0,0],"numValues":[18,31,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_03();
   signalList[i++] = GetEntrySignal_03();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":79,"takeProfit":24,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Moving Averages Crossover","listIndexes":[0,0,0,0,0],"numValues":[8,35,0,0,0,0]},{"name":"RSI","listIndexes":[0,3,0,0,0],"numValues":[38,30,0,0,0,0]},{"name":"Bollinger Bands","listIndexes":[0,3,0,0,0],"numValues":[21,1.93,0,0,0,0]},{"name":"Moving Averages Crossover","listIndexes":[3,0,0,0,0],"numValues":[14,38,0,0,0,0]}],"closeFilters":[{"name":"Bollinger Bands","listIndexes":[5,3,0,0,0],"numValues":[19,3.54,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_04();
   signalList[i++] = GetEntrySignal_04();

   HideTestIndicators(false);
   if(i!=2*strategiesCount)
      ArrayResize(signalList,i);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_00()
  {
   double ind0val1 = iMA(NULL,0,16,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val2 = iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val3 = iMA(NULL,0,16,0,MODE_SMA,PRICE_CLOSE,2);
   double ind0val4 = iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 > ind0val2 + sigma && ind0val3 < ind0val4 - sigma;
   bool ind0short = ind0val1 < ind0val2 - sigma && ind0val3 > ind0val4 + sigma;
   double ind1val1 = iATR(NULL,0,32,1);
   double ind1val2 = iATR(NULL,0,32,2);
   bool ind1long  = ind1val1 < ind1val2 - sigma;
   bool ind1short = ind1long;
   double ind2val1 = iRSI(NULL,0,18,PRICE_CLOSE,1);
   double ind2val2 = iRSI(NULL,0,18,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma;

   Signal signal = CreateEntrySignal(0, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 61, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_00()
  {
   double ind3val1 = iRSI(NULL,0,19,PRICE_CLOSE,1);
   double ind3val2 = iRSI(NULL,0,19,PRICE_CLOSE,2);
   bool ind3long  = ind3val1 < 30 - sigma && ind3val2 > 30 + sigma;
   bool ind3short = ind3val1 > 100 - 30 + sigma && ind3val2 < 100 - 30 - sigma;

   Signal signal = CreateExitSignal(0, ind3long, ind3short, 61, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_01()
  {
   double ind0val1 = iRSI(NULL,0,30,PRICE_CLOSE,1);
   double ind0val2 = iRSI(NULL,0,30,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 69 - sigma && ind0val2 > 69 + sigma;
   bool ind0short = ind0val1 > 100 - 69 + sigma && ind0val2 < 100 - 69 - sigma;

   Signal signal = CreateEntrySignal(1, ind0long, ind0short, 93, 12, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_01()
  {
   double ind1val1 = iRSI(NULL,0,25,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > 71 + sigma;
   bool ind1short = ind1val1 < 100 - 71 - sigma;

   Signal signal = CreateExitSignal(1, ind1long, ind1short, 93, 12, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_02()
  {
   double ind0val1 = iMomentum(NULL,0,28,PRICE_CLOSE,1);
   double ind0val2 = iMomentum(NULL,0,28,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 98.8000 - sigma && ind0val2 > 98.8000 + sigma;
   bool ind0short = ind0val1 > 200 - 98.8000 + sigma && ind0val2 < 200 - 98.8000 - sigma;

   Signal signal = CreateEntrySignal(2, ind0long, ind0short, 93, 16, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_02()
  {
   double ind1val1 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,1);
   double ind1val2 = iMA(NULL,0,23,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > ind1val2 + sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma;

   Signal signal = CreateExitSignal(2, ind1long, ind1short, 93, 16, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_03()
  {
   double ind0val1 = iRSI(NULL,0,27,PRICE_CLOSE,1);
   double ind0val2 = iRSI(NULL,0,27,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 70 - sigma && ind0val2 > 70 + sigma;
   bool ind0short = ind0val1 > 100 - 70 + sigma && ind0val2 < 100 - 70 - sigma;
   double ind1val1 = iRSI(NULL,0,20,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > 50 + sigma;
   bool ind1short = ind1val1 < 100 - 50 - sigma;

   Signal signal = CreateEntrySignal(3, ind0long && ind1long, ind0short && ind1short, 72, 10, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_03()
  {
   double ind2val1 = iMA(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val2 = iMA(NULL,0,31,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val3 = iMA(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,2);
   double ind2val4 = iMA(NULL,0,31,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma && ind2val3 > ind2val4 + sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma && ind2val3 < ind2val4 - sigma;

   Signal signal = CreateExitSignal(3, ind2long, ind2short, 72, 10, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_04()
  {
   double ind0val1 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val2 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val3 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,2);
   double ind0val4 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 > ind0val2 + sigma && ind0val3 < ind0val4 - sigma;
   bool ind0short = ind0val1 < ind0val2 - sigma && ind0val3 > ind0val4 + sigma;
   double ind1val1 = iRSI(NULL,0,38,PRICE_CLOSE,1);
   double ind1val2 = iRSI(NULL,0,38,PRICE_CLOSE,2);
   bool ind1long  = ind1val1 > ind1val2 + sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma;
   double ind2upBand1 = iBands(NULL,0,21,1.93,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind2dnBand1 = iBands(NULL,0,21,1.93,0,PRICE_CLOSE,MODE_LOWER,1);
   bool ind2long  = Open(0) > ind2upBand1 + sigma;
   bool ind2short = Open(0) < ind2dnBand1 - sigma;
   double ind3val1 = iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,1);
   double ind3val2 = iMA(NULL,0,38,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind3long  = ind3val1 < ind3val2 - sigma;
   bool ind3short = ind3val1 > ind3val2 + sigma;

   Signal signal = CreateEntrySignal(4, ind0long && ind1long && ind2long && ind3long, ind0short && ind1short && ind2short && ind3short, 79, 24, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_04()
  {
   double ind4upBand1 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind4dnBand1 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_LOWER,1);
   double ind4upBand2 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_UPPER,2);
   double ind4dnBand2 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_LOWER,2);
   bool ind4long  = Open(0) > ind4dnBand1 + sigma && Open(1) < ind4dnBand2 - sigma;
   bool ind4short = Open(0) < ind4upBand1 - sigma && Open(1) > ind4upBand2 + sigma;

   Signal signal = CreateExitSignal(4, ind4long, ind4short, 79, 24, false);
   return (signal);
  }

Portfolio B:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SetSignals(Signal &signalList[])
  {
   int i=0;
   ArrayResize(signalList,2*strategiesCount);
   ArrayResize(signalList,2*strategiesCount2);   
   HideTestIndicators(true);

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":61,"takeProfit":13,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Moving Averages Crossover","listIndexes":[0,0,0,0,0],"numValues":[16,30,0,0,0,0]},{"name":"Average True Range","listIndexes":[1,0,0,0,0],"numValues":[32,0.01,0,0,0,0]},{"name":"RSI","listIndexes":[1,3,0,0,0],"numValues":[18,30,0,0,0,0]}],"closeFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[19,30,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_00();
   signalList[i++] = GetEntrySignal_00();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":93,"takeProfit":12,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[30,69,0,0,0,0]}],"closeFilters":[{"name":"RSI","listIndexes":[2,3,0,0,0],"numValues":[25,71,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_01();
   signalList[i++] = GetEntrySignal_01();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":93,"takeProfit":16,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Momentum","listIndexes":[5,3,0,0,0],"numValues":[28,98.8,0,0,0,0]}],"closeFilters":[{"name":"Moving Averages Crossover","listIndexes":[2,0,0,0,0],"numValues":[8,23,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_02();
   signalList[i++] = GetEntrySignal_02();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":72,"takeProfit":10,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RSI","listIndexes":[5,3,0,0,0],"numValues":[27,70,0,0,0,0]},{"name":"RSI","listIndexes":[2,3,0,0,0],"numValues":[20,50,0,0,0,0]}],"closeFilters":[{"name":"Moving Averages Crossover","listIndexes":[1,0,0,0,0],"numValues":[18,31,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_03();
   signalList[i++] = GetEntrySignal_03();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":79,"takeProfit":24,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Moving Averages Crossover","listIndexes":[0,0,0,0,0],"numValues":[8,35,0,0,0,0]},{"name":"RSI","listIndexes":[0,3,0,0,0],"numValues":[38,30,0,0,0,0]},{"name":"Bollinger Bands","listIndexes":[0,3,0,0,0],"numValues":[21,1.93,0,0,0,0]},{"name":"Moving Averages Crossover","listIndexes":[3,0,0,0,0],"numValues":[14,38,0,0,0,0]}],"closeFilters":[{"name":"Bollinger Bands","listIndexes":[5,3,0,0,0],"numValues":[19,3.54,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_04();
   signalList[i++] = GetEntrySignal_04();

   HideTestIndicators(false);
   if(i!=2*strategiesCount)
      ArrayResize(signalList,i);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_00()
  {
   double ind0val1 = iMA(NULL,0,16,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val2 = iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val3 = iMA(NULL,0,16,0,MODE_SMA,PRICE_CLOSE,2);
   double ind0val4 = iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 > ind0val2 + sigma && ind0val3 < ind0val4 - sigma;
   bool ind0short = ind0val1 < ind0val2 - sigma && ind0val3 > ind0val4 + sigma;
   double ind1val1 = iATR(NULL,0,32,1);
   double ind1val2 = iATR(NULL,0,32,2);
   bool ind1long  = ind1val1 < ind1val2 - sigma;
   bool ind1short = ind1long;
   double ind2val1 = iRSI(NULL,0,18,PRICE_CLOSE,1);
   double ind2val2 = iRSI(NULL,0,18,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma;

   Signal signal = CreateEntrySignal(0, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 61, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_00()
  {
   double ind3val1 = iRSI(NULL,0,19,PRICE_CLOSE,1);
   double ind3val2 = iRSI(NULL,0,19,PRICE_CLOSE,2);
   bool ind3long  = ind3val1 < 30 - sigma && ind3val2 > 30 + sigma;
   bool ind3short = ind3val1 > 100 - 30 + sigma && ind3val2 < 100 - 30 - sigma;

   Signal signal = CreateExitSignal(0, ind3long, ind3short, 61, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_01()
  {
   double ind0val1 = iRSI(NULL,0,30,PRICE_CLOSE,1);
   double ind0val2 = iRSI(NULL,0,30,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 69 - sigma && ind0val2 > 69 + sigma;
   bool ind0short = ind0val1 > 100 - 69 + sigma && ind0val2 < 100 - 69 - sigma;

   Signal signal = CreateEntrySignal(1, ind0long, ind0short, 93, 12, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_01()
  {
   double ind1val1 = iRSI(NULL,0,25,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > 71 + sigma;
   bool ind1short = ind1val1 < 100 - 71 - sigma;

   Signal signal = CreateExitSignal(1, ind1long, ind1short, 93, 12, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_02()
  {
   double ind0val1 = iMomentum(NULL,0,28,PRICE_CLOSE,1);
   double ind0val2 = iMomentum(NULL,0,28,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 98.8000 - sigma && ind0val2 > 98.8000 + sigma;
   bool ind0short = ind0val1 > 200 - 98.8000 + sigma && ind0val2 < 200 - 98.8000 - sigma;

   Signal signal = CreateEntrySignal(2, ind0long, ind0short, 93, 16, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_02()
  {
   double ind1val1 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,1);
   double ind1val2 = iMA(NULL,0,23,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > ind1val2 + sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma;

   Signal signal = CreateExitSignal(2, ind1long, ind1short, 93, 16, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_03()
  {
   double ind0val1 = iRSI(NULL,0,27,PRICE_CLOSE,1);
   double ind0val2 = iRSI(NULL,0,27,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 < 70 - sigma && ind0val2 > 70 + sigma;
   bool ind0short = ind0val1 > 100 - 70 + sigma && ind0val2 < 100 - 70 - sigma;
   double ind1val1 = iRSI(NULL,0,20,PRICE_CLOSE,1);
   bool ind1long  = ind1val1 > 50 + sigma;
   bool ind1short = ind1val1 < 100 - 50 - sigma;

   Signal signal = CreateEntrySignal(3, ind0long && ind1long, ind0short && ind1short, 72, 10, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_03()
  {
   double ind2val1 = iMA(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val2 = iMA(NULL,0,31,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val3 = iMA(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,2);
   double ind2val4 = iMA(NULL,0,31,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma && ind2val3 > ind2val4 + sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma && ind2val3 < ind2val4 - sigma;

   Signal signal = CreateExitSignal(3, ind2long, ind2short, 72, 10, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_04()
  {
   double ind0val1 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val2 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val3 = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,2);
   double ind0val4 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 > ind0val2 + sigma && ind0val3 < ind0val4 - sigma;
   bool ind0short = ind0val1 < ind0val2 - sigma && ind0val3 > ind0val4 + sigma;
   double ind1val1 = iRSI(NULL,0,38,PRICE_CLOSE,1);
   double ind1val2 = iRSI(NULL,0,38,PRICE_CLOSE,2);
   bool ind1long  = ind1val1 > ind1val2 + sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma;
   double ind2upBand1 = iBands(NULL,0,21,1.93,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind2dnBand1 = iBands(NULL,0,21,1.93,0,PRICE_CLOSE,MODE_LOWER,1);
   bool ind2long  = Open(0) > ind2upBand1 + sigma;
   bool ind2short = Open(0) < ind2dnBand1 - sigma;
   double ind3val1 = iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,1);
   double ind3val2 = iMA(NULL,0,38,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind3long  = ind3val1 < ind3val2 - sigma;
   bool ind3short = ind3val1 > ind3val2 + sigma;

   Signal signal = CreateEntrySignal(4, ind0long && ind1long && ind2long && ind3long, ind0short && ind1short && ind2short && ind3short, 79, 24, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_04()
  {
   double ind4upBand1 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind4dnBand1 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_LOWER,1);
   double ind4upBand2 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_UPPER,2);
   double ind4dnBand2 = iBands(NULL,0,19,3.54,0,PRICE_CLOSE,MODE_LOWER,2);
   bool ind4long  = Open(0) > ind4dnBand1 + sigma && Open(1) < ind4dnBand2 - sigma;
   bool ind4short = Open(0) < ind4upBand1 - sigma && Open(1) > ind4upBand2 + sigma;

   Signal signal = CreateExitSignal(4, ind4long, ind4short, 79, 24, false);
   return (signal);
  }

this will not work now i have to change strategiescount to 10 and change the Entry Exit Signal Numbers.


Anyone an idea?
what about to make a new strategiescount2?

4 (edited by hannahis 2020-09-30 09:19:16)

Re: Portfolio code Change for more than 100 strategies

Hi Roughey,

What do you mean by "without changing the strategies count"?

Strategies Count = the number of strategies? ie. 100, 200 etc

or

Strategies count = the numbering of the strategies in the Portfolio Expert (PE), which is essentially ended up as the EA's Magic Number

So what do you really want? to keep the same Magic Number (not changing the strategies Count) or You want to combine x number of EA into same 100 strategies (without changing the strategies count to 200)?

Answer

1. If you intended to keep the same Magic number of 2 Portfolio EXpert, I can't help you nor suggest it cos I can't imagine the amount of cut and paste etc.

2. If you intend to combine EA from 2 Portfolio Expert, then you need to go to the Validator and import the Strategies from these 2 Portfolio Expert and validate them and allow the validator to ascend them into a new collection that will combine these EA upload from various PE into 1 Collection.

Note: If you only want certain EA from each PE only (i.e. profitable ones only) do delete the strategies from the PE (via Meta Editor, go to line 635 and look for the magic number of the EA you don't want and delete those respective rows), save and compile the EA and upload it in Validator.

For greater details go to https://forexsb.com/forum/post/60910/#p60910

Re: Portfolio code Change for more than 100 strategies

What i want is combine different strategies from different Symbols.

So Portfolio a eurusd with 100 strategies.

Here i get exported ea with strategiescount 100 and Signallist from 00-99 with their entry Exit .

Now i make Portfolio b with usdjpy with 100 strategies.

Now when i want to combine them Into 1 i have to change strategiescount to 200.

But now this is a Problem or massive Work.

I have to Change the entry Exit Numbers from 00-99 to 100-199

So is there a idea to ignore this.

I only want to Copy the strategies from b into a without changing all the Numbers.

So i thought about making a new strategiescountusdjpy=100

Do you know what i mean.

Re: Portfolio code Change for more than 100 strategies

You want to combine 2 different Symbols in 1 PE?

How are you going to trade in MT4? Won't the PE only trade the Symbol on the Chart even if your PE is of different symbol?

Even if I were to attached EURUSD PE onto USDJPY MT4 Chart, it will not trade in EURUSD, it will trade in USDJPY, the chart it is attached to.

So even if you were to combine 2 different symbols into 1 PE, it will only trade in 1 symbol.

Re: Portfolio code Change for more than 100 strategies

yes.

i will make a enum input field with eurusd, usdjpy e.g

than i will make if statement. if input field EURUSD than trade only the 100 strategies for eurusd. when usdjpy trade only the 100 strategies for usdjpy..


so this i want to make with 5 symbols so 500 strategies. but eas not allowed this.. so i have to export each 100 strategies portfolio and copy manually their entry exit logic...but here is the point. only copy not work cause each portfolio starts with 00-99 so i have to change manually . and here i need a solution to let this with less work .

so something were i can completely difference between the eurusd strategies with the usdjpy and so on.

8 (edited by hannahis 2020-09-30 14:45:26)

Re: Portfolio code Change for more than 100 strategies

I see...not sure whether all these efforts are worth it, just to put all strategies into 1 PE simply for the sake of easy selection.

Since I don't have coding skill (still learning basic MQL), I would simply put 5 PE into a folder and put them into the Expert folder of the MT4.  If I want EURUSD, I'll just install the EURUSD PE. 

Nevertheless, since you have the coding skill, maybe you think it's worth it smile

Hope you find a fast and easy solution and if you do have, kindly share here.

Re: Portfolio code Change for more than 100 strategies

i have tried this..implement 5 strategies of usdjpy

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SetSignals(Signal &signalList[])
  {
   int i=0;
   ArrayResize(signalList,2*strategiesCount);
   HideTestIndicators(true);

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":13,"takeProfit":30,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RVI Signal","listIndexes":[1,0,0,0,0],"numValues":[32,0,0,0,0,0]},{"name":"Stochastic","listIndexes":[1,0,0,0,0],"numValues":[20,13,10,20,0,0]},{"name":"Envelopes","listIndexes":[2,3,0,0,0],"numValues":[40,0.32,0,0,0,0]}],"closeFilters":[{"name":"DeMarker","listIndexes":[3,0,0,0,0],"numValues":[12,0.13,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_00();
   signalList[i++] = GetEntrySignal_00();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":24,"takeProfit":40,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Envelopes","listIndexes":[4,3,0,0,0],"numValues":[21,0.85,0,0,0,0]}],"closeFilters":[{"name":"Force Index","listIndexes":[1,0,0,0,0],"numValues":[32,0,0,0,0,0]},{"name":"Williams' Percent Range","listIndexes":[7,0,0,0,0],"numValues":[44,-20,0,0,0,0]},{"name":"Alligator","listIndexes":[1,3,4,0,0],"numValues":[24,23,23,11,11,3]},{"name":"Williams' Percent Range","listIndexes":[0,0,0,0,0],"numValues":[11,-20,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_01();
   signalList[i++] = GetEntrySignal_01();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":12,"takeProfit":21,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"RSI","listIndexes":[4,3,0,0,0],"numValues":[42,47,0,0,0,0]},{"name":"Bollinger Bands","listIndexes":[5,3,0,0,0],"numValues":[37,3.05,0,0,0,0]}],"closeFilters":[{"name":"Moving Average","listIndexes":[1,0,3,0,0],"numValues":[35,0,0,0,0,0]},{"name":"DeMarker","listIndexes":[6,0,0,0,0],"numValues":[48,0,0,0,0,0]},{"name":"RVI Signal","listIndexes":[2,0,0,0,0],"numValues":[18,0,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_02();
   signalList[i++] = GetEntrySignal_02();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":23,"takeProfit":21,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Money Flow Index","listIndexes":[4,0,0,0,0],"numValues":[21,20,0,0,0,0]},{"name":"RVI","listIndexes":[0,0,0,0,0],"numValues":[23,0,0,0,0,0]},{"name":"Money Flow Index","listIndexes":[1,0,0,0,0],"numValues":[14,20,0,0,0,0]}],"closeFilters":[{"name":"Envelopes","listIndexes":[2,3,0,0,0],"numValues":[23,0.66,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_03();
   signalList[i++] = GetEntrySignal_03();

   /*STRATEGY CODE {"properties":{"entryLots":1,"stopLoss":14,"takeProfit":26,"useStopLoss":true,"useTakeProfit":true,"isTrailingStop":false},"openFilters":[{"name":"Awesome Oscillator","listIndexes":[4,0,0,0,0],"numValues":[0,0,0,0,0,0]},{"name":"Awesome Oscillator","listIndexes":[6,0,0,0,0],"numValues":[0,0,0,0,0,0]}],"closeFilters":[{"name":"Accelerator Oscillator","listIndexes":[3,0,0,0,0],"numValues":[0,0,0,0,0,0]}]} */
   signalList[i++] = GetExitSignal_04();
   signalList[i++] = GetEntrySignal_04();

   HideTestIndicators(false);
   if(i!=2*strategiesCount)
      ArrayResize(signalList,i);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
if(Pair==EURUSD)
Signal GetEntrySignal_00()
  {
   double ind0val1 = iRVI(NULL,0,32,MODE_MAIN,1) - iRVI(NULL,0,32,MODE_SIGNAL,1);
   double ind0val2 = iRVI(NULL,0,32,MODE_MAIN,2) - iRVI(NULL,0,32,MODE_SIGNAL,2);
   bool ind0long  = ind0val1 < 0 - sigma && ind0val2 > 0 + sigma;
   bool ind0short = ind0val1 > 0 + sigma && ind0val2 < 0 - sigma;
   double ind1val1 = iStochastic(NULL,0,20,13,10,MODE_SMA,STO_LOWHIGH,MODE_MAIN,1);
   double ind1val2 = iStochastic(NULL,0,20,13,10,MODE_SMA,STO_LOWHIGH,MODE_MAIN,2);
   bool ind1long  = ind1val1 < ind1val2 - sigma;
   bool ind1short = ind1val1 > ind1val2 + sigma;
   double ind2upBand1 = iEnvelopes(NULL,0,40,MODE_SMA,0,PRICE_CLOSE,0.32,MODE_UPPER,1);
   double ind2dnBand1 = iEnvelopes(NULL,0,40,MODE_SMA,0,PRICE_CLOSE,0.32,MODE_LOWER,1);
   double ind2upBand2 = iEnvelopes(NULL,0,40,MODE_SMA,0,PRICE_CLOSE,0.32,MODE_UPPER,2);
   double ind2dnBand2 = iEnvelopes(NULL,0,40,MODE_SMA,0,PRICE_CLOSE,0.32,MODE_LOWER,2);
   bool ind2long  = Open(0) < ind2upBand1 - sigma && Open(1) > ind2upBand2 + sigma;
   bool ind2short = Open(0) > ind2dnBand1 + sigma && Open(1) < ind2dnBand2 - sigma;

   Signal signal = CreateEntrySignal(0, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 13, 30, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_00()
  {
   double ind3val1 = iDeMarker(NULL,0,12,1);
   bool ind3long  = ind3val1 < 0.13 - sigma;
   bool ind3short = ind3val1 > 1 - 0.13 + sigma;

   Signal signal = CreateExitSignal(0, ind3long, ind3short, 13, 30, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_01()
  {
   double ind0upBand1 = iEnvelopes(NULL,0,21,MODE_SMA,0,PRICE_CLOSE,0.85,MODE_UPPER,1);
   double ind0dnBand1 = iEnvelopes(NULL,0,21,MODE_SMA,0,PRICE_CLOSE,0.85,MODE_LOWER,1);
   double ind0upBand2 = iEnvelopes(NULL,0,21,MODE_SMA,0,PRICE_CLOSE,0.85,MODE_UPPER,2);
   double ind0dnBand2 = iEnvelopes(NULL,0,21,MODE_SMA,0,PRICE_CLOSE,0.85,MODE_LOWER,2);
   bool ind0long  = Open(0) < ind0dnBand1 - sigma && Open(1) > ind0dnBand2 + sigma;
   bool ind0short = Open(0) > ind0upBand1 + sigma && Open(1) < ind0upBand2 - sigma;

   Signal signal = CreateEntrySignal(1, ind0long, ind0short, 24, 40, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_01()
  {
   double ind1val1 = iForce(NULL,0,32,MODE_SMA,PRICE_CLOSE,1);
   double ind1val2 = iForce(NULL,0,32,MODE_SMA,PRICE_CLOSE,2);
   bool ind1long  = ind1val1 < ind1val2 - sigma;
   bool ind1short = ind1val1 > ind1val2 + sigma;
   double ind2val1 = iWPR(NULL,0,44,1);
   double ind2val2 = iWPR(NULL,0,44,2);
   double ind2val3 = iWPR(NULL,0,44,3);
   bool ind2long  = ind2val1 < ind2val2 - sigma && ind2val2 > ind2val3 + sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma && ind2val2 < ind2val3 - sigma;
   double ind3val1 = iAlligator(NULL,0,24,23,23,11,11,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORLIPS,1);
   double ind3val2 = iAlligator(NULL,0,24,23,23,11,11,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORLIPS,2);
   bool ind3long  = ind3val1 < ind3val2 - sigma;
   bool ind3short = ind3val1 > ind3val2 + sigma;
   double ind4val1 = iWPR(NULL,0,11,1);
   double ind4val2 = iWPR(NULL,0,11,2);
   bool ind4long  = ind4val1 > ind4val2 + sigma;
   bool ind4short = ind4val1 < ind4val2 - sigma;

   Signal signal = CreateExitSignal(1, true, true, 24, 40, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_02()
  {
   double ind0val1 = iRSI(NULL,0,42,PRICE_CLOSE,1);
   double ind0val2 = iRSI(NULL,0,42,PRICE_CLOSE,2);
   bool ind0long  = ind0val1 > 47 + sigma && ind0val2 < 47 - sigma;
   bool ind0short = ind0val1 < 100 - 47 - sigma && ind0val2 > 100 - 47 + sigma;
   double ind1upBand1 = iBands(NULL,0,37,3.05,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind1dnBand1 = iBands(NULL,0,37,3.05,0,PRICE_CLOSE,MODE_LOWER,1);
   double ind1upBand2 = iBands(NULL,0,37,3.05,0,PRICE_CLOSE,MODE_UPPER,2);
   double ind1dnBand2 = iBands(NULL,0,37,3.05,0,PRICE_CLOSE,MODE_LOWER,2);
   bool ind1long  = Open(0) > ind1dnBand1 + sigma && Open(1) < ind1dnBand2 - sigma;
   bool ind1short = Open(0) < ind1upBand1 - sigma && Open(1) > ind1upBand2 + sigma;

   Signal signal = CreateEntrySignal(2, ind0long && ind1long, ind0short && ind1short, 12, 21, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_02()
  {
   double ind2val1 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val2 = iMA(NULL,0,35,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma;
   double ind3val1 = iDeMarker(NULL,0,48,1);
   double ind3val2 = iDeMarker(NULL,0,48,2);
   double ind3val3 = iDeMarker(NULL,0,48,3);
   bool ind3long  = ind3val1 > ind3val2 + sigma && ind3val2 < ind3val3 - sigma;
   bool ind3short = ind3val1 < ind3val2 - sigma && ind3val2 > ind3val3 + sigma;
   double ind4val1 = iRVI(NULL,0,18,MODE_MAIN,1) - iRVI(NULL,0,18,MODE_SIGNAL,1);
   bool ind4long  = ind4val1 > 0 + sigma;
   bool ind4short = ind4val1 < 0 - sigma;

   Signal signal = CreateExitSignal(2, true, true, 12, 21, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_03()
  {
   double ind0val1 = iMFI(NULL,0,21,1);
   double ind0val2 = iMFI(NULL,0,21,2);
   bool ind0long  = ind0val1 > 20 + sigma && ind0val2 < 20 - sigma;
   bool ind0short = ind0val1 < 100 - 20 - sigma && ind0val2 > 100 - 20 + sigma;
   double ind1val1 = iRVI(NULL,0,23,MODE_MAIN,1);
   double ind1val2 = iRVI(NULL,0,23,MODE_MAIN,2);
   bool ind1long  = ind1val1 > ind1val2 + sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma;
   double ind2val1 = iMFI(NULL,0,14,1);
   double ind2val2 = iMFI(NULL,0,14,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma;

   Signal signal = CreateEntrySignal(3, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 23, 21, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_03()
  {
   double ind3upBand1 = iEnvelopes(NULL,0,23,MODE_SMA,0,PRICE_CLOSE,0.66,MODE_UPPER,1);
   double ind3dnBand1 = iEnvelopes(NULL,0,23,MODE_SMA,0,PRICE_CLOSE,0.66,MODE_LOWER,1);
   double ind3upBand2 = iEnvelopes(NULL,0,23,MODE_SMA,0,PRICE_CLOSE,0.66,MODE_UPPER,2);
   double ind3dnBand2 = iEnvelopes(NULL,0,23,MODE_SMA,0,PRICE_CLOSE,0.66,MODE_LOWER,2);
   bool ind3long  = Open(0) < ind3upBand1 - sigma && Open(1) > ind3upBand2 + sigma;
   bool ind3short = Open(0) > ind3dnBand1 + sigma && Open(1) < ind3dnBand2 - sigma;

   Signal signal = CreateExitSignal(3, ind3long, ind3short, 23, 21, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_04()
  {
   double ind0val1 = iAO(NULL,0,1);
   double ind0val2 = iAO(NULL,0,2);
   bool ind0long  = ind0val1 > 0.0000 + sigma && ind0val2 < 0.0000 - sigma;
   bool ind0short = ind0val1 < -1*0.0000 - sigma && ind0val2 > -1*0.0000 + sigma;
   double ind1val1 = iAO(NULL,0,1);
   double ind1val2 = iAO(NULL,0,2);
   double ind1val3 = iAO(NULL,0,3);
   bool ind1long  = ind1val1 > ind1val2 + sigma && ind1val2 < ind1val3 - sigma;
   bool ind1short = ind1val1 < ind1val2 - sigma && ind1val2 > ind1val3 + sigma;

   Signal signal = CreateEntrySignal(4, ind0long && ind1long, ind0short && ind1short, 14, 26, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_04()
  {
   double ind2val1 = iAC(NULL,0,1);
   bool ind2long  = ind2val1 < 0.0000 - sigma;
   bool ind2short = ind2val1 > -1*0.0000 + sigma;

   Signal signal = CreateExitSignal(4, ind2long, ind2short, 14, 26, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
if(Pair==USDJPY)
Signal GetEntrySignal_00()
  {
   double ind0val1 = iMA(NULL,0,18,0,MODE_SMA,PRICE_CLOSE,1);
   double ind0val2 = iMA(NULL,0,25,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind0long  = ind0val1 < ind0val2 - sigma;
   bool ind0short = ind0val1 > ind0val2 + sigma;
   double ind1val1 = iStochastic(NULL,0,16,4,3,MODE_SMA,STO_LOWHIGH,MODE_MAIN,1);
   double ind1val2 = iStochastic(NULL,0,16,4,3,MODE_SMA,STO_LOWHIGH,MODE_MAIN,2);
   bool ind1long  = ind1val1 > 14 + sigma && ind1val2 < 14 - sigma;
   bool ind1short = ind1val1 < 100 - 14 - sigma && ind1val2 > 100 - 14 + sigma;
   double ind2val1 = iMA(NULL,0,19,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val2 = iMA(NULL,0,49,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val3 = iMA(NULL,0,19,0,MODE_SMA,PRICE_CLOSE,2);
   double ind2val4 = iMA(NULL,0,49,0,MODE_SMA,PRICE_CLOSE,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma && ind2val3 > ind2val4 + sigma;
   bool ind2short = ind2val1 > ind2val2 + sigma && ind2val3 < ind2val4 - sigma;

   Signal signal = CreateEntrySignal(0, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 12, 29, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_00()
  {
   double ind3val1 = iMA(NULL,0,25,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind3long  = Open(0) > ind3val1 + sigma;
   bool ind3short = Open(0) < ind3val1 - sigma;

   Signal signal = CreateExitSignal(0, ind3long, ind3short, 12, 29, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_01()
  {
   double ind0val1 = iADX(NULL,0,30,PRICE_CLOSE,0,1);
   double ind0val2 = iADX(NULL,0,30,PRICE_CLOSE,0,2);
   double ind0val3 = iADX(NULL,0,30,PRICE_CLOSE,0,3);
   bool ind0long  = ind0val1 > ind0val2 + sigma && ind0val2 < ind0val3 - sigma;
   bool ind0short = ind0long;
   double ind1val1 = iStdDev(NULL,0,41,0,MODE_SMA,PRICE_CLOSE,1);
   double ind1val2 = iStdDev(NULL,0,41,0,MODE_SMA,PRICE_CLOSE,2);
   double ind1val3 = iStdDev(NULL,0,41,0,MODE_SMA,PRICE_CLOSE,3);
   bool ind1long  = ind1val1 < ind1val2 - sigma && ind1val2 > ind1val3 + sigma;
   bool ind1short = ind1long;
   double ind2val1 = iADX(NULL,0,5,PRICE_CLOSE,1,1) - iADX(NULL,0,5,PRICE_CLOSE,2,1);
   double ind2val2 = iADX(NULL,0,5,PRICE_CLOSE,1,2) - iADX(NULL,0,5,PRICE_CLOSE,2,2);
   bool ind2long  = ind2val1 < 0 - sigma && ind2val2 > 0 + sigma;
   bool ind2short = ind2val1 > 0 + sigma && ind2val2 < 0 - sigma;
   double ind3val1 = iStochastic(NULL,0,14,6,12,MODE_SMA,STO_LOWHIGH,MODE_MAIN,1);
   double ind3val2 = iStochastic(NULL,0,14,6,12,MODE_SMA,STO_LOWHIGH,MODE_MAIN,2);
   bool ind3long  = ind3val1 > ind3val2 + sigma;
   bool ind3short = ind3val1 < ind3val2 - sigma;

   Signal signal = CreateEntrySignal(1, ind0long && ind1long && ind2long && ind3long, ind0short && ind1short && ind2short && ind3short, 24, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_01()
  {
   double ind4val1 = iDeMarker(NULL,0,13,1);
   double ind4val2 = iDeMarker(NULL,0,13,2);
   bool ind4long  = ind4val1 < 0.71 - sigma && ind4val2 > 0.71 + sigma;
   bool ind4short = ind4val1 > 1 - 0.71 + sigma && ind4val2 < 1 - 0.71 - sigma;

   Signal signal = CreateExitSignal(1, ind4long, ind4short, 24, 13, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_02()
  {
   double ind0upBand1 = iEnvelopes(NULL,0,20,MODE_SMA,0,PRICE_CLOSE,0.43,MODE_UPPER,1);
   double ind0dnBand1 = iEnvelopes(NULL,0,20,MODE_SMA,0,PRICE_CLOSE,0.43,MODE_LOWER,1);
   double ind0upBand2 = iEnvelopes(NULL,0,20,MODE_SMA,0,PRICE_CLOSE,0.43,MODE_UPPER,2);
   double ind0dnBand2 = iEnvelopes(NULL,0,20,MODE_SMA,0,PRICE_CLOSE,0.43,MODE_LOWER,2);
   bool ind0long  = Open(0) < ind0upBand1 - sigma && Open(1) > ind0upBand2 + sigma;
   bool ind0short = Open(0) > ind0dnBand1 + sigma && Open(1) < ind0dnBand2 - sigma;
   double ind1val1 = (double) iVolume(NULL,0,1);
   double ind1val2 = (double) iVolume(NULL,0,2);
   double ind1val3 = (double) iVolume(NULL,0,3);
   bool ind1long  = ind1val1 < ind1val2 - sigma && ind1val2 > ind1val3 + sigma;
   bool ind1short = ind1long;

   Signal signal = CreateEntrySignal(2, ind0long && ind1long, ind0short && ind1short, 19, 11, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_02()
  {
   double ind2val1 = iRVI(NULL,0,36,MODE_MAIN,1) - iRVI(NULL,0,36,MODE_SIGNAL,1);
   double ind2val2 = iRVI(NULL,0,36,MODE_MAIN,2) - iRVI(NULL,0,36,MODE_SIGNAL,2);
   bool ind2long  = ind2val1 < 0 - sigma && ind2val2 > 0 + sigma;
   bool ind2short = ind2val1 > 0 + sigma && ind2val2 < 0 - sigma;
   double ind3val1 = iRVI(NULL,0,48,MODE_MAIN,1);
   double ind3val2 = iRVI(NULL,0,48,MODE_MAIN,2);
   double ind3val3 = iRVI(NULL,0,48,MODE_MAIN,3);
   bool ind3long  = ind3val1 > ind3val2 + sigma && ind3val2 < ind3val3 - sigma;
   bool ind3short = ind3val1 < ind3val2 - sigma && ind3val2 > ind3val3 + sigma;
   double ind4val1 = (double) iVolume(NULL,0,1);
   double ind4val2 = (double) iVolume(NULL,0,2);
   double ind4val3 = (double) iVolume(NULL,0,3);
   bool ind4long  = ind4val1 < ind4val2 - sigma && ind4val2 > ind4val3 + sigma;
   bool ind4short = ind4long;
   double ind5val1 = iMFI(NULL,0,29,1);
   double ind5val2 = iMFI(NULL,0,29,2);
   double ind5val3 = iMFI(NULL,0,29,3);
   bool ind5long  = ind5val1 > ind5val2 + sigma && ind5val2 < ind5val3 - sigma;
   bool ind5short = ind5val1 < ind5val2 - sigma && ind5val2 > ind5val3 + sigma;

   Signal signal = CreateExitSignal(2, true, true, 19, 11, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_03()
  {
   double ind0upBand1 = iBands(NULL,0,18,1.33,0,PRICE_CLOSE,MODE_UPPER,1);
   double ind0dnBand1 = iBands(NULL,0,18,1.33,0,PRICE_CLOSE,MODE_LOWER,1);
   double ind0upBand2 = iBands(NULL,0,18,1.33,0,PRICE_CLOSE,MODE_UPPER,2);
   double ind0dnBand2 = iBands(NULL,0,18,1.33,0,PRICE_CLOSE,MODE_LOWER,2);
   bool ind0long  = Open(0) > ind0upBand1 + sigma && Open(1) < ind0upBand2 - sigma;
   bool ind0short = Open(0) < ind0dnBand1 - sigma && Open(1) > ind0dnBand2 + sigma;
   double ind1val1 = iRVI(NULL,0,7,MODE_MAIN,1);
   double ind1val2 = iRVI(NULL,0,7,MODE_MAIN,2);
   bool ind1long  = ind1val1 > 0.00 + sigma && ind1val2 < 0.00 - sigma;
   bool ind1short = ind1val1 < -1*0.00 - sigma && ind1val2 > -1*0.00 + sigma;
   double ind2val1 = iMA(NULL,0,38,0,MODE_SMA,PRICE_CLOSE,1);
   double ind2val2 = iMA(NULL,0,38,0,MODE_SMA,PRICE_CLOSE,2);
   double ind2val3 = iMA(NULL,0,38,0,MODE_SMA,PRICE_CLOSE,3);
   bool ind2long  = ind2val1 > ind2val2 + sigma && ind2val2 < ind2val3 - sigma;
   bool ind2short = ind2val1 < ind2val2 - sigma && ind2val2 > ind2val3 + sigma;

   Signal signal = CreateEntrySignal(3, ind0long && ind1long && ind2long, ind0short && ind1short && ind2short, 11, 42, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_03()
  {
   double ind3upBand1 = iEnvelopes(NULL,0,24,MODE_SMA,0,PRICE_CLOSE,0.10,MODE_UPPER,1);
   double ind3dnBand1 = iEnvelopes(NULL,0,24,MODE_SMA,0,PRICE_CLOSE,0.10,MODE_LOWER,1);
   double ind3upBand2 = iEnvelopes(NULL,0,24,MODE_SMA,0,PRICE_CLOSE,0.10,MODE_UPPER,2);
   double ind3dnBand2 = iEnvelopes(NULL,0,24,MODE_SMA,0,PRICE_CLOSE,0.10,MODE_LOWER,2);
   bool ind3long  = Open(0) < ind3dnBand1 - sigma && Open(1) > ind3dnBand2 + sigma;
   bool ind3short = Open(0) > ind3upBand1 + sigma && Open(1) < ind3upBand2 - sigma;
   double ind4val1 = iMA(NULL,0,14,0,MODE_SMA,PRICE_CLOSE,1);
   double ind4val2 = iMA(NULL,0,31,0,MODE_SMA,PRICE_CLOSE,1);
   bool ind4long  = ind4val1 < ind4val2 - sigma;
   bool ind4short = ind4val1 > ind4val2 + sigma;
   double ind5val1 = iRVI(NULL,0,6,MODE_MAIN,1);
   double ind5val2 = iRVI(NULL,0,6,MODE_MAIN,2);
   bool ind5long  = ind5val1 > 0.00 + sigma && ind5val2 < 0.00 - sigma;
   bool ind5short = ind5val1 < -1*0.00 - sigma && ind5val2 > -1*0.00 + sigma;
   double ind6val1 = iADX(NULL,0,5,PRICE_CLOSE,1,1) - iADX(NULL,0,5,PRICE_CLOSE,2,1);
   bool ind6long  = ind6val1 > 0 + sigma;
   bool ind6short = ind6val1 < 0 - sigma;

   Signal signal = CreateExitSignal(3, true, true, 11, 42, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetEntrySignal_04()
  {
   double ind0val1 = iMFI(NULL,0,22,1);
   double ind0val2 = iMFI(NULL,0,22,2);
   bool ind0long  = ind0val1 < 18 - sigma && ind0val2 > 18 + sigma;
   bool ind0short = ind0val1 > 100 - 18 + sigma && ind0val2 < 100 - 18 - sigma;
   double ind1val1 = iDeMarker(NULL,0,27,1);
   double ind1val2 = iDeMarker(NULL,0,27,2);
   bool ind1long  = ind1val1 < 0.33 - sigma && ind1val2 > 0.33 + sigma;
   bool ind1short = ind1val1 > 1 - 0.33 + sigma && ind1val2 < 1 - 0.33 - sigma;

   Signal signal = CreateEntrySignal(4, ind0long && ind1long, ind0short && ind1short, 16, 18, false);
   return (signal);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
Signal GetExitSignal_04()
  {
   double ind2val1 = iATR(NULL,0,14,1);
   double ind2val2 = iATR(NULL,0,14,2);
   bool ind2long  = ind2val1 < ind2val2 - sigma;
   bool ind2short = ind2long;
   double ind3val1 = iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,1);
   double ind3val2 = iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,2);
   double ind3val3 = iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,3);
   bool ind3long  = ind3val1 > ind3val2 + sigma && ind3val2 < ind3val3 - sigma;
   bool ind3short = ind3val1 < ind3val2 - sigma && ind3val2 > ind3val3 + sigma;
   double ind4val1 = iAC(NULL,0,1);
   double ind4val2 = iAC(NULL,0,2);
   bool ind4long  = ind4val1 < ind4val2 - sigma;
   bool ind4short = ind4val1 > ind4val2 + sigma;

   Signal signal = CreateExitSignal(4, true, true, 16, 18, false);
   return (signal);
  } 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+    

but not working. i need an option to have between different "Signal GetEntrySignal" and "Signal GetExitSignal" ..

so easy copy from another portfolio into another one..but without changing the GetEntrySignal_XX number.

Or did i have put an if statement before portfolio start and use the other Signal List?

Re: Portfolio code Change for more than 100 strategies

I honestly don't see how much value added your idea would be.

The only benefit I can think of is only having to install 1 EA and from it choose which pairs to trade.  But to go through all the trouble to re-code etc just for that function...doesn't seem to make much sense to me.

The same effort I click to choose the symbol, might as well just click the individual symbol EA/PE to install onto the Chart.

In addition, the main problem is (at least for me), I constantly change my EA/PE, constantly add in new ones and delete bad ones and so I can't imagine the trouble I have to go through with all the coding every time I change (add or delete) EA.

Since you are the one with the coding skill, probably you don't think it's any trouble to you at all.  smile

Anyway, I hope you will ultimately find the best solution, not only in terms of execution but in terms of efficiency use of time/efforts.

Posts: 10

Pages 1

You must login or register to post a reply

Forex Software → Portfolio Expert → Portfolio code Change for more than 100 strategies

Similar topics in this forum