• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:09pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:09pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Anyone has API/scripts to connect MT4 manager and MT4? 8 replies

How do I enable my MT4 EA to trade using a FIX API? 30 replies

Pulling Data from MT4 History? 2 replies

how to create a system without using API ? :) 5 replies

Finding Targets and Pulling Triggers 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: Pulling Data from MT4 using API
Exit Attachments

Pulling Data from MT4 using API

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Mar 31, 2013 3:43am Mar 31, 2013 3:43am
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
Does anyone know how to do the abovementioned?

Thanks in advanced.
  • Post #2
  • Quote
  • Mar 31, 2013 10:00am Mar 31, 2013 10:00am
  •  Kenz987
  • Joined Aug 2006 | Status: Member | 737 Posts
see "Named Pipes for MT4"
 
 
  • Post #3
  • Quote
  • Mar 31, 2013 11:56am Mar 31, 2013 11:56am
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
Another possibility is MTAPI4. You can google to get more details.
 
 
  • Post #4
  • Quote
  • Mar 31, 2013 7:24pm Mar 31, 2013 7:24pm
  •  ZeeJay
  • | Joined Nov 2007 | Status: Member | 129 Posts
what are you trying to build ?
I use TCP Sockets for this.
 
 
  • Post #5
  • Quote
  • Edited at 7:52pm Mar 31, 2013 7:32pm | Edited at 7:52pm
  •  FiatFap
  • Joined Sep 2010 | Status: Member | 578 Posts
The task can be done in many ways, the simplest of which is to write to an excel file on every new 1minute bar (or whatever) with data you want to parse and create an 'external' app to read the file; more advanced solutions include writing to the registry, pipes and shared memory.

I've used a C++ DLL to create this tool (screenshots in posts on first page), which opens up a whole new price portal / conceptualisation...

Attached Image (click to enlarge)
Click to Enlarge

Name: 53WG6cT.png
Size: 121 KB


What you ask is NOT trivial and requires a lot of research.

Edit: technically you can't pull data from MT4, instead it has to be pushed by creating an indy/EA that facilitates the data, ie you have to write mql code to send the data either each tick or on a new candle by polling the server for data using ArrayCopySeries(), for example. There's no way you can just read the encryted data inside MT4, but they do offer a DDE option.

Edit 2: Just wanted to add, you can get a nice & quick working solution with the 'poor mans' excel option. I wrote an indy that saved bid prices for many pairs to an excel file and wrote a .NET app to read the file every second. In my .NET code, i used a try...catch to gracefully exit the function if there was a conflict of interest (the file was still in use by MT4), on the next timer event it would hit the file again. It worked and was very simple to implement.

hth
Politics is the womb in which war develops.
 
 
  • Post #6
  • Quote
  • Mar 31, 2013 7:41pm Mar 31, 2013 7:41pm
  •  ZeeJay
  • | Joined Nov 2007 | Status: Member | 129 Posts
Totally agree with FiatFap.
no easy task, but do-able.

CJ
 
 
  • Post #7
  • Quote
  • Apr 1, 2013 3:24am Apr 1, 2013 3:24am
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
wow so much valuable information here.

basically, i wanna get the price data and create a software to plot historical trades. and with that, to analyze those trades.

i have no programming experience.

does it sound feasible to you guys?
 
 
  • Post #8
  • Quote
  • Apr 1, 2013 3:26am Apr 1, 2013 3:26am
  •  stevewalker
  • Joined Dec 2010 | Status: Member | 18,740 Posts
waht is ypur plan

depends on what you want to do
there are many ways

Quoting nathaniel
Disliked
Does anyone know how to do the abovementioned? Thanks in advanced.
Ignored
 
 
  • Post #9
  • Quote
  • Apr 1, 2013 3:50am Apr 1, 2013 3:50am
  •  nubcake
  • Joined Oct 2009 | Status: >Apocalypto< for Deputy PM | 3,698 Posts
Quoting nathaniel
Disliked
wow so much valuable information here. basically, i wanna get the price data and create a software to plot historical trades. and with that, to analyze those trades. i have no programming experience. does it sound feasible to you guys?
Ignored
so if you had been at least this clear in your original post then you wouldn't have wasted everyone's time when all you are searching for is some basic as fuck indi that will spew candlestick data. i'm pretty sure hanover has done something like this, with a million bits and pieces and the kitchen sink thrown in for good measure.

or you could probably just google it and find places listing csv files all ready to be downloaded.

why would you ask programmers how to do something when you can't even program? specific coding information is of zero use to you if you don't know how to write code!!!

is this a joke thread?

Forex Trading for the Savvy Beginner
 
 
  • Post #10
  • Quote
  • Apr 1, 2013 6:34am Apr 1, 2013 6:34am
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
Quoting nubcake
Disliked
so if you had been at least this clear in your original post then you wouldn't have wasted everyone's time when all you are searching for is some basic as fuck indi that will spew candlestick data. i'm pretty sure hanover has done something like this, with a million bits and pieces and the kitchen sink thrown in for good measure. or you could probably just google it and find places listing csv files all ready to be downloaded. why would you ask programmers how to do something when you can't even program? specific coding information is of zero use...
Ignored
My apologies to everyone if I wasn't clear. But please be more polite with your words. Thank you.

I have some excel data of historical trades on hand, and I want to create something to be able to plot these trades (with units/lots entered as well) on charts.

And I am asking programmers how to code, or what is the most effective way so that I can hire programmers to do it.

And no, this is not a joke thread.
 
 
  • Post #11
  • Quote
  • Apr 1, 2013 8:20am Apr 1, 2013 8:20am
  •  FiatFap
  • Joined Sep 2010 | Status: Member | 578 Posts
Quote
Disliked
I have some excel data of historical trades on hand

In that case, i'd recommend learning some VBA to automate a bar-graph chart in excel from your trade info (time = x axis, lot size = y axis).

If you want to create a price line graph and super-impose these trades, isn't that replicating what MT4 does? You can left-click and drag a trade from your history onto the chart and MT4 will show entry/exit info..

You could then create an indy which searches your chart for trade history objects and draws a box that varies in size and/or colour for the lot size.

Every journey begins with a first footstep.
Politics is the womb in which war develops.
 
 
  • Post #12
  • Quote
  • Apr 1, 2013 11:01am Apr 1, 2013 11:01am
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
Quoting nathaniel
Disliked
wow so much valuable information here. basically, i wanna get the price data and create a software to plot historical trades. and with that, to analyze those trades. i have no programming experience. does it sound feasible to you guys?
Ignored
You have to be kidding. Even for an expert coder, this would be a challenge and I doubt anyone will do it for free.
 
 
  • Post #13
  • Quote
  • Apr 1, 2013 11:17am Apr 1, 2013 11:17am
  •  ZeeJay
  • | Joined Nov 2007 | Status: Member | 129 Posts
The code I wrote to connect to MT4 was a lot of pain, test, and error-checking... not to mention many hours and late evenings.
MT4 was not designed to be interfaced with, unless you are a crazy coder like some of us are here. :-)

too bad , looks like this thread will die soon.... I was hoping for a challenging, fun conversation with fellow programmers.

CJ
 
 
  • Post #14
  • Quote
  • Apr 1, 2013 11:50am Apr 1, 2013 11:50am
  •  m.m.m.
  • | Commercial Member | Joined Aug 2010 | 269 Posts
Quoting ZeeJay
Disliked
The code I wrote to connect to MT4 was a lot of pain, test, and error-checking... not to mention many hours and late evenings. MT4 was not designed to be interfaced with, unless you are a crazy coder like some of us are here. :-) too bad , looks like this thread will die soon.... I was hoping for a challenging, fun conversation with fellow programmers. CJ
Ignored
When using c++, and winapi obviously, most straight-forward way of connecting mt4 and another window is passing data directly through the window procedure via wm_copydata window message. The sender (mt4 ea) will initiate data passing with sendmessage() procedure from user32.dll. Nevertheless, in this case a custom dll is needed to either pass the data itself, or, to prepare the copydatastruct for the ea, for it to pass data.
 
 
  • Post #15
  • Quote
  • Apr 1, 2013 12:44pm Apr 1, 2013 12:44pm
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
Quoting CodeMeister
Disliked
You have to be kidding. Even for an expert coder, this would be a challenge and I doubt anyone will do it for free.
Ignored
No of course not planning to get it for free. was planning to pay for it. but if i can do something that's simpler, that would be good too. Just wanna plot historical trades (data on excel. But data is not mine so I can't simply create an indicator on MT4 I think) on charts.
 
 
  • Post #16
  • Quote
  • Apr 1, 2013 12:50pm Apr 1, 2013 12:50pm
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
Quoting FiatFap
Disliked
In that case, i'd recommend learning some VBA ("http://msdn.microsoft.com/en-us/library/office/ee814737%28v=office.14%29.aspx") to automate a bar-graph chart in excel from your trade info (time = x axis, lot size = y axis). If you want to create a price line graph and super-impose these trades, isn't that replicating what MT4 does? You can left-click and drag a trade from your history onto the chart and MT4 will show entry/exit info.. You could then create an indy which searches your chart for trade history objects and draws a box that varies...
Ignored
Thank you for taking the time to compose a reply.

