Showing posts with label Dealbook. Show all posts
Showing posts with label Dealbook. Show all posts

Home


These pages discuss some of the features and uses of the Dealbook360 Chartstudio CTL language, along with some tips on getting started, and how to get and use some extensions to the language.
There is no attempt to discuss trading methods, ideals or management, and it is assumed that you have some experience in using Dealbook itself.
Any information given here is from personal experience and research and while given in good faith, i can not and do not offer any guarantees or warranties on the use of the information. Anything we try should be well tested and assessed with demo accounts before thinking of using real $$.






Site Content
>>Home
What is CTL?
How CTL runs
Attributes of Strategies, Indicators and Functions
CTL 101 How to write and run a CTL
All crossed up/down

Extended CTL Features

Other CTL links











Custom Search




What is CTL?

CTL is an acronym for Common Technical analysis Language. It is a proprietary programming language, as far as I know only used for the Dealbook software. CTL can examine and work with chart data within an active Dealbook chart to display more information and/or to take some action, such as automatic trading or sms notifications.

Three types of programs can be created using CTL for use in your charts.
1) Strategies: Used to automatically notify or place and close trades based on calculations of chart data.
2) Indicators: Used to calculate and display information as lines on charts.
3) functions: routines that can be called by strategies and indicators

CTL is not a particularly user-friendly language.. generally I would say it is harder to understand and less flexible than VBA (Visual Basic as found in Word and Excel macros).. and while easier to read than C++, is much less powerful.
The biggest issue I have had is the lack of debugging although this has been improved recently with the 'prinf' function.
There is little access to data outside of the chart that the CTL program is running in.


Site Content
Home
>>What is CTL?
How CTL runs
Attributes of Strategies, Indicators and Functions

Extended CTL Features

How CTL Runs


There are differences between how Strategies and Indicators operate.
Indicators:
For each tick (every price change) on the chart, your CTL program will run.
On each run all variables will be reset and recalculated.
Any input variables will be set to last settings in each individual chart.
However if the chart, or Dealbook, is closed before "saving the current layout" the next time Dealbook is started the input variables will be as of the last saved settings.
There is no current 'native' way to save any calculated values for later use.
Depending on what kind of calculations are done to make your new line, since at each tick all "Input" type variables are set back to the chart setting, and all other variables are reset, some kind of loop in your program is needed to recalculate the line on each tick. This can cause some amount of overhead when several charts, perhaps each with several CTL programs running need to recalculate everything every tick.
Strategies:
When a Strategy is opened (attached to a chart) it will first run through each period (candle, bar, point) of the chart, running the CTL program anew at each. Depending on your CTL code, this can cause Dealbook to ‘lockup’ while it traverses the whole chart’s data. Once started the Strategy CTL runs only at the Open of a new period.
As with indicators, strategies will reset variables at each run.

Functions:
Functions are (generally) short reusable routines that can save time and make code more readable. Functions can be called from indicators and strategies. Functions can only return 1 value or 1 series.



Site Content
Home
What is CTL?
>>How CTL runs
Attributes of Strategies, Indicators and Functions

Extended CTL Features

Attributes of Strategies, Indicators and Functions.

Overview






Functions
A function can be called from a function.
A function can be called from an indicator.
A function can be called from a strategy.
A function can receive multiple inputs of type bool, number, series and string.
A function returns one ‘result’ which may be a bool, a number, a series or a string.
A function may call another function.
A function may call an indicator.
A function cannot call a strategy.
A function cannot do ats commands.
A function cannot draw to a chart.
A function can write to the debug window.
A function can write to a file.


Indicators
An indicator can be called from a function.
An indicator can be called from an indicator.
An indicator can be called from a strategy.
An indicator can receive multiple inputs of types bool, number, series and string.
An indicator returns one or more line series defined in the ‘draw’ statement.
An indicator may call a function.
An indicator may call another indicator.
An indicator cannot call a strategy.
An indicator cannot do ats commands.
An indicator can draw to a chart.
An indicator can write to the debug window.
An indicator can write to a file.


Strategies
A strategy cannot be called from a function.
A strategy cannot be called from an indicator.
A strategy cannot be called from a strategy.
A strategy can receive multiple inputs of bool, number, series and string.
A strategy returns no results.
A strategy may call a function.
A strategy may call an indicator.
A strategy cannot call another strategy.
A strategy can do ats commands.
A strategy cannot draw lines to a chart, but can place trade related indicators.
A strategy can write to the debug window.
A strategy can write to a file.




Site Content
Home
What is CTL?
How CTL runs
>>Attributes of Strategies, Indicators and Functions

Extended CTL Features