[B135] Unsymmetric / Pointless opposite entry rule using ATR

SQX just generated a strategy that uses:


LongEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] <= TrueRange(Main chart)[TrueRangeShift]); ShortEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] >= TrueRange(Main chart)[TrueRangeShift]);


It makes no sense to have the opposite signal as < or > if using ATR, as ATR is never showing any market direction, only volatility. In the above case, we would enter a long trade when the volatility is low and enter short went the volatility is high - this makes no sense. The long entry rule should be identical to the short entry rule in the above case, even if SQX will then most likely not use it indeed (which would make sense though). In any case, it makes no sense to use the ATR in this way to create a symmetric long/short rule and this should be fixed.

Thanks.

Attachments
No attachments
  • Votes +4
  • Project StrategyQuant X
  • Type Bug
  • Status New
  • Priority Normal

History

g
#1

geektrader

15.02.2022 10:49

Task created

g
#2

geektrader

15.02.2022 10:49
Voted for this task.
b
#3

bentra

15.02.2022 16:40

I was told by mark a while ago to use predefined conditions:

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

b
#4

bentra

15.02.2022 22:25
Voted for this task.
g
#5

geektrader

15.02.2022 22:36

Sure, with the OppositeBlocks.csv it´s possible, but it creates other issues, as the OppositeBlocks.csv is not correctly working for other indicators like HighestInRange and LowestInRange. Regardless what you put there, the HighestInRange is always also HighestInRange when SQX generates and the OppositeBlocks.csv is active. Reported here: https://roadmap.strategyquant.com/tasks/sq4_8574


These rules should be correctly defined out of the box and we should not be forced to use such a "dirty hack" to give it the correct opposite signal. Having ATRrising as the opposite of ATRfalling as the opposite for long/short entry signals, makes absolutely no sense to begin with and should be fixed in their java code, not by having us correct it in the OppositeBlocks.csv.

b
#6

bentra

15.02.2022 23:01
I agree. I think, in my case, actually it is NOT possible to fix it in opposite blocks. I think Mark was saying the only solution was to use predefined conditions blocks (signal blocks) and not use indicator blocks at all if I wanted symmetry but I never understood why that would be the case, it should be possible to fix it for indicators.
g
#7

geektrader

15.02.2022 23:23
Exactly. The scenario I´ve posted also has nothing to do with ATRfalling or ATRrising, it´s simply a wrong (unsymmetric) comparison. And having to "fix" this with predefined blocks, seriously? This is clearly not something that should be generated if we have selected symmetry (which I did) and should be fixed internally by the dev team, not with such a dirty workaround.
E
#8

Emmanuel

21.02.2022 09:19
Voted for this task.
b
#9

bentra

23.02.2022 22:07
It's worth noting that unless you are actually using a template any logic containing non-directional indicators will never produce symmetrically acting strategies in SQX as it is now because the symmetrical logic would be:


LongEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] <= TrueRange(Main chart)[TrueRangeShift]); ShortEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] <= TrueRange(Main chart)[TrueRangeShift]);

And obviously, that will fire longs and shorts simultaneously which is not allowed by default and instead will fire longs only unless using a template to either make it fire both or neither.

And if you don't want that either then I guess turning off ATR in the block selection is the only current solution. I mean, as SQX stands today, we won't get symmetrical strats for something like ATR>RSI either. For "ATR>RSI" the opposite is neither "ATR<RSI" nor "ATR>RSI." So it's not super easy to fix symmetry issues involving non-directional indicators outside of the predefined conditions. Although it is possible, the ending solution would be:
ATR>RSI
ATR>100-RSI
for more info about symmetry outside of predefined signals:
https://roadmap.strategyquant.com/tasks/sq4_8659/edit



g
#10

geektrader

23.02.2022 22:40

I don´t really agree with that. It can very well use them in combination (and that´s, by the way, how it works in the other platform which I am using) for example:



LongEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] <= TrueRange(Main chart)[TrueRangeShift]) && Indicator1 > 50; ShortEntrySignal = (ATR(Main chart,ATRPeriod)[ATRShift] <= TrueRange(Main chart)[TrueRangeShift]) && Indicator1 < 50;


in this way, it would work as a volatility filter in addition to a directional indicator. Hence I still say that generating rules like posted in my initial post makes no sense for non-directional indicators like the ATR.

b
#11

bentra

24.02.2022 02:11
Yes, you're right I forgot to think about multiple conditions. 

We do agree on what symmetry should look like. Doesn't seem like it would be hard to fix it to be symmetrical like in our examples. When two non-directional indicators are compared to each other, the comparator need not change for the opposite logic. 
g
#12

geektrader

24.02.2022 05:05

When two non-directional indicators are compared to each other, the comparator need not change for the opposite logic. 


I don´t agree with that for the same reason as the multi-condition example I gave above. Non-directional indicators, when compared, should never have the opposite logic, as this is not really the opposite. They can be used in combination with another directional indicator like in my example above while having the same logic for short + long. And that´s the kind of strategies SQX should come up with in such cases (and so does the other platform since years).

b
#13

bentra

24.02.2022 06:55
Both our examples are just like that, I'm sure we are on the same page. I'm just calling the logic of the short vs the long "opposite logic" even though it's not opposite, it's the same. By not changing the comparator we end up with the same thing. Sorry for the confusion. And yes you're right your example is very clear. I have some strategies like that too, I forgot.
CG
#14

Chris G

18.04.2022 18:43
Voted for this task.
AA
#15

Alex

13.11.2022 11:19
lots of tasks still remained under 136Dev4 milestone.

Solved or not?


Votes: +4

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please