SPY Divergence with AD Line (ADD) and TICK
sm633284
Posts: 2
Is this data possible in Cloudquant? If so what what the code be for a AD Line Divergence with Spy at +/- 600 TICK
Comments
Like any task you want to achieve in programming, you first have to identify and understand the individual steps to achieve the goal. Then write them out in pseudo code.
You have access to the daily bars, you have access to 8800+ symbols, so you can pull the data and calculate the values.
You would first have to decide which symbols you were tracking (those from an index - SP500 or just a basket of your own symbols)
You would only want to do this at the very start of each day, ONCE.... so you would do it in on_strategy_start.
You would need your list of symbols (either from a list in the system or your own).
You would need to pull daily bars going back as far as you wanted for your Advances/Declines calculation
You would then loop through them constructing a table of AD values for each date building up to the latest value.
Store the result in a class variable and it would be available to any symbol you then ran in the simulator.
We do have TA Lib Library available for import so you may find something in there, where you just pass the data and it does the AD calculation for you.
Your ability to achieve this obviously depends upon your current programming ability.