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)){}