Paki Dendo Yth
Saya coba formula yang sudah ditambahkan syntax if sebagaimana di bawah ini, 
tapi hasilnya blank Pak, apakah ada kesalahan copy? Thanks a lot.
_SECTION_BEGIN("Stochastic");//Buka fileinput_file = 
input_folder = 
fh = Name() + ".txt";"vierbox";fopen( input_folder + "\\"+ input_file, "r");if
{
strFile = ( fh )fgets( fh );fclose
strperiods = 
strksmooth = 
strdsmooth = 
strmystochD = 
strmystochK = 
 
periods = 
Ksmooth = 
Dsmooth = 
myStochD=
myStochK=
Overbought=
Oversold=
 
 
}( fh );StrExtract( strfile, 0);StrExtract( strFile, 1);StrExtract( strFile, 
2);StrExtract( strFile, 3);StrExtract( strFile, 4);Param( "Periods", 
StrToNum(strperiods ), 1, 200, 1);Param( "%K avg", StrToNum(strksmooth ), 1, 
200, 1);Param( "%D avg", StrToNum(strdsmooth ), 1, 200, 1);StochD( periods , 
Ksmooth, DSmooth );StochK( periods , Ksmooth);80;20;else//jika file yang mau 
dibuka gak ada, bikin jadi default dan save{printf
periods = 
Ksmooth = 
Dsmooth = 
myStochD=
myStochK=
Overbought=
Oversold=( "error open file");Param( "Periods", 15, 1, 200, 1);Param( "%K avg", 
3, 1, 200, 1);Param( "%D avg", 3, 1, 200, 1);StochD( periods , Ksmooth, DSmooth 
);StochK( periods , Ksmooth);80;20;//saveOutput_file = 
Output_folder = Name() + ".txt";"vierbox";fmkdir
fh = ( Output_folder );fopen( Output_folder + "\\"+ Output_file, "w");fputs( 
NumToStr( periods, 1.0, False ) + ","+ NumToStr( ksmooth, 1.0, False ) + 
","+NumToStr( dsmooth, 1.0, False ) + ","+ NumToStr( Stochastic %D, 1.0, False 
) + ","+NumToStr( Stochastic %K, 1.0, False ) + ",", fh );fclose( fh );fclose
}( fh );if
{
Output_file = 
Output_folder = ( save == 1)Name() + ".txt";"vierbox";fmkdir
fh = ( Output_folder );fopen( Output_folder + "\\"+ Output_file, "w");fputs( 
NumToStr( periods, 1.0, False ) + ","+ NumToStr( ksmooth, 1.0, False ) + 
","+NumToStr( dsmooth, 1.0, False ) + ","+ NumToStr( mystochd, 1.0, False ) + 
","+NumToStr( mystochk, 1.0, False ) + ",", fh );fclose
} ( fh );//end ifBuySell =  = Cross(myStochK, myStochD );Cross( myStochD, 
myStochK );Plot( myStochD, "Stochastic %D"+_PARAM_VALUES( ), colorRed );Plot( 
myStochK, "Stochastic %K", colorBlue );PlotShapes(IIf( Sell, 
shapeHollowDownArro w , shapeNone), colorRed);PlotShapes(IIf( Buy, 
shapeHollowUpArrow , shapeNone), colorGreen);Plot(Overbought,"Overbought 
Level",colorRed);Plot(Oversold,"Oversold Level",colorGreen) ; PlotOHLC( 
myStochK,myStochK, 50,myStochK, "", colorAqua, styleCloud | styleClipMinMax, 
20, 80);PlotOHLC( myStochD,myStochD, 50,myStochD, "", colorPink, styleCloud | 
styleClipMinMax, 20, 80);PlotOHLC( Null,myStochD, myStochK, Null, "", 
colorLightGrey, styleCloud); _SECTION_END( ); 



________________________________
From: Dendo <de...@integrity.co.id>
To: amibroker-4-bei@yahoogroups.com
Sent: Tuesday, April 14, 2009 2:39:47 PM
Subject: RE: [Komunitas AmiBroker] Re: Menyimpan nilai parameter per emiten





Saya bantu jawab ya Adhitya,
 
Saya lihat syntax dibawah ini sudah bisa simpan parameter Stochastic berbeda 
untuk tiap emiten.
Hanya sebelum prosedur save, tambahkan syntax  if( save == 1) (Lihat syntax 
berwarna hijau dibawah)
 
Untuk menyimpan parameter, klik “Save Parameter ?”
Untuk load Parameter yang sudah disimpan, klik “Tombol Reset All” dekat tombol 
“OK”
 
Langkah2 detilnya adalah sbb:
1.      Pilih sebuah emiten misalkan BUMI 
2.      Tentukan parameter stochastic BUMI misalkan 15,5,3 
3.      klik SAVE PARAMETER
4.      Maka parameter stochastic akan disimpan ke dalam sebuah file txt 
didalam folder c:\program files\amibroker\ vierbox ,dengan nama file sesuai 
emitennya misalkan BUMI.txt
5.      Lakukan juga terhadap emiten lain misalkan parameter AALI 15,3,3 lalau 
klik Save Parameter
6.      Apabila kita kembali ke BUMI, kita harus klik tombol Reset All, supaya 
amibroker meload parameter dari file BUMI.txt yaitu 15,5,3.
 
BTW memang Adhit sudah optimized stochasticnya untuk setiap emiten ya ? boleh 
dong di share ke milis (he3x)
 
