Custom database with custom tickers. Is it possible ? - AmiBroker | futures io social day trading
futures io futures trading


Custom database with custom tickers. Is it possible ?
Updated: Views / Replies:1,993 / 4
Created: by enjoyaol Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Custom database with custom tickers. Is it possible ?

  #1 (permalink)
Elite Member
Paris, France
 
Futures Experience: Intermediate
Platform: MT4, Amibroker, Custom
Favorite Futures: EUR/USD
 
Posts: 44 since Jan 2012
Thanks: 5 given, 26 received

Custom database with custom tickers. Is it possible ?

Hello,
I have generated fantasy data (1000 stocks) in CSV files. These 1000 stocks are not realy one and their tickers are not real ones.

Importing one file is OK, manually using the custom ascii import (I have made a special .format file).

What would be an easy way (using maybe an external software ?) to create a custom database containing the list of tickers (I have) + the CSV files (I have) ?

The goal is to be able to update a CSV file I have and directly see the new charts in amibroker without having to import manually using the ascii import menu. I hope I don't have to create a data plugin using C++ to achieve that ? I could not post this question to the amibroker yahoo group as I'm not a customer yet.

Thanks!

Reply With Quote
 
  #2 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received

Simplest is probably scripting something in AutoHotKey to duplicate the interactions needed to import them one at a time, and use it to automate the process.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #3 (permalink)
Elite Member
Paris, France
 
Futures Experience: Intermediate
Platform: MT4, Amibroker, Custom
Favorite Futures: EUR/USD
 
Posts: 44 since Jan 2012
Thanks: 5 given, 26 received


This seems simple but very slow. I wonder if there is some mechanizm in amibroker to do that without automating the UI ?

Reply With Quote
 
  #4 (permalink)
Elite Member
Italy
 
Futures Experience: Beginner
Platform: AmiBrojer,NinjaTrader,ProRealTime
Favorite Futures: STOXX
 
Posts: 7 since Feb 2011
Thanks: 148 given, 4 received

Yes you can use OLE (not too fast, but ..)

The following is just an example using VBS; obviously could be written in Javascript, or Python
(sorry comments are in italian) :

'
' ManageQUANDL
' @info effettua il download e l'import dei dati QUANDL
' Aggiorna il database QuandlEOD
'
' @param sDISCO una stringa che indica il disco in cui risiedono i dati finanziari
' @param oLOG TextStream Object del di log da usare
'
' NOTA : il campo Address deve contenere :
' STOXX,indexID (ossia nome dell'indice stoxx e del file)
'
PUBLIC SUB ManageQUANDL(sDISCO,oLOG)
'
CONST sQUANDLBaseArchiv = "\FINANZA\OTHERS_DATA\QUANDL\"
CONST sQUANDLBaseURL = "http://www.quandl.com/api/v1/datasets/"
CONST sQUANDLAuthURL = "?&auth_token="
CONST sQUANDLEndPartURL = "&sort_order=desc"
'
DIM oAB,oSTOCKS,oStock,sAddress,sURL,sFileTicker,sAmiBrokerFILE
' invia msg apertura
SET oSHELL = CreateObject("WScript.Shell")
iResp = oSHELL.popup("Start Manage QUANDL",1,G_sTITOLO,0)
SET oSHELL = NOTHING
'
oLOG.WriteLine(""+Cstr(Now()) + " Start QUANDL Import")
'
' ottieni FileSystemScripting per creare directory dati (se non esiste)
SET oFSO = CreateObject("Scripting.FileSystemObject")
sAmiBrokerFILE = sDISCO & sQUANDLBaseArchiv
CALL GeneratePath(oFSO,sAmiBrokerFILE)
SET oFSO = NOTHING
'
' loop sui dati di AmiBroker, se trovi dato quandl cerca di caricare/aggiornare
'
' crea AmiBroker, load database
SET oAB = CreateObject("Broker.Application")
sDB = sDISCO & "\\FINANZA\\AB\\QuandlEOD"
CALL oAB.LoadDatabase(sDB)
' l'elenco dei titoli
SET oSTOCKS = oAB.Stocks
iStockQty = oSTOCKS.Count
'
' loop su tutti i titoli prendi solo quelli di QUANDL
' in address : quandl,unique id (nome file),numero rollover per anno correnti,
'
ndownloaded = 0
FOR i = 0 TO (iStockQty-1)
SET oStock = oSTOCKS( i )
sERROR = ""
IF (oStock.Address <> "" ) THEN
sAddress = Split(oStock.Address,",")
IF (UCASE(sAddress(0)) = "QUANDL") THEN
IF UBound(sAddress) < 2 THEN
sERROR = " Error on Address field of " & oStock.Ticker & " of QUANDL(" & oStock.Address & ")"
ELSE
sFileTicker = sAddress(1) & ".csv"
sURL = sQUANDLBaseURL & sFileTicker & sQUANDLAuthURL & G_sQUANDL_TOKEN & sQUANDLEndPartURL
sAmiBrokerFILE = sDISCO & sQUANDLBaseArchiv & oStock.Ticker & ".csv"
' DEBUG ONLY
'oLOG.WriteLine(""+Cstr(Now()) & " debug url=" & sURL& & " AmiBroker file=" & sAmiBrokerFILE)
END IF
IF sERROR <> "" THEN
oLOG.WriteLine(""+Cstr(Now()) + sERROR)
ELSE
ndownloaded = ndownloaded + 1
ierr = DownloadFile(sURL,sAmiBrokerFILE)
IF ierr <> 0 THEN
oLOG.WriteLine(""+Cstr(Now()) & " Error downloading (" &CSTR(ierr)& ") " & sURL & " to file " & sAmiBrokerFILE )
ELSE
CALL oAB.Import(0,sAmiBrokerFILE,"quandl_futures.format")
END IF
END IF
END IF
END IF
NEXT
SET oSTOCKS = NOTHING
SET oStock = NOTHING
' aggiorna AmiBroker, salva e rilascia
'CALL oAB.RefreshAll()
CALL oAB.SaveDatabase()
SET oAB = NOTHING
'
oLOG.WriteLine(""+Cstr(Now()) + " END QUANDL Import ("+Cstr(ndownloaded)+" files)")
' invia msg chiusra
SET oSHELL = CreateObject("WScript.Shell")
iResp = oSHELL.popup("END Manage QUANDL",1,G_sTITOLO,0)
SET oSHELL = NOTHING
END SUB

