Don't copy and paste code repeatedly. Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. | bool ArrowExistBuy = ((iCustom(NULL, 0,"Divergence", …,1)>0 && iCustom(NULL, 0,"Divergence", …,1)!=EMPTY_VALUE) || (iCustom(NULL, 0,"Divergence", …,2)>0 && iCustom(NULL, 0,"Divergence", …,2)!=EMPTY_VALUE) ⋮ |
Simplify by factoring. Is bullishDivergence a buffer index? | double getDiv(int i){ return iCustom(NULL, 0, "Divergence", RSI_period, RSI_applied_price, LongArrowCode, ShortArrowCode, ArrowSize, RSIStyle, RSIWidth, bullishDivergence, i); } bool ArrowExistBuy = ((getDiv(1)>0 && getDiv(1)!=EMPTY_VALUE) || (getDiv(2)>0 && getDiv(2)!=EMPTY_VALUE) ⋮ |
Make it a loop | bool ArrowExistBuy = false; for(int i=1; i <= 50 && !ArrowExistBuy; ++i){ double value = getDiv(i); ArrowExistBuy = value>0&&value != EMPTY_VALUE; } |
William Roeder:
=
Yes sir Don't copy and paste code repeatedly. Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. | |
Simplify by factoring. Is bullishDivergence a buffer index? | |
Make it a loop |
It's a buffer index
Tolotra Ny:
Yes sir
Yes sir
It's a buffer index
I assume that that last number is a shift value, so it could easlily be made into a loop. a loop would defintely make it more readable! haha
Revo Trades: I assume that that last number is a shift value,
Assume? Why don't you read the documentation?

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
Thanks in advance sir