[116] (Partial) FIX for many unsymmetric entry issues

For the last 5 hours I´ve been finally investigating the partially really messy symmetry issues that SQX is having since a while. I had opened several bug reports about the unsymmetric entries I´ve found here:



https://roadmap.strategyquant.com/tasks/sq4_3761
https://roadmap.strategyquant.com/tasks/sq4_3768
https://roadmap.strategyquant.com/tasks/sq4_3769
https://roadmap.strategyquant.com/tasks/sq4_3770


However, as more and more were unsymmetric entries were showing up, I decided to really get to the ground of the issue, which is related to the /user/settings/OppositeBlocks.csv file. I´ve gone through all almost 400 lines several times during the last hours, corrected the errors, sorted the entries to a more logical few (for humans) and did several validation-runs within SQX to verify it now creates the correct, symmetric rules finally.  Apart from the above bug reports, which can now be closed, I´ve found a lot errors (completely missing opposite entries) and misconceptions about what a correct opposite rule really is. For example, there was an entry for "ADXChangesDown;ADXChangesUp", which means that a downward changing ADX is the opposite of a upward changing ADX, which simply is not the case, because ADX, just like for example Momentum, only shows the STRENGTH of the actual trend - you can´t draw conclusions of the trend direction from just the ADX. So it´s showing the same values for a strongly up-moving market, as well as a strongly down-moving market (it´s rising in both cases). So the right usage for that indicator would be "ADXChangesDown;ADXChangesDown", just like you´ve already correctly done it for the ATR or the StdDev, which also is unable to show a direction of the market, just the strength of it´s movement and hence needs to be combined with other indicators to work (SQX will figure this out on it´s own during strategy generation).


There have been a lot more issues in relation to HeikenAshi / Low / High / Daily High / Daily Low, etc, they (and many more) all had incorrect opposite rules. Also BearsPower and BullsPower, which are basically one indicator split into two. So if using BullsPower for the Long Entry, it must be using BearsPower for the short entry. However, almost everything is fixed now in the edited file that I´ve attached and that will hopefully make it into build 117 quickly :-) Still, there are some issues that I can´t overcome, because there seems to be another issue with SQX. Those are:


1) The candle pattern "Doji" is missing it´s counterpart formation "Dragonfly" completely, so right now now Doij is having Doij as it´s opposite rule, which  makes no sense. Dragonfly would be the correct opposite rule, but Dragonfly does not seem to be implemented into SQX yet.


2) Although I´ve added


BearsPower;BullsPower
BullsPower;BearsPower


...into the OppositeBlocks.csv file, SQX still generates strategies like this:


LongEntrySignal = (BullsPower(Main chart,13) crosses 0.0 downwards);


ShortEntrySignal = (BullsPower(Main chart,13) crosses 0 upwards);


Correctly it must use BearsPower for the short entry, not BullsPower too, but it seems to ignore that rule from the OppositeBlocks.csv file for unknown reasons.


3) The Aroon indicator that comes with SQX has 2 oscillating lines, a UP and DOWN line, however, there is no way to configure these in the OppositeBlocks.csv file. I´ve configured Aroon like this right now:


Aroon;Aroon
AroonCrossesAbove;AroonCrossesBelow
AroonCrossesBelow;AroonCrossesAbove
AroonFallFromTop;AroonRiseFromBottom
AroonRiseFromBottom;AroonFallFromTop


However, SQX still generates strategies like this:


LongEntrySignal = Aroon(Main chart,20).Up crosses above Aroon Down);


ShortEntrySignal = Aroon(Main chart,20).Up crosses below Aroon Down);


...while the short entry should instead be: 


ShortEntrySignal = Aroon(Main chart,20).Down crosses below Aroon Up);



However, I see now way how to configure this correctly right now as Aroon in the OppositeBlocks.csv file simply only can be configured like it would be a normal oscillator with just one oscillation line.

Attachments
OppositeBlocks.csv
(11.56 KiB)
  • Votes +16
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

g
#1

geektrader

25.12.2018 05:46

Task created

g
#2

geektrader

25.12.2018 05:46
Voted for this task.
RL
#3

rickliao

25.12.2018 07:28
Voted for this task.
i
#4

Ilya

25.12.2018 09:22
Voted for this task.
p
#5

partizanas

25.12.2018 09:40
Voted for this task.
m
#6

Martin

25.12.2018 14:03
Voted for this task.
r
#7

RNG

25.12.2018 15:04
Voted for this task.
e
#8

eastpeace

25.12.2018 15:17
Voted for this task.
p
#9

Pasquale

25.12.2018 20:32
Voted for this task.
a
#10

AC1962

25.12.2018 23:15
Voted for this task.
j
#11

Jojo

25.12.2018 23:44
I also voting for this task.
t
#12

tnickel

26.12.2018 10:58
Voted for this task.
t
#13

tnickel

26.12.2018 11:05

Hi geektrader,

it is a good work. I hope mark will use this file in the next release.

thomas

a
#14

Ash24FX

26.12.2018 15:08
Voted for this task.
h
#15

hankeys

27.12.2018 10:44
Voted for this task.
h
#16

hankeys

27.12.2018 10:45
very good points, which need to be fixed to keep strategies logic OK
YJ
#17

extreme

28.12.2018 18:42
Voted for this task.
BA
#18

Grandmamoses

30.12.2018 14:13
Voted for this task.
i
#19

Ilya

31.12.2018 12:04
Indeed very basic issues.. Hope for a stable and working version soon
i
#20

Ilya

31.12.2018 12:05
Indeed very basic issues.. Hope for a stable and working version soon
o
#21