This example will download and import in AmiBroker QUANDL data.

The idea is :
loop on all tickers, and see the Address field
if address field will indicate to download/import data I usually put inside the field
the path o part of the path for download/import data..

The DownloadFile() is an utility routine that download data :

'
' DownloadFile
' @info effettua il download della sURL indicata nel
' file sLocation indicato torna 0 per OK, -1 per errore
'
' @param sURL la URL completa di cui deve essere fatto il
' download
' @param sLocation il path base di ove vuoi sia archiviato il
' file downloaded, tipicamente si tratta di
' una locazione che poi NON viene cancellata
'
PUBLIC FUNCTION DownloadFile(sURL,sLocation)
On Error Resume NEXT
'
DIM oXMLHTTP,oADOStream,oFSO,oSHELL
' crea l'XMLHTTP per fare la fetch del file
SET oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
' effettua lo GET del file
CALL oXMLHTTP.open("GET", sURL, false)
CALL oXMLHTTP.send()
' se riesce a creare XMLHTTP, crea uno stream e setta i dati
If oXMLHTTP.Status = 200 Then
' crea lo stream
SET oADOStream = CreateObject("ADODB.Stream")
' Apri lo stream appena creato
CALL oADOStream.Open()
' setta lo Stream in modo binario
oADOStream.Type = 1 'adTypeBinary
' setta nello Stream il response body dell'XMLHTTP
CALL oADOStream.Write(oXMLHTTP.ResponseBody)
' setta la posizione dello Stream all'inizio
oADOStream.Position = 0
' crea oggetto per manipolare file system
SET oFSO = Createobject("Scripting.FileSystemObject")
' se il file esiste, cancellalo
If oFSO.Fileexists(sLocation) Then CALL oFSO.DeleteFile(sLocation)
' rilascia oggetto per manipolare file system
SET oFSO = NOTHING
' chiedi allo Stream di scaricare il file e salvarlo
CALL oADOStream.SaveToFile(sLocation)
' chiudi lo Stream
CALL oADOStream.Close()
' rilascia lo stream
SET oADOStream = NOTHING
DownloadFile = 0
ELSE
'
' errors : signal an wait 300 sec or OK
'
SET oSHELL = CreateObject("WScript.Shell")
iRespOK = oSHELL.popup("Site " & sURL & " is unavailable (press OK to continue)",60,"DownloadFile", 48+0 )
SET oSHELL = NOTHING
DownloadFile = -1
END if
' rilascia lo XMLHTTP
SET oXMLHTTP = NOTHING
END FUNCTION


The GeneratePath() is a simple utility function that verify if specified path exists
otherwise create it.

Regards
Luca

Reply With Quote
The following user says Thank You to iildm for this post:
 
  #5 (permalink)
Banned: Rude behavior towards others
London UK
 
Futures Experience: Advanced
Platform: -
Favorite Futures: any
 
Posts: 18 since Mar 2014
Thanks: 3 given, 9 received


enjoyaol View Post
Hello,
I have generated fantasy data (1000 stocks) in CSV files. These 1000 stocks are not realy one and their tickers are not real ones.

Importing one file is OK, manually using the custom ascii import (I have made a special .format file).

What would be an easy way (using maybe an external software ?) to create a custom database containing the list of tickers (I have) + the CSV files (I have) ?

The goal is to be able to update a CSV file I have and directly see the new charts in amibroker without having to import manually using the ascii import menu. I hope I don't have to create a data plugin using C++ to achieve that ? I could not post this question to the amibroker yahoo group as I'm not a customer yet.

Thanks!

If you don't wanna make a plugin then use import via OLE.
What is the format of your files?

Reply With Quote

Reply



futures io > > > > Custom database with custom tickers. Is it possible ?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom signatures? acbrasil Tech Support 1 April 4th, 2013 04:50 PM
custom timeframe toulouse-lautrec NinjaTrader Programming 3 September 6th, 2012 06:03 PM
Custom symbol Nimble NinjaTrader Programming 20 February 27th, 2012 07:13 PM
Custom Futures Mondrakete TradeStation 3 May 8th, 2011 05:41 AM
Custom development neb1998 NinjaTrader Programming 1 March 7th, 2011 04:43 PM


All times are GMT -4. The time now is 02:20 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-15 in 0.11 seconds with 19 queries on phoenix via your IP 54.226.132.197