In
another thread*, you said
NFA and Virtual Hedging are trade execution modes, so they have no effect on training.
If this is true, then how can the output of the following two Strategies be different? The only difference is
In Strategy1, the NFA flag is set only in Test mode
In Strategy2, the NFA flag is set in both Train and Test mode.
string selected_asset;
function run() {
BarPeriod = 348;
LookBack = 279;
StartDate = 20131020;
EndDate = 20140420;
set(RULES + TESTNOW + MUTE);
if (Train) {
Hedge = 2;
} else {
set(NFA);
Hedge = 4;
}
TradesPerBar = 2;
ExitTime = 4;
NumWFOCycles = 3;
while(selected_asset = loop("CAD/JPY", "CHF/JPY")) {
asset(selected_asset);
var atrx = ATR(238);
TakeProfit = 3 * atrx;
Stop = 2 * atrx;
vars Price = series(price());
var v00 = StdDev(Price, 174);
if (adviseLong(PERCEPTRON, 0, v00) > 0) {
enterLong();
}
if (adviseShort(PERCEPTRON, 0, v00) > 0) {
enterShort();
}
}
}
(-7218p)
string selected_asset;
function run() {
BarPeriod = 348;
LookBack = 279;
StartDate = 20131020;
EndDate = 20140420;
set(RULES + TESTNOW + MUTE);
set(NFA);
if (Train) {
Hedge = 2;
} else {
Hedge = 4;
}
TradesPerBar = 2;
ExitTime = 4;
NumWFOCycles = 3;
while(selected_asset = loop("CAD/JPY", "CHF/JPY")) {
asset(selected_asset);
var atrx = ATR(238);
TakeProfit = 3 * atrx;
Stop = 2 * atrx;
vars Price = series(price());
var v00 = StdDev(Price, 174);
if (adviseLong(PERCEPTRON, 0, v00) > 0) {
enterLong();
}
if (adviseShort(PERCEPTRON, 0, v00) > 0) {
enterShort();
}
}
}
(-8651p)
If NFA flag has no effect on training, how can the outcomes be different?
*
Different Result depending on Order of adviseLong / adviceShort