Invalid operations for floating-point operations in Multicharts

As yo you can see in attachment, This strategy can be complied, but once test this strategy,     hint:  Invalid operations for floating-point operations.

If I am in a hurry to use the code in this strategy, how should I work around it?

Attachments
Strategy 33174-SLCoef-Long.sqx
(36.50 KiB)
  • Votes +2
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

binhsir

19.06.2023 12:44

Task created

b
#2

binhsir

19.06.2023 12:44
Voted for this task.
E
#3

Emmanuel

21.06.2023 01:19
Voted for this task.
MF
#4

Mark Fric

22.06.2023 10:20

Status changed from New to Fixed

it seems the problem is in SQ_VWAP function, it divides by zero ifthere is zero volume.

You can fix it by replacing the line:


__vvap=__ohlcvTotal/__volumeTotal



with:


if __volumeTotal = 0 then __volumeTotal= 1 ; if VWAPPeriod<4 then __vvap =AvgPrice else __vvap=__ohlcvTotal/__volumeTotal;



We already have this fix in TS code, I'll update the attachment in codebase.


b
#5

binhsir

22.06.2023 11:06
Thanks, i forgot to check the function in Intpricelevel variable

Votes: +2

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please