Simple Coding Help - No Promise.

Code:
Plot(SelectedValue(C), "Price2", colorDefault, stylenolabel|styleline,0,0,10);
hello,
I put this code
Code:
Plot( C, "Price", colorDefault, styleCandle );
bullcandle = C > O;
// How to draw horizontal line close of bullcandle?
HourH = TimeFrameGetPrice("H", inHourly, -1);
HourL = TimeFrameGetPrice("L", inHourly, -1);  
HourO = TimeFrameGetPrice("O", inHourly, -1);  
HourC = TimeFrameGetPrice("C", inHourly, -1);  
  //
Plot(HourC,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);

Plot(SelectedValue(HourC), "Price2", colorDefault,styleDots|stylenolabel|styleline,0,0,10);
//Plot(SelectedValue(C), "Price2", colorDefault,styleDots|stylenolabel|styleline,0,0,10);
//I have checked with both HourC and C ..
it's not showing horizontal line close of bull candle.. I've just added styleDots|.. checked it with or without,
I think it not going to work out same way as h,l,o,c picking each one..
//if it need barcount loop i can add it .. I think, it is not needed.
//HourC or C is only used .. it only shows Close of hour candle..
Not the close of Bull Candle..
speciality about these lines .. their values not going to change,whatever timeframe you're seeing..
 
Last edited:
hello,
I put this code
Code:
Plot( C, "Price", colorDefault, styleCandle );
bullcandle = C > O;
// How to draw horizontal line close of bullcandle?
HourH = TimeFrameGetPrice("H", inHourly, -1);
HourL = TimeFrameGetPrice("L", inHourly, -1);  
HourO = TimeFrameGetPrice("O", inHourly, -1);  
HourC = TimeFrameGetPrice("C", inHourly, -1);  
  //
Plot(HourC,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);

Plot(SelectedValue(HourC), "Price2", colorDefault,styleDots|stylenolabel|styleline,0,0,10);
//Plot(SelectedValue(C), "Price2", colorDefault,styleDots|stylenolabel|styleline,0,0,10);
//I have checked with both HourC and C ..
it's not showing horizontal line close of bull candle.. I've just added styleDots|.. checked it with or without,
I think it not going to work out same way as h,l,o,c picking each one..
//if it need barcount loop i can add it .. I think, it is not needed.
//HourC or C is only used .. it only shows Close of hour candle..
Not the close of Bull Candle..
speciality about these lines .. their values not going to change,whatever timeframe you're seeing..

I showed you how to draw a horizontal line for close price

Now where's the logic to show only for bull candle in your latest code

you had that in your question C > O

replace C with iif(C>O,C,Null)


Happy :)
 
I showed you how to draw a horizontal line for close price

Now where's the logic to show only for bull candle in your latest code

you had that in your question C > O

replace C with iif(C>O,C,Null)


Happy :)
Code:
Plot( C, "Price", colorDefault, styleCandle );
bullcandle = C > O;
// How to draw horizontal line close of bullcandle?
HourH = TimeFrameGetPrice("H", inHourly, -1);
HourL = TimeFrameGetPrice("L", inHourly, -1);  
HourO = TimeFrameGetPrice("O", inHourly, -1);  
HourC = TimeFrameGetPrice("C", inHourly, -1);  
  //
Plot(C,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
//Plot(HourC,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  I've tried HourC also

Plot(SelectedValue( iif(C>O,C,Null)), "Price2", colorDefault,styleDots|stylenolabel|styleline,0,0,1
I've tried it, it's not working.

I also tried by changing
Code:
bullcandle = HourC > HourO;
//Plot(C,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);

Plot(SelectedValue(iif(bullcandle,HourC,Null)), "Price2", colorDefault,styleNoRescale|styleNoTitle);
If possible, kindly check in software
 
I've tried it, it's not working.

I also tried by changing
Code:
bullcandle = HourC > HourO;
//Plot(C,"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);

Plot(SelectedValue(iif(bullcandle,HourC,Null)), "Price2", colorDefault,styleNoRescale|styleNoTitle);
If possible, kindly check in software
Code:
if( SelectedValue(C>O))  Plot(SelectedValue(C),"Price2", colorLightGrey,styleNoLabel|styleLine,0,0,10);
another way is

Code:
Plot(SelectedValue(C),"Price2", IIf(SelectedValue(C>O),colorBlueGrey,GetChartBkColor()),styleNoLabel|styleLine,0,0,10);
Similarly can also use it, with your HourC/O


Happy :)
 
hi is it possible to code floor pivot point (H+L+C)/3 of last 12 bars and line to be plotted on next 12 bars irrespective of date change.

kindly help.

regds,s
This 12 bars FP will change for every bar, as every bar will have a different close, anyway . . .

Code:
FP12 = (HHV(H,12)+LLV(L,12)+C)/3;
or

Code:
FP12 = (Ref(HHV(H,12)+LLV(L,12),-1)+C)/3;

Happy :)
 
Code:
if( SelectedValue(C>O))  Plot(SelectedValue(C),"Price2", colorLightGrey,styleNoLabel|styleLine,0,0,10);
another way is

Code:
Plot(SelectedValue(C),"Price2", IIf(SelectedValue(C>O),colorBlueGrey,GetChartBkColor()),styleNoLabel|styleLine,0,0,10);
Similarly can also use it, with your HourC/O


Happy :)
hello,
it's not working, checked with C and hourc/o


I want to draw horizontal line like upper pic.
,styleDots|styleNoLine|styleNoRescale|styleNoTitle
this draw dots ,we need to use it.

I don't know , what's going wrong ?
 
hello,
it's not working, checked with C and hourc/o

I want to draw horizontal line like upper pic.
,styleDots|styleNoLine|styleNoRescale|styleNoTitle
this draw dots ,we need to use it.

I don't know , what's going wrong ?
Ok,

The code posted by me draws one horizontal line across the chart for last bull candle and nothing if its a bear or doji

But now not sure what exactly is your requirement, anyway will give it one more try

Code:
Plot(IIf(C > O, C, Null),"Price2", colorLightGrey,styleNoLabel|styleThick|styleStaircase,0,0,1);

Code:
HourO = TimeFrameGetPrice("O", inHourly, -1);  
HourC = TimeFrameGetPrice("C", inHourly, -1);  
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);


one more version

Code:
/*
HourO = TimeFrameGetPrice("O", inHourly,0,expandFirst);
HourC = TimeFrameGetPrice("C", inHourly,0,expandFirst);
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
*/
HourO = TimeFrameGetPrice("O", inHourly,0,expandLast);
HourC = TimeFrameGetPrice("C", inHourly,0,expandLast);
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Happy :)
 
Last edited:

Similar threads