Matlab i metatrader
Matlab i metatrader
Mam napisanych kilka pomysłow strategii w Matlabie na spekulacje. Chciałbym pobawic sie nimi w realu. Mam konto z metatraderem, Czy ktos ma doswiadczenie w polaczeniu tych 2 systemow. Jak wyslac np polecenie sprzedazy np z matlabu do Metatradera, jak przekazac kwotowania?- sadze ze mozna napisac text file dla komunikacji. Sa moze jakies gotowce? Na szybkosci mi zbyt nie zalezy...
prostszym i szybszym sposobem
bylaby dla mnie jakas prostsza komukacje. Nie chce az tak zglebiac metatradera.
Chce sprawdzic cos prostego...
Chce sprawdzic cos prostego...
A jest to gdzies opisane ze strony Metatradera..
I czy to skomplikowane?
Skopiowalem to, ale nie moge znalezc tych csv files. W matlabie musze miec
dane dla " swarm optimisation" i duzo jest "learning algorithms". Wiec nie wyobrazam sobie robienia tego w mql4.
//+------------------------------------------------------------------+
//| 3.mq4 |
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
// File identificator
int file;
// Tick count for flushing each 102 ticks
int flushCount = 0;
int init() {
// Open the file for writing
file = FileOpen(Symbol() + "-Ticks.csv",
FILE_WRITE | FILE_CSV,
";");
if(file<1)
{
Print("File Ticks.csv not found, the last error is ", GetLastError());
return(false);
}
Print("File Ticks.csv opened ");
return(0);
}
int deinit() {
// Close the file
FileClose(file);
return(0);
}
int start() {
// Write tick data:
// - Date & time with seconds info
// - Bid
// - Ask
// - Volume indicator for the selected timeframe
FileWrite(file,
TimeToStr(TimeCurrent(),
TIME_DATE | TIME_SECONDS),
Bid,
Ask,
iVolume(Symbol(), NULL, 0));
flushCount++;
// Flush file buffer each 102 ticks to enhance performance
// when writing huge files
if (flushCount == 102) {
FileFlush(file);
flushCount = 0;
Print("File flushed ");
}
return(0);
}
Dodano po 15 minutach:
Poszukuje czegos w tym stylu. Caly algorytm bedzie w matlabie i on chodzi bez przerwy. 100 ostanich Bid idzie do matlaba z mql , I z matlaba wychodzi czasami sygnal sell or buy. Ma ktos cos takiego co dziala?
dane dla " swarm optimisation" i duzo jest "learning algorithms". Wiec nie wyobrazam sobie robienia tego w mql4.
//+------------------------------------------------------------------+
//| 3.mq4 |
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
// File identificator
int file;
// Tick count for flushing each 102 ticks
int flushCount = 0;
int init() {
// Open the file for writing
file = FileOpen(Symbol() + "-Ticks.csv",
FILE_WRITE | FILE_CSV,
";");
if(file<1)
{
Print("File Ticks.csv not found, the last error is ", GetLastError());
return(false);
}
Print("File Ticks.csv opened ");
return(0);
}
int deinit() {
// Close the file
FileClose(file);
return(0);
}
int start() {
// Write tick data:
// - Date & time with seconds info
// - Bid
// - Ask
// - Volume indicator for the selected timeframe
FileWrite(file,
TimeToStr(TimeCurrent(),
TIME_DATE | TIME_SECONDS),
Bid,
Ask,
iVolume(Symbol(), NULL, 0));
flushCount++;
// Flush file buffer each 102 ticks to enhance performance
// when writing huge files
if (flushCount == 102) {
FileFlush(file);
flushCount = 0;
Print("File flushed ");
}
return(0);
}
Dodano po 15 minutach:
Poszukuje czegos w tym stylu. Caly algorytm bedzie w matlabie i on chodzi bez przerwy. 100 ostanich Bid idzie do matlaba z mql , I z matlaba wychodzi czasami sygnal sell or buy. Ma ktos cos takiego co dziala?