Who has extra buffer? or half? 4 Rsioma - page 3

 
fxbs:
This means - Kalenzo gives GreenLight on arsioma v3 your version, Mladen!

Sure. Mladen is doing well.

 
mladen:
The latest version of RSIOMA

Yepp - BarCount, buff. EmptyVal - all here

Thank You, Mladen!

Let me jus put Signal in our pretty buffer and our beloved Rsioma got brand new v3 - Voala!

Thanks again, Mladen!

P/S. & pretty informative thread (HowTo - opening PandoraBox), don't u think?

 

...

fxbs:
Yepp - BarCount, buff. EmptyVal - all here

Thank You, Mladen!

Let me jus put Signal in our pretty buffer and our beloved Rsioma got brand new v3 - Voala!

Thanks again, Mladen!

P/S. & pretty informative thread (HowTo - opening PandoraBox), don't u think?

O yeah

 

not that box, other box

 

OK, 11 temp. versions later, final cut:

____________________

extern int RSIOMA = 14;

extern int RSIOMA_MODE = MODE_EMA;

extern int RSIOMA_PRICE = PRICE_CLOSE;

extern int Ma_RSIOMA = 21;

extern int Ma_RSIOMA_MODE = MODE_EMA;

extern int BarsToCount = 500;

//---- buffers

// "fake indexes"

double MABuffer1[];

double RSIBuffer1[];

// indexes

double RSIBuffer[];

double marsioma[];

int correction;

datetime lastBarTime;

string short_name;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

short_name = StringConcatenate("RSIOMA[",RSIOMA,"](",Ma_RSIOMA,")");

IndicatorShortName(short_name);

SetIndexBuffer(0,RSIBuffer);

SetIndexBuffer(1,marsioma);

// additional buffer(s)

correction = RSIOMA+RSIOMA+Ma_RSIOMA;

BarsToCount = MathMin(Bars,MathMax(BarsToCount,300));

ArrayResize( MABuffer1 ,BarsToCount+correction);

ArrayResize( RSIBuffer1,BarsToCount+correction);

ArraySetAsSeries(MABuffer1 ,true);

ArraySetAsSeries(RSIBuffer1,true);

lastBarTime = EMPTY_VALUE;

return(0);

}

//+------------------------------------------------------------------+

int start()

{

static bool init=false;

int counted_bars=IndicatorCounted();

int limit,i=0;

if(counted_bars<0) return(-1);

if(lastBarTime != Time[0]) {

lastBarTime = Time[0];

counted_bars = 0;

}

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

limit=MathMin(limit,BarsToCount+correction);

for(i=limit;i>=0;i--)

MABuffer1 = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,i);

for(i=limit;i>=0;i--)

RSIBuffer1 = iRSIOnArray(MABuffer1,0,RSIOMA,i);

for(i=limit;i>=0;i--)

{

RSIBuffer= RSIBuffer1;

marsioma = iMAOnArray(RSIBuffer1,0,Ma_RSIOMA,0,Ma_RSIOMA_MODE,i);

}

for (i=0;i<indicator_buffers;i++) SetIndexDrawBegin(i,Bars-BarsToCount);

return(0);

}

//The End +------------------------------------------------------------------+

Files:
 

Extra buffers (need more thsan 8)?

Some article Multiple Null Bar Re-Count in Some Indicators - MQL4 Articles

and Igorad's indicator https://www.mql5.com/en/forum/175733/page2

Or read whole thread https://www.mql5.com/en/forum/175733

Just for information.

 

thank you, ND

good info and links +

- how to add extra buffer (Omelette, Kalenzo) examples

- it's not always necessary add extra buffers - IgorAd's Decema version

 

hopefully some day we can cheat MT4 and add extra color buffer (not object)!

 

man ... i still can't believe what i see - and how simply it put...

...that's scary...

 

...

Actually we, meaning the users of MetaTrader, do need extra buffers for drawing

For calculation there is no limitation whatsoever

Just for the fun of it I post an indicator that is calculating multiple mas (meaning ma of an ma of an ma...) to the level you like it and does it by using buffers - 8 buffers for every 7 levels (first picture), so, with default parameters it uses 28 buffers

Drawing is another thing

If we do not want to use objects to draw values, we are limited to just 8 buffers

Thing like the second "indicator" I post are absolutely impossible in MetaTrader if one wants to use just buffers (second picture)

Just for emas on that chart you would need 27 buffers (RSI on the bottom theoretically achieves 100 shades of red and 100 shades of green, making it draw would need thus at least 200 buffers more) and all that is simply not possible in MetaTrader

What we need is, in my opinion, and I stated it a couple of times, a plot routine that would change the logic of using buffers for drawing (it is really not difficult to imagine how one could retrieve past values)

The number of buffers we can circumvent one way or another, but drawing the way we are forced to do it, is becoming a pain in the ass

PS : none of the indicators posted here is ment to be used in trading

They are posted here only as a demonstration of the things I said in the post

Files:
buffers_1.gif  12 kb
buffers_2.gif  16 kb
Reason: