OmniTrader Professional Forum - OmniTrader Pro General Discussion
Syntax help

^ Top
Buffalo

Posts: 603

Joined: 7/11/2007
Location: Braintree, MA

User Profile
 
Subject : Syntax help
Posted : 5/16/2022 8:35 AM
Post #32017

All

Messing around with an ATM method and want to use a filter block to reproduce the ATM market states but having trouble getting the a NO Trade market state (MS where we don't allow trades) syntax defined in a filter block. Filter blocks work to ALLOW signals to pass when certain criteria are met. The MS in ATM is written so that when that specific criteria is met we have 0 trades allowed in ATM which is NOT the same as don't allow trades directly. The MS says when this is true we won't trade, but my filter blocks need to say when this situation is NOT true we will allow signals - The opposite effectively.

I tried 1 filter block with "NOT (XXX(16,2.5,1,14)[1] = 0)" (BTW no "" was used in actual filter) on the $VIX and another filter block with "NOT (YYYY(23,0.6)[1] > YYYY(23,0.6)[2] AND RSI(9)[1] > 90)" on SPY but NO signals get passed at all with these engaged.

The filter blocks need to PASS signals when XXX(16,2.5,1,14)[1] = 0 and YYYY(23,0.6)[1] > YYYY(23,0.6)[2] AND RSI(9)[1] > 90 is NOT true. What is the proper syntax here? NOT should work.

You can't just reverse it - IOW XXXX(16,2.5,1,14)[1] = 1 or -1 or YYYY(23,0.6)[1] < YYYY(23,0.6)[2] AND RSI(9)[1] <= 90. For sure the second is NOT the same.

Any ideas?


^ Top
Barry Cohen

Posts: 2289

Joined: 1/1/1900

User Profile
 
Subject : RE: Syntax help
Posted : 5/16/2022 10:38 AM
Post #32019 - In reply to #32017

Try 3 separate filter blocks:

Symbol $VIX:
VBX4_Gap_Dir(16,2.5,1,14)[1] <> 0

Symbol SPY:
RSI(9)[1] <= 90

Symbol SPY:
CoralTrend(23,0.6)[1] <= CoralTrend(23,0.6)[2]

^ Top
Buffalo

Posts: 603

Joined: 7/11/2007
Location: Braintree, MA

User Profile
 
Subject : RE: Syntax help
Posted : 5/16/2022 12:02 PM
Post #32020 - In reply to #32019

Thx Barry!
^ Top
SteveL

Posts: 132

Joined: 2/15/2007
Location: Boulder, CO

User Profile
 
Subject : RE: Syntax help
Posted : 5/16/2022 6:29 PM
Post #32021 - In reply to #32019

Barry and Bill,

I believe the two conditions Barry specified for the SPY should be in the same filter block, and "Any" (i.e., an OR condition) should be selected. If either of those two conditions are true, then the signal should get through. Only if both conditions are false should it be blocked.




https://www.omnitrader.com/currentclients/proforum/thread-view.asp?threadid=8047&posts=4