Skip to content
View in the app

A better way to browse. Learn more.

#T/N/X/T

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Exportformat von historischen Daten

Hallo Amibroker Gemeinde,

 

Ich habe eine Problem mit dem Exportformat von Amibroker.

 

Wenn ich zum Beispiel 1 Minuten Historie exportieren will, dann gibt er mir das foldendermaßen aus:

 

Ticker, Date/Time, Open, High, Low, Close, Volume, Open Interest

EURUSD,05.06.2009 03:58:00,1.42029,1.42036,1.42029,1.42036,0,0

 

Ich benötige aber folgendes, weil Tradestation sonst nicht importiert:

 

Date, Time, Open, High, Low, Close , Volume, Open Interest

 

Folgenden AFL Code verwende ich

 

Filter=1; 
AddColumn(O,"Open",format = 1.5); 
AddColumn(H,"High",format = 1.5); 
AddColumn(L,"Low",format = 1.5); 
AddColumn(C,"Close",format = 1.5); 
AddColumn(V,"Volume",1.0); 
AddColumn(OI,"Open Interest",1.0);

 

Format = 1.5 bestimmt, wieviele Nachkommastellen ausgegeben werden sollen.

 

Danke für eventuelle Antworten!

Edited by joshsmi

Featured Replies

  • Author

Ich habe es vor Tagen folgendermaßen gelöst.

 

fmkdir( "C:\\OHLC" );
Buy = ( (DateNum() >= 1050101) AND (DateNum() <= 1090828) );
for( i = 0; i < BarCount; i++ )
if( Buy[i] )
{
 fh = fopen( "C:\\OHLC\\OHLC.txt", "a"); 
 if( fh ) 
  { 
 y = Year(); 
 m = Month(); 
 d = Day(); 
 r = Hour();
 e = Minute();
  
  for( i = 0; i < BarCount; i++ )
  if( Buy[i] )

  { 
  fputs( Name() + "," , fh );
  ds = StrFormat("%02.0f.%02.0f.%02.0f,", 
				 y[ i ], m[ i ], d[ i ] ); 
  fputs( ds, fh ); 
 
  ts = StrFormat("%02.0f:%02.0f,", 
				 r[ i ],e[ i ]); 
  fputs( ts, fh ); 

  qs = StrFormat("%.5f,%.5f,%.5f,%.5f,%.0f\n", 
				 O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
  fputs( qs, fh );
  }
  fclose( fh );
  }
}

 

Mit oberem Code habe ich es exportiert, aber Amibroker fügt trotzdem den Ticker mit hinzu, womit Tradestation dann aber nicht zurechtkommt.

 

Dann habe ich halt Excel 2007 (nimmt mehr als 1 Million Zeilen auf) genommen und die Spalte dort gelöscht.

Edited by joshsmi

  • 1 year later...
  • Author

aber Amibroker fügt trotzdem den Ticker mit hinzu, womit Tradestation dann aber nicht zurechtkommt.

 

Dann habe ich halt Excel 2007 (nimmt mehr als 1 Million Zeilen auf) genommen und die Spalte dort gelöscht.

 

 

Damals war ich noch ein blindes Dummerle. :puppy:

 

Einfach fputs( Name() + "," , fh ); "löschen". Dann wird kein Ticker reingeschrieben.

fopen ist noch abgeändert für den jeweiligen Ticker. Zu exportierender Zeitraum von ... bis wird in der zweiten Zeile festgelegt.

 

fmkdir( "C:\\Export" );
Buy = ( (DateNum() >= 1100101) AND (DateNum() <= 1200131) );

for( i = 0; i < BarCount; i++ )

if( Buy[i] )
{
 fh = fopen( "C:\\Export\\" + Name() + ".csv", "a"); 
 if( fh ) 
  { 
        y = Year(); 
        m = Month(); 
        d = Day(); 
        r = Hour();
        e = Minute();
  
  for( i = 0; i < BarCount; i++ )
  if( Buy[i] )

  { 
         //fputs( Name() + "," , fh );
         ds = StrFormat("%02.0f.%02.0f.%02.0f,", y[ i ], m[ i ], d[ i ] ); 
         fputs( ds, fh ); 
        
         ts = StrFormat("%02.0f:%02.0f,",  r[ i ], e[ i ]); 
         fputs( ts, fh ); 

         qs = StrFormat("%.5f,%.5f,%.5f,%.5f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] ); 
         fputs( qs, fh );
  }
         fclose( fh );
  }
}

:ot:

Gratulation zum hart erarbeiteten Erfolg :10points:

 

Kenne mich mit der Thematik zwar nicht aus, weiß aber das man sich nach stunden - und Tage langer Arbeit wie ein

kleines Kind freuen kann (und auch sollte) wenn es dann endlich wie gewollt funktioniert. :door:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.