Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 05:57:22 +0000



[User Discussion] - Enable/Disable Auto Trade using ATR

View Count: 1691

[2016-09-04 02:12:35]
Litz - Posts: 131
I currently use =OR(J41-INT(J41)<TIMEVALUE("07:30:00"),J41-INT(J41) >TIMEVALUE("16:00:00")) to disable Auto Trade during off hours and wish to add ATR as an additional parameter to the formula whereby Auto Trade would be activated only during high volatile periods as determined by ATR.

ATR is ID 10.SG1 with 1.2 the current level to be exceeded to enable Auto Trade and 1.4 the level to disable Auto Trade

I tried this: =OR(J41-INT(J41)<TIMEVALUE("07:30:00"),J41-INT(J41) >TIMEVALUE("16:00:00")),AND(ID10.SG1@4>[1.2],ID10.SG@3<[1.2]),(ID10@5<[1.4],ID10@4>[1.4])) but get a #SYNTAX error.

The idea is to disable Auto Trading in chop zones which seems to eat away at profits. Just a theory don't know if it will work.
Date Time Of Last Edit: 2016-09-04 02:19:22
[2016-09-04 05:23:53]
Sawtooth - Posts: 3982
Put the ATR condition inside the OR statement, like this:
=OR(J41-INT(J41)<TIMEVALUE("07:30:00"),J41-INT(J41)>TIMEVALUE("16:00:00"),YourATRcondition)

Your ATR condition has syntax errors. Be sure to include the SG1.
[2016-09-04 12:27:32]
Litz - Posts: 131
=OR(J41-INT(J41)<TIMEVALUE("07:30:00"),J41-INT(J41))>TIMEVALUE("16:00:00"),ID10.SG1@4>[1.2],ID10.SG1@3<[1.2]),(ID10.SG1@5<[1.4],ID10.SG1@4>[1.4]) ??? still #syntax

another approach is to ignore Buy/Sell signals if ATR is below a certain level

=AND(=CROSSFROMBELOW(AA3:AA5,AC3:AC5),ID10.SG1@4>[1.2],ID10.SG1@3<[1.2]) dont know if that syntax is correct

Is there a source for learning proper syntax?
Date Time Of Last Edit: 2016-09-04 13:48:22
[2016-09-04 14:53:42]
Sawtooth - Posts: 3982
To correct the syntax errors:
-Remove all of the []

-remove the () if each of the conditions between commas should disable autotrading:
ID10.SG1@4>1.2,ID10.SG1@3<1.2,ID10.SG1@5<1.4,ID10.SG1@4>1.4

-pair up the () with AND if combinations of conditions should disable autotrading:
AND(ID10.SG1@4>1.2,ID10.SG1@3<1.2),AND(ID10.SG1@5<1.4,ID10.SG1@4>1.4)
Each of these AND statements are parts of the beginning OR statement.

-The OR at the very beginning needs its own closing parenthesis at the very end.

Your CROSSFROMBELOW formula should look like this:
=AND(CROSSFROMBELOW(AA3:AA5,AC3:AC5),ID10.SG1@4>1.2,ID10.SG1@3<1.2)

Sierra Chart spreadsheets follow most Excel syntax rules. You can Google it, but you'll get more than a quick answer:
https://support.office.com/en-us/article/Overview-of-formulas-in-Excel-ecfdc708-9162-49e8-b993-c311f47ca173?ui=en-US&rs=en-US&ad=US

Basic syntax rules:
-A formula begins with a single =
-Each function opens and closes with a paired ()
-Each nested function opens and closes with its own paired ()
-When doing math, observe calculation order. This may require the use of ()
-Avoid extraneous characters.
[2016-09-05 22:34:05]
Litz - Posts: 131
Thanks for the link. This crossover formula works well for enabling Autotrade as ATR increases above a certain level after a downtrend. =AND(CROSSFROMBELOW(AR3:AR5,AC3:AC5),ID7.SG1@4>.45). Using ATR ma of 4. Exits tied to the ATR do not work.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account