Cannot WF Optimize with symmetry

I optimized using WF Matrix in Optimizer the following strategy. Although I checked "Symmetric variables for Long / Short"
it created two variables Number3 (for long) and Number 4(for short) and optimized them with different values :(
I am expecting to see just one variable called Number for both long and short to be optimized in a symmetric fashion.
The pseudo-code itself SHOULD NOT show two variables Number3 (for long) and Number 4(for short).

//--------------------------------------------------------------------
//  Strategy Parameters
//--------------------------------------------------------------------
int MagicNumber = 12345;
bool ReplaceExistingOrders = true;
double Number2 = 0;
int CCIPeriod = 93;
int CCIShift = 1;
double Number3 = 251;
int ExitAfterBars = 0;
int ProfitTarget = 111;
int StopLoss = 69;
double Number4 = -251;
Main chart = Current Symbol / Current TF;

//--------------------------------------------------------------------
// Trading rule: Long Entry (On Bar Open)
//--------------------------------------------------------------------                  
if (No Trade Recently Closed
   and ((Number of MarketPosition("Current", MagicNumber, 0, "") = Number2)
   and (CCI(Main chart,CCIPeriod)[CCIShift] crosses above Number3)))
{
    // Action #1
    Open Long order at Market;
        Duplicate trades: disabled;
        Stop Loss = StopLoss pips;
        Profit target = ProfitTarget pips;
        Exit After ExitAfterBars bars;
}

//--------------------------------------------------------------------
// Trading rule: Short Entry (On Bar Open)
//--------------------------------------------------------------------                  
if (No Trade Recently Closed
   and ((Number of MarketPosition("Current", MagicNumber, 0, "") = Number2)
   and (CCI(Main chart,CCIPeriod)[CCIShift] crosses below Number4)))
{
    // Action #1
    Open Short order at Market;
        Duplicate trades: disabled;
        Stop Loss = StopLoss pips;
        Profit target = ProfitTarget pips;
        Exit After ExitAfterBars bars;
}

//--------------------------------------------------------------------
// Trading rule: Long Exit (On Bar Open)
//--------------------------------------------------------------------                  
if ((MarketPosition("Current", MagicNumber, "") is Long)){}

//--------------------------------------------------------------------
// Trading rule: Short Exit (On Bar Open)
//--------------------------------------------------------------------                  
if ((MarketPosition("Current", MagicNumber, "") is Short)){}
Attachments
No attachments
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Refused
  • Priority Normal

History

m
#1

murty

22.06.2019 18:33

Task created

m
#2

murty

22.06.2019 18:33
Voted for this task.
f
#3

felipebr

22.06.2019 19:48
Voted for this task.
b
#4

bentra

20.07.2019 06:00
Voted for this task.
MF
#5

Mark Fric

12.06.2020 11:16

Status changed from New to Refused

it generates two variables because the values in CCi comparisons are not the same. 

By default it negates like this:

Long: CCI crosses above 10

Short: CCI crosses below -10


note 10, -10. CCI is oscillator, it oscillates around 0, hence this negation.


But the solution is simple - if you want to compare it to the same value then open your strategy in AlgoWizard, create a new double variable and use it for both CCI comparisons.


Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please