Btw what is forex data feed for amibroker?
May be I misunderstood you today, dastwo, however, all the detailed descriptions of these things to be exported can be found at MQL docs.
http://docs.mql4.com/trading
No Tipster, I believe you misunderstood. I am aware for exporting the CSV file that I do not need Mt4. I wished to know what's needed to be exported by Amibroker to ensure Metatrader can read all order chances. And I'm unfamiliar with MT4 order adminiion. Here there's the description of this mql script
You do not have to know MT4 to do this, there is already an EA/script which will read the text file created by the AFL code above (. . .did you intend AFL??)
There's quite a little more code required to make this bullet evidence. But it's not a huge deal if you know what your doing. Great job so far!!
I can not believe this code doesn't exist yet, as in MT4 and AMI have been around a long time...
Hi Tequilla, thank you very much for supplying that code snippet! I guess it's not yet the full code you mentioned but just an example. Will look at it and report back. Looking forward to the complete code (if you're inclined to discuss it) as I am not familiar with metatrader.
Hey, dastwo. Actually I have just found it so didn't try it yet, because the markets are closed on weekends, but I'm sure it is working and is pretty simple to use. The most tricky part would be to create static vars inside amibroker to follow all of the orders with magical numbers.
I will post complete afl here when it's going to be ready, but it might take some time. For now you can try yourself through amibroker by creating the document and writing into it.
Inserted Code _SECTION_BEGIN(Documents); Filepath = ParamStr(Path to trading documents, C:\\Metatrader\\specialists\\TradeFromCsvFile\\); Inputfile = ParamStr(Input filename, commandfile.txt); _SECTION_END(); function ToFile(sOrderString) Result = False; Filename = Filepath Inputfile; File=fopen(Filename,a); should (Document) fputs(sOrderString n(Document); fclose(File); Result = True; return Result; _SECTION_BEGIN(Action); AutoTrade = ParamToggle(Auto trade, Away|Running); BuyOrder = ParamTrigger(Place Buy order,Buy); SellOrder = ParamTrigger(Place market order,Sell); CloseAll = ParamTrigger(Close all places,Close all); CancelAll = ParamTrigger(Cancel all orders,Cancel all); Reset= ParamTrigger(Reset, Reset); _SECTION_END(); if (! Autotrade) ChartId = GetChartID(); Price = int(Study(TR, ChartId)); Stop = int(Study(ST, ChartId)); Profit = int(Study(PR, ChartId)); ReadyForTrade = Price gt; 0 AND Profit gt; 0 AND Stop gt; 0; Title = trading style: WriteIf(ReadyForTrade, Manual, ready\n, Manual, not ready\n); Title = Title EncodeColor(colorSkyblue) Trade price: WriteIf(Price gt; 0, StrFormat(%g, Price), Create Study with TR id) \n; Title = Title EncodeColor(colorRose) Stop price: WriteIf(Stop gt; 0, StrFormat(%g, Stop), Create Study with ST id) \n; Title = Title EncodeColor(colorPaleGreen) Profit price: WriteIf(Profit gt; 0, StrFormat(%g, Profit ), Create Study with PR id) \n; should (SellOrder AND LastValue(Price) gt; 0) SellLimit(Price(Number); if (BuyOrder AND LastValue(Price) gt; 0) BuyLimit(Price, Quantity); /* function BuyLimit(Price, Quantity) sOrderString = OrderSend, logo, cmd, quantity, price, slippage, stoploss, takeprofit, comment, magical, expiry, arrow_color ToFile(sOrderString); */
once more, I'm unsure about filenames, because I haven't tried it yet, just giving you a clue how to work with documents in ami. Pretty simple...
This is a code to trade with research. Create a study line and give it a name, like TR (Trade pride), ST (Stop reduction), PR (Profit). Then you'll have the ability to send orders out of ami to metatrader
Ofcourse you'll need to rework some of the code and complete it, because im writing all this at forums
It's up to you to dig it up...
p.s.s And because the MQL script is available you can make anything you want out of it, since you already got the base!
I use ami for backtesting and creating my EAs. I wont pay anybody for additional software. Value it paying for them simply cant. You may configure everything, You have free upgrades and also lot of folks uses so that You can have answere for all the questions You have.
Hello Tequilla, thanks. And how can you make that csv file using Amibroker? Have you got an example set up? Have you tried it yet?
Good day!
It was quite fruing when my very first post was not approved by mod, tho it was written well... I was asking to share the solution with Amibroker MT4 orders. I've found one. And am here to talk about this with anybody who still struggles to join Amibroker to Metatrader in order to send orders.
Please see the link under quite helpful:
http://paulsfxrandomwalk.blogspot.co...atrader-4.html
With MQL connected there you will be able to send orders to Metatrader via text document. Good luck.
I would love any information on how to connect AB using MT4 platform. I am using MT4 for a little while but just started with AB.
Thank you.