Hello Howard, I have the same problem as Mery If I use scan in Amibroker AA then it only outputs the indicator data of the last candle. So each day or hour of the history file provides the same indicator data which is the data of the last candle and only that candle. But Mery and me want to export all the close data of an indicator. But this is not the case with this code. Hope this helps to understand the problem. I edited the code a little bit to export additional info like hour and minute. Also changed the decimal place for currency quotes (so that MAs are exported with 5 digits for example). The only problem is that it exports the data of last candle only. I need to say that I'm a AFL beginner. /* Export indicators by: <jmerriland-/e1597as9lqavxtiumw...@public.gmane.org> */ fileout = fopen( "F:\\"+Name()+".txt", "w"); if( fileout ) { fputs( "Ticker | Date |MACD \n", fileout ); y = Year(); m = Month(); d = Day(); H1 = Hour(); M1 = Minute(); for( i = 0; i < BarCount; i++ ) { fputs( Name() + "|" , fileout ); dateouts = StrFormat("%01.0f/%02.0f/%02.0f %02.0f:%02.0f|",y[ i ], m[ i ], d[ i ], H1[ i ], M1 [i] ); indicator0uts = StrFormat("%.5f|%.5f\n",MACD(),Signal()); fputs( dateouts , fileout ); fputs( indicator0uts,fileout ); } fclose( fileout ); } Buy = 0; --- In amibroker@yahoogroups.com, Howard B <howardba...@...> wrote: > > Hi Mery -- > > I ran your code and it worked fine. > > Describe again what you are seeing when you run this code and what you think > you should see. > > Thanks, > Howard > > On Thu, Sep 24, 2009 at 3:07 AM, mery <jmerril...@...> wrote: > > > > > > > Dear sirs. > > I want to export indicators in amibroker and i write with > > this program But output is Last indicators? > > please help me: > > how do i export for each day ? > > ------------------ > > /* Export indicators by: <jmerril...@... <jmerriland%40yahoo.com>> > > */ > > fileout = fopen( "f:\\"+Name()+".txt", "w"); > > > > if( fileout ) > > { > > fputs( "Ticker | Date |macd \n", fileout ); > > y = Year(); > > m = Month(); > > d = Day(); > > > > for( i = 0; i < BarCount; i++ ) > > { > > fputs( Name() + "|" , fileout ); > > dateouts = StrFormat("%01.0f/%02.0f/%02.0f|",y[ i ], m[ i ], d[ i ] ); > > > > indicator0uts = StrFormat("%.1f|%.1f\n",MACD(),Signal()); > > fputs( dateouts , fileout ); > > fputs( indicator0uts,fileout ); > > } > > > > fclose( fileout ); > > } > > > > Buy = 0; > > > > > > >