[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Export data and AddToComposite fails on Renko chart



PureBytes Links

Trading Reference Links



Hello,
 
Im trying to export Renko data values based on GSPC (SP500) ticker.
The Renko  chart is displayed fine.
The problem is that exported   renkoquotes.csv file  contains empty values. 
 
Next    I have    tried  AddToComposite and it  fails to load Renko values  in composite.
 
Does anyone  have clue why is this happening?
 
Any help would be appreciated how to solve this.
 
Drazen
 
 
PS  ------------  Please see   AFL code below
 
 
 
// Renko  Chart 2nd
// Graham Kavanagh  13 Aug 2004 ver D
// Custom Indicator, date axis does not apply
 
SetBarsRequired(10000,10000);
ATRdivisor=Param(" ATR divisor ",1,0.1,10,0.1);
Brick=5;
 
//reverse =1;
REVERSE=Param("Rev",3,1,10,1);
// Convert the closing price to rising and falling rounded bricks
CF = ceil(C/Brick);CR = floor(C/Brick);
 

// initialize first element
j = 0;
RKC[j] = CF[0];
RKO[j] = CF[0] + 1;
 
down[j] = 1;  // By default the first bar is a down bar.
up[j] = 0;
 
// Loop to produce the Renko values in number of bricks
 
for( i=1; i<BarCount-1; i++ )
{
if( CF[i] <= RKC[j] - 1 && down[j] ) // Continue down
{
num = RKC[j] - CF[i];
for( x=1; x<=num; x++ )
{
j++;
up[j] = 0;
down[j] = 1;
RKC[j] = RKC[j-1] - 1;
RKO[j] = RKC[j] + 1;
}
}
else
{
if( CR[i] >= RKC[j] + Reverse && down[j] )  // Change downto up
{
num = CR[i] - RKC[j];
j++;
up[j] = 1;
down[j] = 0;
RKC[j] = RKC[j-1] + 2;
RKO[j] = RKC[j] - 1;
for( x=2; x<=num; x++ )
{
j++;
up[j] = 1;
down[j] = 0;
RKC[j] = RKC[j-1] + 1;
RKO[j] = RKC[j] - 1;
}
}
else
{
if( CR[i] >= RKC[j] + 1 && up[j] ) // Continue Up
{
num = CR[i] - RKC[j];
for( x=1; x<=num; x++ )
{
j++;
Up[j] = 1;
Down[j] = 0;
RKC[j] = RKC[j-1] + 1;
RKO[j] = RKC[j] - 1;
}
}
else
{
if( CF[i] <= RKC[j] - Reverse && up[j] )  //Change up to down
{
num = RKC[j] - CF[i];
j++;
Up[j] = 0;
Down[j] = 1;
RKC[j] = RKC[j-1] - 2;
RKO[j] = RKC[j] + 1;
for( x=2; x<=num; x++ )
{
j++;
up[j] = 0;
down[j] = 1;
RKC[j] = RKC[j-1] - 1;
RKO[j] = RKC[j] + 1;
}
}
}
}
}
}
 

// move the chart to right end of chart space, ie last brick on last barposition
delta =  BarCount-1 - j;
 
RKC = Ref( RKC, -delta );
RKO = Ref( RKO, -delta );
 
Up = Ref( Up, -delta );
Down = Ref( Down, -delta );
 
 
 
rC = RKC * Brick;
rO = RC - (Up-down)*Brick;
rH = Max(rC,rO);
rL = Min(rC,rO);
 
PlotOHLC( rO, rH, rL, rC, " RENKO 2nd " , 53, 64);
 
 
 
 
// THIS FAILS TO LOAD  RENKO VALUES IN COMPOSITE
/*
Buy=0;Sell=0;
AddToComposite(rC,"~Renko","C");
PlotForeign("~Renko","Renko",3,1);
*/
 
//  THIS FAILS TO EXPORT    RENKO VALUES
/* 
//  The following code exports quotes

fh = fopen( "renkoquotes.csv", "w");
if( fh )
{
   fputs( "RenkoClose", fh );
 

   for( i = 0; i < BarCount; i++ )
   {
     
    
      qs = StrFormat("%.4f, ", rC[ i ]);
      fputs( qs, fh );
   }
 
   fclose( fh );
}
 
 
 

 
 
 
 


__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___