“put values to parameters” doesn’t work correctly
3 replies
murty
7 years ago #116365
If I select “put values to parameters” for the following, It will never replace 12 with any variable. It even creates a useless parameter called pConsty_1 = 2 that is not needed/used anywhere:
Original code:
— Long entry
if LongEntryCondition is true {
if No position is open then Buy at SMA(21) + (-0.8 * ABS(High(12) – SMA(93))) Stop;
Stop/Limit order expires after 28 bars.
Stop Loss = (2.09 * ATR(91)) pips;
Profit Target = 105 pips;
}
Code with parameters:
====================================================================
== Strategy Parameters
====================================================================
pConsty_1 = 2;
pSMA_2 = 21;
pSMA_4 = 93;
ProfitTargetPips = 105;
StopLossCoef = 2.09;
StopLossATR = 91;
LongStopOrderCoef = -0.8;
ShortStopOrderCoef = 0.8;
OrderBarsValid = 28;
====================================================================
== Entry conditions
====================================================================
LongEntryCondition = (Day of week = Monday)
ShortEntryCondition = (Day of week = Monday)
====================================================================
== Entry orders
====================================================================
— Long entry
if LongEntryCondition is true {
if No position is open then Buy at SMA(pSMA_2) + (LongStopOrderCoef * ABS(High(12) – SMA(pSMA_4))) Stop;
Stop/Limit order expires after OrderBarsValid bars.
Stop Loss = (StopLossCoef * ATR(StopLossATR)) pips;
Profit Target = ProfitTargetPips pips;
}
— Short entry
if ShortEntryCondition is true {
if No position is open then Sell at SMA(pSMA_2) + (ShortStopOrderCoef * ABS(Low(12) – SMA(pSMA_4))) Stop;
Stop/Limit order expires after OrderBarsValid bars.
Stop Loss = (StopLossCoef * ATR(StopLossATR)) pips;
Profit Target = ProfitTargetPips pips;
}
tomas262
7 years ago #141667
Hello,
some values are fixed values set by strategy builder. These will not be included among strategy parameters for optimization
murty
7 years ago #141703
In my example, why is period fixed at 12 bars in Low(12) and High(12) ?
Mark Fric
7 years ago #141754
sorry about this, it is most likely a bug, but we will fix in in the new major version 4, we are reworking the whole variables replacement part
Mark
StrategyQuant architect
Viewing 3 replies - 1 through 3 (of 3 total)