Add the Opposite conditions in the Strategy template, NOT Negated Condition

I would like to create this type of strategy using a template where the signal condition is used as an entry context.



And It WILL CLOSE THE POSITION WHEN THIS SIGNAL CONDITION NO LONGER HOLDS.


When I used the negative condition, I found a little problem.


//-------------------------------------------------------------------- // Trading rule: Trading signals (On Bar Open) //--------------------------------------------------------------------                    LongEntrySignal = ((KER(Main chart,KERbelowLevelPeriod)[2] is below 0.38)    and ((QQE(Main chart,QQEValue1RSIPeriod, 11, 4.236).Value1[3] is rising)    and Open below BollingerBands(Main chart,BBBarOpensPeriod, 2, PRICE_CLOSE).UpperBand)); ShortEntrySignal = ((KER(Main chart,KERbelowLevelPeriod)[2] is below 0.38)    and ((QQE(Main chart,QQEValue1RSIPeriod, QQEValue1sF, 4.236).Value1[3] is falling)    and Open above BollingerBands(Main chart,BBBarOpensPeriod, 2, PRICE_CLOSE).LowerBand)); LongExitSignal = (((QQE(Main chart,QQEValue1RSIPeriod, QQEValue1sF, 4.236).Value1[3] is falling) //This is good, but Not ( the QQE.Value1 is rising) will be better    and Open above BollingerBands(Main chart,BBBarOpensPeriod, 2, PRICE_CLOSE).LowerBand) //This does not fit the strategy at all.
// Open above Boll.Upper or Not( open below boll.upper) would fits the concept of the strategy    or  ((4 < Bars Since Order Open("Current", MagicNumber, 1, ""))    and ((OrderOpenPrice("Current", MagicNumber, 1, "") - Close(Main chart)[0]) > (ATR(Main chart,ATRPeriod)[1] * 0.2)))); ShortExitSignal = (((QQE(Main chart,QQEValue1RSIPeriod, 11, 4.236).Value1[3] is rising)    and Open below BollingerBands(Main chart,BBBarOpensPeriod, 2, PRICE_CLOSE).UpperBand)    or  ((4 < Bars Since Order Open("Current", MagicNumber, -1, ""))    and ((Close(Main chart)[0] - OrderOpenPrice("Current", MagicNumber, -1, "")) > (ATR(Main chart,ATRPeriod)[1] * 0.2))));



So I would like SQ X to add an opposite condition or false condition to the template.



The opposite condition, not the same as the negative condition, I mean it's the false condition that is simply a negation condition using logical operator 'Not( conditons)'










Attachments
Build.cfx
(33.67 KiB)
AddFalseConditionHere.png
(79.76 KiB)
dibodonglv_exitXbars.sqx
(4.01 KiB)
Strategy 117129.sqx
(26.91 KiB)
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Refused
  • Priority Normal

History

e
#1

eastpeace

29.05.2021 13:20

Task created

MF
#2

Mark Fric

31.05.2021 08:46

Status changed from New to Refused

Attachment image-0.png added

image-0.png
(45.31 KiB)
I'm not sure if I understood it exactly, but adding Not (Condition) is simple in the template.


You use "Not Same Condition" instead of Negated.


e
#3

eastpeace

31.05.2021 15:32

Attachment not.png added

not.png
(103.67 KiB)
Yes, you are right. This would meet my needs.


But let NOT operator in the element right click, it will be better.


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please