I was having trouble figuring out Stochastics using the new (awesome) History function. Thanks to Eddie Hebert who helped me figure it out. This is a sample algorithm which you may find useful in case you have been having trouble also. Although it's not meant to be an optimized algorithm, I do think it shows how much can be done with History and some of the other new functions, and it beats buy and hold, although it suffers from whipsaw at times.