TheRumpledOne 6,411 posts msg #70442 - Ignore TheRumpledOne modified |
1/7/2009 10:49:55 AM
|
TheRumpledOne 6,411 posts msg #70443 - Ignore TheRumpledOne |
1/7/2009 11:49:30 AM
Just gotta love statistics!!
|
con_air 2 posts msg #70450 - Ignore con_air |
1/7/2009 4:17:45 PM
Hi TRO,
I see from one of your earlier posts that you were looking to plot the BuyZone on TOS.
I have coded the BuyZone in TOS. I would post the code, but I dont know if it is appropriate to post it here at stockfetcher.
I can email it to you and you can post it on your site if you like.
|
johnpaulca 12,036 posts msg #70451 - Ignore johnpaulca |
1/7/2009 4:26:00 PM
con_air: Post the code please, quite a few people use TOS...thanks.
|
con_air 2 posts msg #70453 - Ignore con_air |
1/7/2009 5:09:45 PM
In TOS there is no way to access data from other time frames. For example, if you are looking at a 5 minute chart, there is no way to get the daily OHLC for the previous day, so this is a work around.
#######################
# TRO BuyZone #########
#######################
input m_open = 930;
input m_close = 1555;
input time = 5;
rec t_open = if(secondsTillTime(m_open) == 0, open, t_open[1]);
rec p_high = if(secondsTillTime(m_close) == 0, Highest(high, ((390 / time))), p_high[1]);
rec p_low = if(secondsTillTime(m_close) == 0, Lowest(low, ((390 / time))), p_low[1]);
rec p_close = if(secondsTillTime(m_close) == 0, close, p_close[1]);
def long_b = (t_open + 0.10);
def long_t = (t_open + 0.20);
def short_t = (t_open - 0.10);
def short_b = (t_open - 0.20);
plot highest = if(p_high == 0, double.nan, p_high);
highest.SetDefaultColor(color.pink);
plot lowest = if(p_low == 0, double.nan, p_low);
lowest.SetDefaultColor(color.light_red);
plot y_close = if(p_close == 0, double.nan, p_close);
y_close.SetDefaultColor(color.dark_gray);
plot td_open = if(t_open == 0, double.nan, t_open);
td_open.SetDefaultColor(color.white);
plot long1 = long_b;
long1.SetDefaultColor(color.blue);
plot long2 = long_t;
long2.SetDefaultColor(color.blue);
plot short1 = short_t;
short1.SetDefaultColor(color.red);
plot short2 = short_b;
short2.SetDefaultColor(color.red);
This code will plot the open of the current session and the BuyZone. It also plots the high,low and close of the previous day. On the “time” input, you will need to manually type in the specific time frame you are using, i.e. if you are using a 5 minute chart, you must enter 5, if you are using a 15 minute chart, you will enter 15. Any of the plots can be hidden by ticking the "Hide Plot" box in edit studies.
The m_open input is the very first bar/candle of the day (this is the actual opening time, i.e. 9:30am ET).
The m_close input is the very last bar/candle of the day (not the actual closing time, i.e. 4pm ET). So, if you are looking at 15 minute bars, you must enter 1545. If you are looking at 5 minute bars, you must enter 1555.
m_open and m_close time is stated in a 24hour form and it is Eastern Time.
This was the best I could come up with, the plot for previous close is not always accurate can be out by a couple of cent, why I cant figure out, maybe somebody might be able to figure this out and post the solution.
Hope this is of help to someone.
|
tomm1111 202 posts msg #70458 - Ignore tomm1111 |
1/7/2009 7:40:48 PM
Excellent! Thanks con_air.
|
TheRumpledOne 6,411 posts msg #70478 - Ignore TheRumpledOne |
1/8/2009 9:34:37 AM
|
TheRumpledOne 6,411 posts msg #70479 - Ignore TheRumpledOne |
1/8/2009 9:36:02 AM
|
TheRumpledOne 6,411 posts msg #70480 - Ignore TheRumpledOne |
1/8/2009 10:12:38 AM
*** FOR EDUCATIONAL PURPOSES ONLY ***
|
TheRumpledOne 6,411 posts msg #70482 - Ignore TheRumpledOne |
1/8/2009 10:29:17 AM
*** FOR EDUCATIONAL PURPOSES ONLY ***
|