,I want to trade exchange traded spreads, starting with CL instrument. For example, long the May 17 contract and short the June 17 contract as one position. I have written this algo in C# on another platform, but want to try it with ADL. Is there an example somewhere I can look at for something close to this idea, so I can see how ADL is different/same as C# code? Ideally, I'd like make a rough flowchart of my C# algo and hopefully create the ADL from that - but it would be nice to have an example to look at for sanity checking. :-)
Answer by bryan-cass · Apr 07 at 12:31 PM
Thank you! So for entry criteria, I would want to monitor the difference in price between the two contracts. So I would just add two more instrument blocks for the two I want to trade, and then come up with the criteria that then feeds the Order block with the on/off method/property?
Answer by Damon · Apr 07 at 12:57 PM
Unfortunately no. The only kind of "code editing" you can do is to change up how you have the ADL Blocks connected together. We are currently working on improving and adding in expanded functionality of the Analytics Block and technical indicators.
Answer by Damon · Apr 07 at 01:20 PM
With regards to opening up the ADL front end and GUI interface for editing of the code....no, this will not possible. But, you will be able to build custom code in PYTHON with TTSDK.
Answer by bryan-cass · Apr 07 at 01:36 PM
OK that's good, although I've never programmed with Python. :-)
Another question about the limits of ADL -- is there a way to retain a historical index of the price difference between the two contracts in the calendar spread? For example, I would want to know if the price difference is generally converging or diverging over X number of ticks/secs/mins/hours/days. So would ADL be good for a tick-based scalping or arbitrage strategy like that? Or would the SDK be the way to go then?
Answer by Damon · Apr 07 at 01:54 PM
You can build what you are needing into ADL.
You can also import numerical values from an Excel based Spread Sheet into ADL logic as well. This way you can have your external Historical values or Indicators calculated outside of ADL. Then link these updating values from an EXCEL Spread Sheet into a User Defined Variable to directly input into the algo logic.
Answer by bryan-cass · Apr 07 at 06:03 PM
Well, I really need the spread value for the past few weeks and up to the current tick so I know when to place the order. So loading from a spreadsheet wouldn't be practical. Isn't there a way in ADL to hold the spread value in a realtime historical data array?