[SQ 136Final] MA indicator lookback error when generate souce code for Powerlange

1. I developed a strategy on sq and made a further backtest on MC, and found that the two were quite different. After a transaction-by-transaction comparison.I found that the problem was with the moving average indicator.Please see the attachment.This strategy uses a custom block: MA[1]*0.99<close[1]<MA[1]*1.01,But when sq generates the Powerlanguage code, it becomes MA[2]*0.99<close[1]<MA[2]*1.01. After comparing with MC's backtest, I think SQ's engine is still in accordance with  MA[1]*0.99<close[1]<MA[1]*1.01.,only generate fault souce code.

2. In addition, I don't know the difference between MA indicator and SMA indicator in sq. It seems that there is no difference in notes. The only difference is that the lookback of MA indicator in the code is not correct.

Attachments
MASMA.jpg
(121.37 KiB)
StatOasis Close near 1 of MA.jpg
(114.70 KiB)
Powerlanguage.jpg
(382.22 KiB)
custom block.jpg
(670.28 KiB)
MA code.jpg
(119.58 KiB)
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority High

History

b
#1

binhsir

29.12.2022 08:13

Task created

h
#2

hruyak41287

31.12.2022 03:37
Voted for this task.
b
#3

binhsir

03.01.2023 07:44
Voted for this task.
TM
#4

tmatejka.

06.01.2023 12:35

Hi there,

we see the issue with the EL code. This can be fixed into next SQ update


As for 2) there is a difference between MA() and SMA() functions .... The MA type is a general moving average function where the type (simple, exponential, ... ) needs to be specifically set. On the other hand SMA is always a simple moving average

E
#5

Emmanuel

15.01.2023 10:09
Voted for this task.
g
#6

Lee Guan Chuan

06.02.2023 05:57

Status changed from New to Fixed


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