Yeah, I thought VBA would be suitable. But wasn't sure if how VBA could plot the trades on the candlestick chart, and at the same time, allow me to switch between different time frames (M1,M5,M15,etc). Because in order for me to analyze these trades, I would require Multiple TF analysis for sure. What do you think?

The Data that I have are not mine, and that is why I only have them on excel. If I had these data readily available on MT4, then yeah, it would be about finding the appropriate indicator, or creating one to plot historical trades on my MT4 Platform.

Thanks for the links
 
 
  • Post #17
  • Quote
  • Apr 1, 2013 12:54pm Apr 1, 2013 12:54pm
  •  nathaniel
  • | Joined Jun 2010 | Status: Member | 405 Posts
Quoting ZeeJay
Disliked
The code I wrote to connect to MT4 was a lot of pain, test, and error-checking... not to mention many hours and late evenings. MT4 was not designed to be interfaced with, unless you are a crazy coder like some of us are here. :-) too bad , looks like this thread will die soon.... I was hoping for a challenging, fun conversation with fellow programmers. CJ
Ignored
Yeah I understand that it won't be easy. That is why I posted on some of the freelance sites and requesting a quote. But most quotes are crazy high.

I am basically willing to pay for a programmer to do something simple that would allow me to plot the historical trades from excel onto a chart, and then allow me to analyze.

Sorry to disappoint you, but I'm not a programmer myself. Hoping to have some input about what I want to create, that's all
 
 
  • Post #18
  • Quote
  • Apr 1, 2013 1:27pm Apr 1, 2013 1:27pm
  •  sangmane
  • Joined Apr 2009 | Status: MT4 Programmer | 758 Posts
Quoting nathaniel
Disliked
to plot the historical trades from excel onto a chart
Ignored
if you want to plot historical trades from excel to MT4 chart, the simplest way is:
1. save that excel sheet in csv format (from excel menu: File - Save As, choose csv format)
2. code an MT4 script to read that csv file
 
 
  • Post #19
  • Quote
  • Apr 1, 2013 7:40pm Apr 1, 2013 7:40pm
  •  nubcake
  • Joined Oct 2009 | Status: >Apocalypto< for Deputy PM | 3,698 Posts
Quoting CodeMeister
Disliked
You have to be kidding. Even for an expert coder, this would be a challenge and I doubt anyone will do it for free.
Ignored
what are you talking about? i'm fairly confident something that i put together is still floating around on this very forum that does something along the lines of what this muppet wants. if i remember it used csv data downloaded from myfxbook to plot entries and exits of other peoples trades. what's difficult about reading data and plotting it onto a chart... or am i just having a very dumb moment and not understanding what this guy wants (since he himself has no fucking clue)?

OP goes on ignore. muppet.
Forex Trading for the Savvy Beginner
 
 
  • Post #20
  • Quote
  • Apr 1, 2013 8:23pm Apr 1, 2013 8:23pm
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
At first, this guy wanted something to pull data from MT4 (as per the thread subject). After I wrote that comment, he decided he wanted to pull it from Excel. Two entirely different things.

I agree completely that the second doesn't require much technical ability, just someone who has the basics. Now my opinion is this guy expects something that is nearly impossible and not worth spending any effort on - figuring out what he really wants.
 
 
  • Platform Tech
  • /
  • Pulling Data from MT4 using API
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022