Automated trading based on levels found in Excel/Google Sheets etc.

To add comments, please log in or register
madmikelol
10
madmikelol  

Hi - what's the best possibility to trade based on levels given in a spreadsheet with the following information;


  1. Pair
  2. Trade direction
  3. Entry level
  4. Stop loss level
  5. Distance to current price from entry level (based on Google Finance, could possibly make the EA read the current MT4 market price instead?)

I want the flow to be like this;

  1. Add the levels to trade off
  2. Have the EA calculate lot size based on set risk percentage based on current account balance.
  3. Place a pending limit order if price is closer than 'x' to current price. 
  4. Delete the pending if price gets further away than 'x' to current price.
  5. Set the tag for the trade to complete if placed and triggered
  6. Set the tag for the trade to pending set if set, but remove the tag if the pending is deleted, so that it can be picked up again by the EA.

Is this something that would be even remotely possible to do?


I basically just want to feed my levels into a sheet and have the EA do all the work for me.


Cheers,

Mike

Anthony Garot
1853
Anthony Garot  
madmikelol:

Hi - what's the best possibility to trade based on levels given in a spreadsheet with the following information;

Spreadsheets can save in CSV format.

So have your EA read the CSV format.

Easy peasy.

https://www.mql5.com/en/articles/2720#z7

MQL5 Programming Basics: Files
MQL5 Programming Basics: Files
  • www.mql5.com
Like many other programming languages, MQL5 features the functions for working with files. Although working with files is not a very common task when developing MQL5 Expert Advisors and indicators, each developer faces it sooner or later. The range of issues that require working with files is wide enough. It includes generating a custom trading...
madmikelol
10
madmikelol  
Anthony Garot:

Spreadsheets can save in CSV format.

So have your EA read the CSV format.

Easy peasy.

https://www.mql5.com/en/articles/2720#z7

Then the MT4 would need to send information back to the spreadsheet to update the outcome of the trades, in order for correct lot sizes etc. to be calculated. Is that possible? Completely new to this.
Anthony Garot
1853
Anthony Garot  
madmikelol:
Then the MT4 would need to send information back to the spreadsheet to update the outcome of the trades, in order for correct lot sizes etc. to be calculated. Is that possible? Completely new to this.

It's possible to both read and write to files using MQL4 file functions.

Here are the File Functions available for MQL4:
https://docs.mql4.com/files

If you are reading the whole file and writing the whole file, you won't have any difficulties.

If you want to update specific cells of a spreadsheet, that gets trickier. In that case, perhaps a DDE solution is preferred. I haven't done DDE with MT4, so I have nothing to offer there.

To add comments, please log in or register