inssuc:
hi everyone, when i try to draw a line of "(Close-Low)/(High-Low)", i get a very strange result. to my opinion, the line will wave between 0 and 1, but actual result is a straint line, i'm puzzled, can some one explain this?
hi everyone, when i try to draw a line of "(Close-Low)/(High-Low)", i get a very strange result. to my opinion, the line will wave between 0 and 1, but actual result is a straint line, i'm puzzled, can some one explain this?
here is my simple code:
//-----------------------------------------
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 White
double buffer1[];
int CountedBars=0;
int init()
{
SetIndexBuffer(0,buffer1);
return(0);
}
int start()
{
CountedBars=IndicatorCounted();
if(Bars<1) return(0);
for(int i=Bars-CountedBars;i>=0;i--)
{
if( (Close-Low) > 0 && (High-Low) > 0 )
}
}add
if( (Close-Low) > 0 && (High-Low) > 0 )
above : if( (Close-Low) > 0 && (High-Low) > 0 )
like :
{
if( (Close-Low) > 0 && (High-Low) > 0 )
buffer1=(Close-Low)/(High-Low);
}
inssuc:
can High<=Low in sometime?
can High<=Low in sometime?
High may equal Low (first tick of a bar, or volume = 1 bar) then you divide by zero and the indic stops working.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi everyone, when i try to draw a line of "(Close-Low)/(High-Low)", i get a very strange result. to my opinion, the line will wave between 0 and 1, but actual result is a straint line, i'm puzzled, can some one explain this?
here is my simple code:
//-----------------------------------------
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 White
double buffer1[];
int CountedBars=0;
int init()
{
SetIndexBuffer(0,buffer1);
return(0);
}
int start()
{
CountedBars=IndicatorCounted();
if(Bars<1) return(0);
for(int i=Bars-CountedBars;i>=0;i--)
{
buffer1=(Close-Low)/(High-Low);
}
}