Maju terus!
Dendo
 
From:amibroker-4- b...@yahoogroups. com [mailto:amibroker- 4-...@yahoogroup 
s.com] On Behalf Of Adhitya
Sent: Sunday, April 12, 2009 9:45 AM
To: amibroker-4- b...@yahoogroups. com
Subject: [Komunitas AmiBroker] Re: Menyimpan nilai parameter per emiten
 
 
Dear Pak Dimaz...

Saya coba utak atik untuk me-lock parameter stochastic yang lebih optimal untuk 
masing2 nama saham... namun ada kendala saat implementasi AFL vierbox untuk AFL 
ini... yaitu parameter tiap stock bisa disave, namun saat stock dibuka data 
parameter menggunakan parameter universal
apakah bapak bisa membantu? berikut adalah AFL untuk buy+sell based on 
stochastic 
_SECTION_BEGIN( "Save" );
save = ParamTrigger( "Save Parameter?", "KLIK DISINI UNTUK SAVE" ) ;
_SECTION_END( ); 

_SECTION_BEGIN("Stochastic");

//Buka file
input_file = Name() + ".txt";
input_folder = "vierbox";
fh = fopen( input_folder + "\\" + input_file, "r" );

if ( fh )
{
strFile = fgets( fh );
fclose( fh );

strperiods = StrExtract( strfile, 0 );
strksmooth = StrExtract( strFile, 1 );
strdsmooth = StrExtract( strFile, 2 );
strmystochD = StrExtract( strFile, 3 );
strmystochK = StrExtract( strFile, 4 );


periods = Param( "Periods", StrToNum(strperiods ), 1, 200, 1 );
Ksmooth = Param( "%K avg", StrToNum(strksmooth ), 1, 200, 1 );
Dsmooth = Param( "%D avg", StrToNum(strdsmooth ), 1, 200, 1 );
myStochD=StochD( periods , Ksmooth, DSmooth );
myStochK=StochK( periods , Ksmooth);
Overbought=80;
Oversold=20;



}
else //jika file yang mau dibuka gak ada, bikin jadi default dan save
{
printf( "error open file" );

periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
myStochD=StochD( periods , Ksmooth, DSmooth );
myStochK=StochK( periods , Ksmooth);
Overbought=80;
Oversold=20;

//save
Output_file = Name() + ".txt";
Output_folder = "vierbox";
fmkdir( Output_folder );
fh = fopen( Output_folder + "\\" + Output_file, "w" );
fputs( NumToStr( periods, 1.0, False ) + "," + NumToStr( ksmooth, 1.0, False ) 
+ "," +
NumToStr( dsmooth, 1.0, False ) + "," + NumToStr( Stochastic %D, 1.0, False ) + 
"," +
NumToStr( Stochastic %K, 1.0, False ) + "," , fh );
fclose( fh );
fclose( fh );

}

if( save == 1 )
{
Output_file = Name() + ".txt";
Output_folder = "vierbox";
fmkdir( Output_folder );
fh = fopen( Output_folder + "\\" + Output_file, "w" );
fputs( NumToStr( periods, 1.0, False ) + "," + NumToStr( ksmooth, 1.0, False ) 
+ "," +
NumToStr( dsmooth, 1.0, False ) + "," + NumToStr( mystochd, 1.0, False ) + "," +
NumToStr( mystochk, 1.0, False ) + "," , fh );
fclose( fh );
} //end if

Buy = Cross(myStochK, myStochD );
Sell = Cross( myStochD, myStochK );

Plot( myStochD, "Stochastic %D"+_PARAM_VALUES( ), colorRed );
Plot( myStochK, "Stochastic %K", colorBlue );

PlotShapes(IIf( Sell, shapeHollowDownArro w , shapeNone), colorRed);
PlotShapes(IIf( Buy, shapeHollowUpArrow , shapeNone), colorGreen);

Plot(Overbought,"Overbought Level",colorRed);
Plot(Oversold,"Oversold Level",colorGreen) ; 

PlotOHLC( myStochK,myStochK, 50,myStochK, "", colorAqua, styleCloud | 
styleClipMinMax, 20, 80 );
PlotOHLC( myStochD,myStochD, 50,myStochD, "", colorPink, styleCloud | 
styleClipMinMax, 20, 80 );

PlotOHLC( Null,myStochD, myStochK, Null, "", colorLightGrey, styleCloud); 

_SECTION_END( ); 
--- In amibroker-4- b...@yahoogroups. com, Dimaz <kij...@...> wrote:
>
> 2009/1/27 alexorcl <alexo...@...>:
> > Halo,
> >
> > Tolong tanya apakah ada yang tahu bagaimanakah kita membuat AFL yg
> > dapat menyimpan nilai parameter tertentu yang berbeda utk tiap emiten.
> > Misalnya:
> > - ASII: MA 10 dan EMA 20
> > - UNTR: MA 12 dan EMA 22
> 
> Cara mudah gak ada pak. Coba liat vierbox untuk contoh cara akal-akalannya.
> 
> > Sehingga dpt di optimize utk tiap emiten dan AFL dapat menampilkan
> > nilai parameter tersebut secara otomatis.
> >
> > Apakah ada yg punya AFL Amibroker utk EquiVolume ?
> >
> 
> Sayang Amibroker sampai saat ini belum support equiVolume.
>
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.47/2047 - Release Date: 04/08/09 
05:53:00



      

Kirim email ke