Plot open line in range bar chart

Questions about MultiCharts and user contributed studies.
dingmanhoe123
Posts: 61
Joined: 25 Jul 2013
Has thanked: 18 times

Plot open line in range bar chart

Postby dingmanhoe123 » 09 Dec 2014

assume market open at 09:15:00

inputs: Price( Close ), Displace( 0 );
variables: Open_today(0);

if time_s>091500 and time_s<=161500 then begin

if time_s[1]<091500 and time>=0915000 then open_today=open;

end;

condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
Plot1[Displace]( open_today, " Open ") ;


I use the above code for generating an open line in range bar chart, however nothing show up. Did I miss something for generating the open line?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Plot open line in range bar chart

Postby TJ » 09 Dec 2014

assume market open at 09:15:00
inputs: Price( Close ), Displace( 0 );
variables: Open_today(0);
if time_s>091500 and time_s<=161500 then begin
if time_s[1]<091500 and time>=0915000 then open_today=open;
end;
condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
Plot1[Displace]( open_today, " Open ") ;
I use the above code for generating an open line in range bar chart, however nothing show up. Did I miss something for generating the open line?
count the zeros

Code: Select all

if time_s[1]<091500 and time>=0915000 then open_today=open;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Plot open line in range bar chart

Postby TJ » 09 Dec 2014

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Plot open line in range bar chart

Postby JoshM » 10 Dec 2014

assume market open at 09:15:00
inputs: Price( Close ), Displace( 0 );
variables: Open_today(0);
if time_s>091500 and time_s<=161500 then begin
if time_s[1]<091500 and time>=0915000 then open_today=open;
end;
condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
Plot1[Displace]( open_today, " Open ") ;
I use the above code for generating an open line in range bar chart, however nothing show up. Did I miss something for generating the open line?
count the zeros

Code: Select all

if time_s[1]<091500 and time>=0915000 then open_today=open;
Time returns time in HHmm format while Time_s returns the time with seconds (HHmmss).

So I think the code example either needs to be:

Code: Select all

if time_s[1] < 091500 and time_s >= 91500 then open_today=open
(Time_s in the second if statement expression instead of Time)


or:

Code: Select all

if time_s[1]<091500 and time >= 915 then open_today=open
(No two zeros after `>= 915` if you want to use Time).


Return to “MultiCharts”