Hi everyone,
Anyone can help me with code of autodraw vertical line in 1 minute chart? like every 5 mins and 15 mins past the hour draw vertical time line. See on chart. Thanks a lot.
Auto Draw Vertical Line based on Time? [SOLVED]
-
- Posts: 38
- Joined: 26 Oct 2011
- Has thanked: 6 times
- Been thanked: 2 times
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Auto Draw Vertical Line based on Time? [SOLVED]
give this a tryHi everyone,
Anyone can help me with code of autodraw vertical line in 1 minute chart? like every 5 mins and 15 mins past the hour draw vertical time line. See on chart. Thanks a lot.
- Attachments
-
- draw.line.txt
- (364 Bytes) Downloaded 1167 times
-
- Posts: 38
- Joined: 26 Oct 2011
- Has thanked: 6 times
- Been thanked: 2 times
Re: Auto Draw Vertical Line based on Time?
give this a tryHi everyone,
Anyone can help me with code of autodraw vertical line in 1 minute chart? like every 5 mins and 15 mins past the hour draw vertical time line. See on chart. Thanks a lot.
Hi TJ,
in your code, the drawing is always on subchart, when i drag the indicator to main chart, i can't set the right scale. Could you help me further with the scale please? in EURUSD Chart, the code only draw line less than half of the screen. I think the problem is with top = h[1]*4 this line. How can I get all line full scale high please? Cheers
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Auto Draw Vertical Line based on Time?
Format Study > Properties > SubchartHi TJ,give this a tryHi everyone,
Anyone can help me with code of autodraw vertical line in 1 minute chart? like every 5 mins and 15 mins past the hour draw vertical time line. See on chart. Thanks a lot.
in your code, the drawing is always on subchart,
https://www.multicharts.com/trading-sof ... r_Settings
Format Study > Scaling > Scaling Range > Same as Instrumentwhen i drag the indicator to main chart, i can't set the right scale. Could you help me further with the scale please? in EURUSD Chart, the code only draw line less than half of the screen. I think the problem is with top = h[1]*4 this line. How can I get all line full scale high please? Cheers
https://www.multicharts.com/trading-sof ... or_Scaling
-
- Posts: 38
- Joined: 26 Oct 2011
- Has thanked: 6 times
- Been thanked: 2 times
Re: Auto Draw Vertical Line based on Time?
Format Study > Scaling > Scaling Range > Same as Instrument
https://www.multicharts.com/trading-sof ... or_Scaling
I tried the scaling options already. Non of them works. the indicator calculation is 5. something need to be fix in the code " top=h[1]*4 " i recon, i just don't know how. Thanks again.
Re: Auto Draw Vertical Line based on Time?
May this is more helpful for you. But please be aware it's not a plot-indicator. It generates trendlines as per defined.
Hope it helps.
Mike
Code: Select all
// BEGIN
//
// This indicator sets vertical trendlines (NO PLOTS !!!) when the time is at 5 min or 15 min of the hour
//
//
//
// ------------------------------------------------------------------------------------------
//
input: style(3); // ( 1 = solid, 2 = dashed, 3 = dotted ... etc etc )
input: color(lightGray); // color of the trendline
//
// ------------------------------------------------------------------------------------------
//
var: drawline(false);
var: tl(-1);
//
// ------------------------------------------------------------------------------------------
//
drawline = (fracPortion(time/100)=0.05) or (fracPortion(time/100)=0.15); // define TRUE for drawline
//
If drawline then
begin
if bartype <> 0 then // bartype <> 0 ... just working in minute charts
begin
// set the trendline
tl = tl_new(date,time[1], l, date, time[1], h);
tl_setcolor(tl, color); // set trendline color from input
tl_setstyle(tl, style); // set trendline style from input
tl_setextleft(tl, true); // set trendline extension to left true (for HIGH)
tl_setextright(tl, true); // set trendline extension to right true (for LOW)
end;
end;
//
// ------------------------------------------------------------------------------------------
//
// END
Mike