but when the price hit my lower bollinger, it didn't open any order.
Your code talks about . . . . // hit upper bollinger or pass
oh, sorry, my mistake...mistype
i mean when it hit or pass the upper bollinger, it should have open a position, but the fact, it doesn't. It should wait until the price pass through far from the upper bollinger then it would open the position
any idea?
Hi there,
i want to ask simple question, i've been searching through this error for quite a long time
my code is
but when the price hit my lower bollinger, it didn't open any order.
when the price go down further, then the order is opened..i wonder why when it hit my lower bollinger, it didn't open any order as what i coded down. only if it pass far then it would open the position.
can anyone help me?
if(iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,0)>=Close[0]) // <--- now it will hit or pass >= not <=
I think you ment to do this >=. Also, Close[0]? Isn't that the bar you are on which has not closed yet, I think you want Close[1] which should be the same price as Open[0].
actually what i mean by using Close[0] is because i want to refer to the running price. If i use Close[1] or Open[0], then it would return me the Close price for the previous bar, right?
Also for >=, then the condition would be fullfilled all the time if the price stay under the upper bollinger, is it?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
i want to ask simple question, i've been searching through this error for quite a long time
my code is
but when the price hit my lower bollinger, it didn't open any order.
when the price go down further, then the order is opened..i wonder why when it hit my lower bollinger, it didn't open any order as what i coded down. only if it pass far then it would open the position.
can anyone help me?