How to Find the Quadrant in a Time Period for an Index or Symbol's Price Range?
Author: abr4321
Creation Date: 8/5/2012 2:38 PM
profile picture

abr4321

#1
Hi;

I have searched and looked through the existing materials on the website, but no luck. May be I missed it.

Is there a simpler way of finding where the symbol or index's present value is - looking back for a certain time period - Top/bottom/upper mid/lower mid quadrant of the range (in that certain period)? It may not the quadrant, the said range may be divided into 2, 3, 4, 5, or 6 ... sub divisions, and then locating where the price rests.

I am aware that we can find the hi/low of the range in that peiod and then cerate the sub division boundaries to finally determine where the present price/value falls. But in the streaming environment and for - 1, 2, 3, 5 minutes periods - that may be quite resource consuming and cumbersome process - especially, if it is being done for a number of indices or symbols.

Thanks.
profile picture

Cone

#2
It's no more resource intensive for streaming when you realize that a script is executed only when a new bar is added to the chart. In other words, you cannot do processing with the stream, which is used for building the OHLC/V of the bar in progress and for displaying the last price on the y-axis.
profile picture

abr4321

#3
Hello Cone;

Thanks for the quick response. I appreciate it. I think that I understand it better now.

Just to confirm - In streaming, in the script, after the OHCL/V bar is built; we can calculate the quadrant etc. and then base our buy/sell algorithm on it. And the operating efficiency is just about the same - if we calculate it from the scratch, or use a Wealth-Lab pre-coded function for it (which, I understand that at the present time, one is not coded or needed in this case).

Thank You.
profile picture

Cone

#4
Right. In fact, successive runs in a streaming windows is more efficient because the data are already loaded in memory, i.e., the historical bars don't have to be loaded each time. All other things equal, the execution time for the Execute() method should be the same.

Something else to keep in mind:
When using Streaming windows for live trading, don't overload the windows with a lot of Visualizers. Some of these consume lots of resources and add several seconds (or more) to post-processing time. The message is: Use Visualizers when testing with static windows, but minimize the use of Visualizers in your Streaming Workspace.
profile picture

abr4321

#5
Thanks, Cone. Yes, I have experienced multiple bog-downs in running multiple scripts simultaneously in short (1 minute) time frames in Fidelity Provided Data environment on one processor. Looks like before all processing in all scripts for that time frame is completed, the next data point availabilty encrouches upon it. The use of multiple processors did elimilnate that drawback.

Also now, knowing and looking at it from a logical point of processing - looks like, making a data series (of whatever is repeated calc'ed) in the processing components in post-processing - would be more efficient, as the next streaming calc can be done with the last and the new bar of the present period, instead of dealing with all points of the look back time perios, esprcially if the look back time period has a longer duration.

Thanks again and much obliged;

AK