Question on Blueshift documentation

Blueshift document doesn't fully describe some of the ciritcial elements of backtest program.

For instance, the object "context" holds the inital and run time state of your algorithm parameters.

In one of the sample programs I see reference to "context.threshold". But no where in the documentation I can find what this "threshold" attribute signifies.

Where can I get this information. I am hoping for something at par with Linux man pages kind of details.

Similarly "SecList" attribute holds the list of securities but no where I can see its reference…

 

The context object on Blueshift is used for two different purposes. The platform internally uses this object to store, track and update internal algo state and exposes a set of relevant attributes that can be used by the user code to query the current state of the strategy. This makes Blueshift a stateful complex event processing engine.



The other use is by the user code, to store user defined variables that can be accessed from anywhere from the user code (as all api functions usually have the context passed on as an argument). That means somewhere in my strategy code, I can define" context.myvar= 0.5", and later from somewhere else I can refer to that attribute to make some decision.



All the platform attributes that you can use to query the algo state are documented in the api doc. Anything you do not find there is not intended for use by the user code. On the other hand, when you see attributes like "threshold" or "SecList" - these are of the second kind, defined by the user code else where. If you scan the codes you refer to, I am sure you will spot it. These user define attributes can be anything, except the name should not clash with the internal attributes (you will get an error if you try to do so in most cases).



So while our doc is nowhere near the man pages (it is as old as bell lab unix itself!), I do not see any gap in the context object documentation. If you have any questions or are not still not clear, feel free to give a shout out.

Thanks for your  answer. 

I now see in the documentation - 

"The context object is also useful to store user-defined variable for access anywhere in the strategy code."



I couldnt fully understand how an object of a class can acess some variable that is not defined in the class… That was the reason to ask the question…

 

Sure, hope it is clear to you now. Feel free to give us a shout here in case you have further questions.