Hi,

 

You can try this one:

 

void VPlot( int NumArgs, AmiVar *ArgsTable )
{
         AmiVar arg[ 8 ];
         arg[ 0 ].type = VAR_ARRAY;
         arg[ 0 ] = ArgsTable[ 0 ];

         arg[ 1 ].type = VAR_STRING;
         arg[ 1 ].string = ArgsTable[ 1 ].string;

         arg[ 2 ].type = VAR_FLOAT;
         arg[ 2 ].val = ArgsTable[ 2 ].val;

         arg[ 3 ].type = VAR_FLOAT;
         arg[ 3 ].val = ArgsTable[ 3 ].val;

         arg[ 4 ].type = VAR_FLOAT;
         arg[ 4 ].val = ArgsTable[ 4 ].val;

         arg[ 5 ].type = VAR_FLOAT;
         arg[ 5 ].val = ArgsTable[ 5 ].val;

         arg[ 6 ].type = VAR_FLOAT;
         arg[ 6 ].val = ArgsTable[ 6 ].val;

         arg[ 7 ].type = VAR_FLOAT;
         arg[ 7 ].val = ArgsTable[ 7 ].val;

         AmiVar result = gSite.CallFunction( "Plot", 8, arg );
}

 

Let me know.

 

Best regards.

 

Jorge Luis

 

De: [email protected] [mailto:[email protected]] Em nome de
ronald davis
Enviada em: quinta-feira, 19 de agosto de 2010 14:14
Para: amibroker tips
Assunto: [amibroker] How to use Plot from plugin dll

 

  

I just now started to learn programming.
 
I tried many times to add "Plot" to the FunctionTag gFunctionTable[], 
but Visual Studio  always  complained. 

I would appreciate receiving code with source code  
that calls Plot ,so I can add it to my AFL plugin 
dll>FunctionTag gFunctionTable[]

If anyone is interested in my AFL plugin with source code,
let me know, and I will be happy to post it.
The called indicators are Stochk, StochD, RMI, PDI, ADX. 
Here is how these dll called indicators appear in a formula 
editor chart pane>xStochK();xStochD();xPDI();xADX();xRMI();
----------------------------------------------------------------------------
--------
I then added k=, d=, pi=,x=,and m= to these plugin 
called xIndicators.
k=xStochK();d=xStochD();pi=xPDI();x=xADX();m=xRMI();
km=(k+m)/2;kdm=(k+d+m)/3;kd=(k+d)/2;xpd(x+pi+d)/3;
xd=(x+d)/2;xpi=(x+pi)/2;kd=(k+d)/2;dm=(d+m)/2;kd=(k+d)/2;
----------------------------------------------------------------------------
--------
I then commented out the built-in Amibroker indicators, 
and these xIndicators caused my smoothing algorithms 
to still plot the  same algorithm smoothed lines.
Thanks for any help,  Ron D
----------------------------------------------------------------------------
--------
I saved Dimaz's Jul 20, 2010 at 11:08 AM post entitled>"How to use Plot from
plugin dll".
I just now went to the  message board, to look for possible followup posts,
and FWIW  
Dimaz's post is no longer at this July 20 messages link. 
http://finance.groups.yahoo.com/group/amibroker/messages/151240?viscount=-30
<http://finance.groups.yahoo.com/group/amibroker/messages/151240?viscount=-3
0&l=1> &l=1

Dimaz asked>'What is the correct format of using Plot in plugin dll?
I try this code below, which partially works. But only array,
color,xshift and zorder seems to agree on input. The others seem to
completely ignore them. It puzzles me.
Thanks for you patience and help,
Dimaz

AmiVar VmyPlot( int NumArgs, AmiVar *args ) {

AmiVar close = gSite.GetVariable( "Close" );
AmiVar colorYellow = oneValArray( 42 ); //<--- AmiVar array of number 42

AmiVar plotArg[8];
plotArg[0] = close;//price
plotArg[1].string = "my plot";//name string
plotArg[2] = colorYellow;//color
plotArg[3].val = 2 ;//style
plotArg[4].val = 0;//minValue
plotArg[5].val = 0;//maxValue
plotArg[6].val = 0; //Xshift
plotArg[7].val = 0; //zorder
AmiVar result = gSite.CallFunction( "plot", 8, plotArg );
return result;
}
FunctionTag gFunctionTable[] = {
"myPlot", { myPlot, 0, 0, 0, 0, NULL }
};



Reply via email to