Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
ppcl
Members-
Content Count
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Articles
Everything posted by ppcl
-
johnny daymon, thanks for reply. You see the vwap indicator start to calculate and draw everyday but trading time of CL products is 0600 to 0500 (trading time across 2 days). Anyone can help, thanks?
-
I add some code to label the line in the chart (from day 1 to day 4 from today ) but I find that some letters is missed after it is enabled. For example, d2H = day 2 high, it display d2 without H. After a while, it will show up all. Any idea? =============================== input: lookback( 4 ), Line.size ( 1 ), Line.style ( 2 ), color.h1( blue ), color.l1( blue ), color.h2( red ), color.l2( red ), color.h3( darkgreen ), color.l3( darkgreen ), color.h4( cyan ), color.l4( cyan ), hori_txdisp(10); {horizontal distance} vars: d1Htid(0), d1Ltid(0), d2Htid(0), d2Ltid(0), d3Htid(0), d3Ltid(0), d4Htid(0), d4Ltid(0); // 1 if date <> date[1] and lookback = 1 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); tl_setcolor( value1, color.h1 ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.l1 ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); end; if lookback = 1 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); end; // 2 if date <> date[1] and lookback = 2 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); tl_setcolor( value1, color.h1 ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.l1 ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); tl_setcolor( value3, color.h2 ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); tl_setcolor( value4 , color.l2 ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); end; if lookback = 2 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); end; // 3 if date <> date[1] and lookback = 3 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 )); value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 )); tl_setcolor( value1, color.h1 ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); tl_setcolor( value2 , color.l1 ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); tl_setcolor( value3, color.h2 ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); tl_setcolor( value4 , color.l2 ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); tl_setcolor( value5, color.h3 ); TL_SetSize( value5, Line.size ); TL_SetStyle( value5, Line.style ); tl_setcolor( value6 , color.l3 ); TL_SetSize( value6, Line.size ); TL_SetStyle( value6, Line.style ); end; if lookback = 3 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); tl_setend_s(value5, d , time_s , highd(3) ); tl_setend_s(value6, d , time_s , lowd(3) ); if lastbaronchart then begin tl_setextright(value1, true); tl_setextright(value2, true); tl_setextright(value3, true ); tl_setextright(value4, true); tl_setextright(value5, true); tl_setextright(value6, true); end; end; // 4 if date <> date[1] and lookback = 4 then begin value1 = tl_new_s(d , time_s , highd(1), d , time_s, highd(1 )); value2 = tl_new_s(d , time_s, lowd(1), d , time_s, lowd(1)); value3 = tl_new_s(d , time_s , highd(2), d , time_s, highd(2 )); value4 = tl_new_s(d , time_s, lowd(2), d , time_s, lowd(2)); value5 = tl_new_s(d , time_s , highd(3), d , time_s, highd(3 )); value6 = tl_new_s(d , time_s, lowd(3), d , time_s, lowd(3 )); value7 = tl_new_s(d , time_s , highd(4), d , time_s, highd(4 )); value8 = tl_new_s(d , time_s, lowd(4), d , time_s, lowd(4 )); tl_setcolor( value1, color.h1 ); TL_SetSize( value1, Line.size ); TL_SetStyle( value1, Line.style ); //piv1tid = Text_New(date, Minlist(Time + hori_txdisp, SessionEndTime(0, 1) + hori_txdisp), highd(1) - (textscale * MinMove/PriceScale), "d1H"); d1Htid = Text_New(date, currenttime+hori_txdisp , highd(1), "d1H"); tl_setcolor( value2 , color.l1 ); TL_SetSize( value2, Line.size ); TL_SetStyle( value2, Line.style ); d1Ltid = Text_New(date, currenttime+hori_txdisp, lowd(1) , "d1L"); tl_setcolor( value3, color.h2 ); TL_SetSize( value3, Line.size ); TL_SetStyle( value3, Line.style ); d2Htid = Text_New(date, currenttime+hori_txdisp , highd(2), "d2H"); tl_setcolor( value4 , color.l2 ); TL_SetSize( value4, Line.size ); TL_SetStyle( value4, Line.style ); d2Ltid = Text_New(date, currenttime+hori_txdisp, lowd(2) , "d2L"); tl_setcolor( value5, color.h3 ); TL_SetSize( value5, Line.size ); TL_SetStyle( value5, Line.style ); d3Htid = Text_New(date, currenttime+hori_txdisp , highd(3), "d3H"); tl_setcolor( value6 , color.l3 ); TL_SetSize( value6, Line.size ); TL_SetStyle( value6, Line.style ); d3Ltid = Text_New(date, currenttime+hori_txdisp, lowd(3) , "d3L"); tl_setcolor( value7, color.h4 ); TL_SetSize( value7, Line.size ); TL_SetStyle( value7, Line.style ); d4Htid = Text_New(date, currenttime+hori_txdisp , highd(4), "d4H"); tl_setcolor( value8 , color.l4 ); TL_SetSize( value8, Line.size ); TL_SetStyle( value8, Line.style ); d4Ltid = Text_New(date, currenttime+hori_txdisp, lowd(4) , "d4L"); end; if lookback = 4 then begin tl_setend_s(value1, d , time_s , highd(1) ); tl_setend_s(value2, d , time_s , lowd(1) ); tl_setend_s(value3, d , time_s , highd(2) ); tl_setend_s(value4, d , time_s , lowd(2) ); tl_setend_s(value5, d , time_s , highd(3) ); tl_setend_s(value6, d , time_s , lowd(3) ); tl_setend_s(value7, d , time_s , highd(4) ); tl_setend_s(value8, d , time_s , lowd(4) ); end;
-
Hi, I am new to this group. Thanks for sharing about vwap indicator. I find that the indicator cannot sync with the time session of CL (crude oil future contract: Sunday - Friday 6:00 p.m. - 5:00 p.m.). It start calculation at 00:00 am. Can anyone help to adjust it to sync with the trading session of CL? Thanks.
-
Hi, Thanks for sharing about the VWAP indicator. I apply the indicator to Crude oil future contract (CL) and find that it starts calculation from the beginning of the day but the session of CL should be: Sunday - Friday 6:00 p.m. - 5:00 p.m. (5:00 p.m. - 4:00 p.m. Chicago Time/CT). What kind of adjustment to make the indicator sync with official trading time slot ? Thanks a lot.