Skip to content
Prev 14227 / 15274 Next

A quick custom data question

On 04/08/2017 03:58 AM, Michael Chen wrote:
The list doesn't terribly like HTML posts.

Anyway, it seems likely that your problem is here:

OHLC(J.DCE)

when you call applyIndicators.

You're only passing in the OHLC columns.

just test applyIndicators with

applyIndicators(strategy.st, mktdata=J.DCE)

and getPrice should be able to find your column in your getHMM function.

Even simpler, since the data is already there, and being passed into to 
the apply* functions with the original data is to simply refer to the 
column in whatever other indicator needs it, or in your signal 
functions.  I don't see a need for a custom indicator function at all.

In any case, from your non-reproducible example, and just reading the 
code, the main problem appears to be your call to OHLC(), which will 
strip your other columns.  Skip that, and things should be fine.

Regards,

Brian