Back to Community
Adding a custom (non-standard) column to a Panel to use in handle_data (ZIPLINE)

Hello team,

This is referring to Zipline (rather than Quantopian, apologies if I should be posting this elsewhere... I still struggle to understand the diff btween the 2 (other than the cool graphing Quantopian tool):

I am trying to create my own EMA (exponential moving average) crossover strategy. I calculate my own EMAs in my main function (in a dataframe format) and then I feed to data_handle a data panel containing 3 columns (effectively 3 dataframes joined together - dates, prices and EMA that I just calculated) - dates, prices and EMA. When i try to reference the EMA column in handle_data I get NaN but when i reference the price column it shows the price with no problem (suggesting that it cant recognize the EMA column)....If I mechnically change the name of the EMA column to 'low' (another standard column), I have no problem displaying the value of th EMA....Question is, is there a way to add a custom column to a Panel then used as data in handle_data? If not possible, how is one supposed to create a custom EMA strategy? Maybe define the custom EMA function in initilaize or in handle_data?