SETBACK

Top  Previous  Next

Keyword Description

Manually specify look back period

Class

Directive

Where Legal

Resources

Entry Logic

Exit Logic

Initial Size

Resize

(Pre-Category)

Resize

(Category-Level)

l

 

 

 

 

 

Syntax

SETBACK

 

Example

Sample code

SETBACK = 200 ' no trades before day 200

 

ThumbTack white

Increases the number of days that Mechanica will allow for math routines to get "up to speed" before making its first trade.

Mechanica automatically calculates the number of days your math routines need to start returning meaningful values and will not execute a trade before then. In the case of exponential moving averages, Mechanica allows 15 days for startup time. SETBACK allows you to increase this value manually.

Suppose for instance you say COL1 = MAX[HIGH, X, 0]. Mechanica cannot know in advance what the possible values for X might become. So without specifying a value for SETBACK, a 'looked back too far' error message is likely to appear. To avoid this you would say SETBACK = greatest-expected-value-of-X (200 in the above example)

See also:

VARIABLESETBACK