Enric

01.01.2019 10:31
Voted for this task.
MF
#22

Mark Fric

03.01.2019 09:09

Status changed from New to In progress

I reconfigured SQX to match your OppositeBlocks.csv file.


I'll look at the issues that don't work in Build 118.

g
#23

geektrader

03.01.2019 09:22
Sounds good! Have you been able to fix the separated "opposite-issues" I had listed (with Bears / BullsPower, etc.?). Thank you :-)
MF
#24

Mark Fric

03.01.2019 10:35
not yet, I'm thinking about it.


Currently it is:

Long: BearsPower > 0

Short: BearsPower  < 0


You are saying it should be:

Long: BearsPower > 0

Short: BullsPower > 0


?


g
#25

geektrader

03.01.2019 10:55
BearsPower is a kind of mirror of BullsPower (you can find some info on the web how they work in relation). It basically should have been one indicator when it was created, not sure why the author decided to split it when he created it ;-)


It should be:


Long: BearsPower > 0

Short: BullsPower < 0


Or (in case SQX finds a use the other way around):


Long: BullsPower > 0

Short: BearsPower < 0


etc. etc.....

MF
#26

Mark Fric

03.01.2019 12:02
ok, it is fixed also for Bears and BullsPower
g
#27

geektrader

03.01.2019 12:16
Superb, thanks. What about bullet #1 (Doji) and #3 (Aroon)?


P.S.: Another issue that I see coming is that the OppositeBlocks.csv file is in the /user directory, which is not updated by SQX and which many users keep and re-copy to their new installations. You should move that file somewhere else where SQX can update it and the user will not accidentally replace it again with an older version if they re-copy their /user directory into a new SQX installation/update.

cj
#28

cjl

15.01.2019 13:21

A similar problem exists on macd


sqx code

LongEntrySignal = (SQ_MACD(Close, 12, 52, 9, 1)[1] > 28.0);

ShortEntrySignal = (SQ_MACD(Close, 12, 52, 9, 0)[1] < -28);

LongExitSignal = (SQ_MACD(Close, 8, 17, 9, 1)[4] = -4.0);

ShortExitSignal = (SQ_MACD(Close, 8, 17, 9, 0)[4] <> 4);



SQ_MACD:

inputs: 

Price( numericseries ), 

FastLength( numericsimple ), 

SlowLength( numericsimple ),

Smooth( numericsimple ),

Line( numericsimple ) ;


Switch (Line)

Begin

case 0: begin // MACD Main

SQ_MACD = MACD(Price, FastLength, SlowLength);

end;

case 1: begin // MACD Signal

SQ_MACD = Average(MACD(Price, FastLength, SlowLength), Smooth);

end;

End;


g
#29

geektrader

15.01.2019 21:00
Yes, that looks wrong indeed, but I think you would be better off to post this as a separate bug, to get the attention needed.
MF
#30

Mark Fric

16.01.2019 12:46

Status changed from In progress to Fixed

#32 - problem with MACD fixed


#1 Doji - Dragonfly doji is not an opposite of normal Doji,it is opposite of Gravestone Doji which is also not implemented yet in SQ. In my understanding normal Doji is "neutral", and can be used in both long and short reversals. We will implement Dragonfly & Gravestone dojis as an example of extending SQ: https://roadmap.strategyquant.com/tasks/sqp_0035


#3 Aroon - I think you confused it.


LongEntrySignal = Aroon.Up crosses above Aroon.Down - when Up crosses above Down then it also means that Down crosses below Up - it is only another way to write it.


so the negation like this is correct:


ShortEntrySignal = Aroon.Up crosses below Aroon.Down;

g
#31

geektrader

16.01.2019 22:01
Hi Mark,


great about the MACD fix!


Doji, you are correct about this, see: https://www.investopedia.com/terms/d/doji.asp  As it is neutral, it should indeed use the same for long / short, but Doji seems to be just a general description for a series of patterns that have a very near open / close price. Maybe it´s best to make Doji a main-group and add at least 2 Doji sub-patterns that really describe a short and long entry, as to have correct opposite rules.


You are right about Aroon, I was confused by the different wordings but same outcome indeed. Sorry.


Thanks.

o
#32

Enric

16.01.2019 23:16

Great to have this bug fixed! Just one question: Did you solve the potential problem reported for Geektrader as wel?

P.S.: Another issue that I see coming is that the OppositeBlocks.csv file is in the /user directory, which is not updated by SQX and which many users keep and re-copy to their new installations. You should move that file somewhere else where SQX can update it and the user will not accidentally replace it again with an older version if they re-copy their /user directory into a new SQX installation/update.

g
#33

geektrader

16.01.2019 23:37
As for build 117, I´ve upgraded from 116 "in-place" through SQX directly and logged all the replaced files via Revo Uninstaller and it showed that the OppositeBlocks.csv in /user/settings was replaced during the upgrade. However, that also means that if someone did NOT use the "in-place" upgrade through SQX directly, but instead downloaded the new full ZIP file for build 117 and then replaced the whole /user directory with the one from build 116, they will NOT have the updated OppositeBlocks.csv file. Something that needs to be addressed or told to your users, Mark, as the bugs now might exist in build 117 for user A, but not for user B, all depending on how they´ve upgraded to build 117 (or subsequently to build 118 once it is released). That´s a real problem.


Personally, I think that you need to adjust the directory structure, so that files in /user are really ONLY user-files and never need to be updated by SQX updates at all. All files that need updating or could possibly be updated in the future, should be in the other directories that already exist for these purposes.


Votes: +16

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please