[B126] SQ uses hard coded values instead variables

SQ creates strategies like this regularly:


//--------------------------------------------------------------------
// Pseudo Source Code of Strategy 1.1.879
//
// Generated by StrategyQuant X Build 126 for MetaTrader
// at 04/02/2020 02:30
//--------------------------------------------------------------------

//--------------------------------------------------------------------
// Strategy Parameters
//--------------------------------------------------------------------
int MagicNumber = 11111;
int EMAPeriod = 20;
int OSMAChangesSignalPrd = 9;
int OSMAChangesFastEMA = 234;
int OSMAChangesSlowEMA = 352;
double PriceEntryMult = 2.5;
int BarsValid = 37;
int MoveSL2BE = 43;
double SL2BEAddPipsCoef = 20.4;
int ProfitTarget = 55;
int StopLoss = 25;
int TrailingStop = 64;
int TrailingActivation = 183;
int ATRPeriod = 40;

Main chart = Current Symbol / Current TF;

//--------------------------------------------------------------------
// Trading rule: Trading signals (On Bar Open)
//--------------------------------------------------------------------
LongEntrySignal = (EMA(Main chart,EMAPeriod, PRICE_CLOSE)[1] <= High(Main chart)[1]);

ShortEntrySignal = (EMA(Main chart,EMAPeriod, PRICE_CLOSE)[1] >= Low(Main chart)[1]);

LongExitSignal = (OSMA(Main chart,234, 352, OSMAChangesSignalPrd)[1] changes direction upwards);

ShortExitSignal = (OSMA(Main chart,OSMAChangesFastEMA, OSMAChangesSlowEMA, OSMAChangesSignalPrd)[1] changes direction downwards);


As can be seen, the "LongExitSignal" uses hard-coded numbers instead of the correct variables like in "ShortExitSignal". This is also the same in the MQ4 / MQ5 code, not just the pseudo-code.
Attachments
No attachments
  • Votes +5
  • Project StrategyQuant X
  • Type Bug
  • Status Duplicate
  • Priority Normal
  • Assignee Mark Fric
  • Milestone Build 127

History

g
#1

geektrader

02.04.2020 04:43

Task created

g
#2

geektrader

02.04.2020 04:43
Voted for this task.
t
#3

tnickel

02.04.2020 10:24
Voted for this task.
m
#4

Mariano

02.04.2020 10:38
Voted for this task.
e
#5

eastpeace

04.04.2020 05:44
Voted for this task.
e
#6

eastpeace

04.04.2020 05:45

That also happened with Multicharts backtest engine.


https://roadmap.strategyquant.com/tasks/sq4_5927

b
#7

beppil

10.04.2020 03:53
Voted for this task.
MF
#8

Mark Fric

16.04.2020 08:42

Assignee changed from Mark Fric to Mark Fric

Milestone changed from None to Build 127

MF
#9

Mark Fric

16.04.2020 13:09

Status changed from New to Duplicate

duplicate of: https://roadmap.strategyquant.com/tasks/sq4_5927

Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please