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.
Hi geektrader,
it is a good work. I hope mark will use this file in the next release.
thomas
Status changed from New to In progress
I'll look at the issues that don't work in Build 118.
Currently it is:
Long: BearsPower > 0
Short: BearsPower < 0
You are saying it should be:
Long: BearsPower > 0
Short: BullsPower > 0
?
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.....
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.
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;
Status changed from In progress to 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;
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.
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.
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.