Indicator Miscellaneous Questions - page 14

 
Max Enrik: I just need to Draw one of latest " Arrow ", no need to draw ten thousand Arrow on my chart.
No need to not draw them. What are you going to do when new bars form? Go back and delete the old ones? After the first run you are only going to be processing bar zero anyway. See How to do your lookbacks correctly.
 
whroeder1:
No need to not draw them. What are you going to do when new bars form? Go back and delete the old ones? After the first run you are only going to be processing bar zero anyway. See How to do your lookbacks correctly.

Thanks a lot.

 

#Only One Draw Arrow - Closed

 Answer is:  No need to draw " Arrows " by the DRAW_ARROW, need to draw objects at the condition.

 

#Buffer ( array out of range in ) - Open

I try below code and it gives me fatal error: " array out of range in ", am I doing wrong? If yes, then how can I solve it, please?

Thanks in advance.

bufferOne[i]=iMA(Symbol(),0,26,0,MODE_EMA,PRICE_CLOSE,i);
bufferTwo[i]=bufferOne[i+1];
 
Max Enrik: am I doing wrong? If yes, then how can I solve it, please?
  1. Obviously. You are looking past the end of the array.
  2. Do your lookbacks correctly.
 
whroeder1:
  1. Obviously. You are looking past the end of the array.
  2. Do your lookbacks correctly.

OMG! Why I do not use that great example just for my this concern. ( even I used that great example for my other issues )

Please let me what could I write for lookback.

int lookback = ?; // I do not know what could I write here.
for(int i = Bars-1-MathMax(lookback, prev_calculated); i >= 0; --i)
{
    bufferOne[i]=iMA(Symbol(),0,26,0,MODE_EMA,PRICE_CLOSE,i);
    bufferTwo[i]=bufferOne[i+1];
}
 
int lookback = ?; // I do not know what could I write here.
for(int i = Bars-1-MathMax(lookback, prev_calculated); i >= 0; --i)
{
    bufferOne[i]=iMA(Symbol(),0,26,0,MODE_EMA,PRICE_CLOSE,i);
    bufferTwo[i]=bufferOne[i+1];
  1. Did you read the link provided? Look again at the very first box:
    int lookback = ... // iMA(period) has look back of period.
                       // buffer[i+2] has look back of 2 (as TimeSeries)
                       // buffer[i-2] has look back of 2 (not TimeSeries)
                       // use maximum of all.
  2. You have 26 for the iMA and 1 for the [i+1]. What do you think the maximum is?
 
whroeder1:
  1. Did you read the link provided? Look again at the very first box:
  2. You have 26 for the iMA and 1 for the [i+1]. What do you think the maximum is?

Of course, I already read and I tried your great example, I did not get good results that is why I asked about that.
Since your previous comment I try new indicator just for try your example. I hope I will do something good separately ( then I will combine them ).

( if I won't get good results I will post whole code )

Thanks a lot.

 

Haha! Thanks a lot Mr. William. What a wonderful results. Awesome! Huge thanks!

 

I use OnCalculate() with " int " now I need to ask, which is good for this type of indicators, int or void, please?

Thanks in advance.

int OnCalculate(...) {}