First of all I have to say that is not my code. If it ever was, it has been changed so much that it is no longer representative of any code that I would write.
int last_Red_Line_Cross_index=1;
iMA(Symbol(),Red_Line_Period,5,0,MODE_SMA,PRICE_CLOSE,last_Red_Line_Cross_index-2) ////
Never usecalculations that can give negative index values. index[-1] does not exist
You are looking for a cross by comparing [index+1] to [index-2]. That doesn't make sense as you should be comparing consecutive bars
If you don't want the line to show in subwindows, use a trend line instead
First of all please apologise me for my language .
and As usual you are very helpful Mr.GumRai. and please do not misunderstand me. I mean by that the idea behind the code how to find the moving average across, You wrote a code to find the last red candle. and from that I change the code. it seems to be worked and it plot the line exactly where the moving average across.
I know as every body knows here you are one of the professional coder's.
Thanks again
and As usual you are very helpful Mr.GumRai. and please do not misunderstand me. I mean by that the idea behind the code how to find the moving average across, You wrote a code to find the last red candle. and from that I change the code. it seems to be worked and it plot the line exactly where the moving average across.
I know as every body knows here you are one of the professional coder's.
Thanks again

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,
With the help of Mr. GumRai Code I try to modify the code to get VLine when iMA Crossed.
First I would like to know about professional coder opinion. Is this the right way for writing code?
Second I have question about the VLine. How to stop the line to not drawing in subwindow?