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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MT4 RTD API 0 replies

MT4 export to Excel? 8 replies

How to copy profiles in MT4? How to use Excel with MT4? 7 replies

Has anyone made an Excel spreadsheet to analyze your MT4 trades? 0 replies

Integration between excel and MT4 prices 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 227
Attachments: MT4 to Excel through Excel RTD (Finally!)
Exit Attachments

MT4 to Excel through Excel RTD (Finally!)

  • Last Post
  •  
  • 1 2Page 3456 29
  • 1 2Page 34 29
  •  
  • Post #41
  • Quote
  • Oct 12, 2020 7:54am Oct 12, 2020 7:54am
  •  pooh123
  • Joined Jul 2012 | Status: Member | 787 Posts
Quoting mtharwat
Disliked
Does any know how to record with a dynamic timestamp in Excel? A VBA code perhaps that can help? I want to record the time when certain conditions are met in a column. I can assign a cell in Excel that will represent the conditions but do not know how to record a dynamic time stamp in a column. The timestamped cell should not be refreshed but rather a new cell will contain the new timestamp when the same conditions are met again.
Ignored
You can use Excel RTD formula to return open time of each bar. Then use IF + Vlookup to return the open time of the bar that meets your condition.
 
 
  • Post #42
  • Quote
  • Oct 12, 2020 9:17am Oct 12, 2020 9:17am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting pooh123
Disliked
{quote} You can use Excel RTD formula to return open time of each bar. Then use IF + Vlookup to return the open time of the bar that meets your condition.
Ignored
Hi pooh123,

Yes you are right about the Vlookup but it will not (store/record) the open time of the bar when the conditions are re-met. In other words, when I come back to Excel the following day, I will only find the last open bar time for my conditions that are met and not the previous bar times. I need this to test the price change workbook.

The only way to counter this is to retrieve data for the last 6 bars (I am using H4) or so but it will be tasking to apply this on all instruments. I encountered some freezes in the past albeit with more lookback periods than 6 bars. Just trying to economize my usage as possible.
 
 
  • Post #43
  • Quote
  • Oct 12, 2020 9:17am Oct 12, 2020 9:17am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting JibalaPasan
Disliked
{quote} Let's say you have the time of mt4 (='MT4'|TIME!GBPAUD) running in A1 and the conditions are met in your other cell, then you just use "copy" in vba from e.g. A1 to B1. Sheets("Your_Sheet").Range("A1").Copy Sheets("Your_sheet").Range("B1").PasteSpecial Paste:=xlPasteValues Best of luck and stay green always! Jibala
Ignored
Thanks Jibala for helping. I am working on it to test it.

Quoting JibalaPasan
Disliked
{quote} Let's say you have the time of mt4 (='MT4'|TIME!GBPAUD) running in A1 and the conditions are met in your other cell, then you just use "copy" in vba from e.g. A1 to B1. Sheets("Your_Sheet").Range("A1").Copy Sheets("Your_sheet").Range("B1").PasteSpecial Paste:=xlPasteValues Best of luck and stay green always! Jibala
Ignored
I think your solution will only work for getting the time stamp whenever the cell (that has the condition) is refreshed. In other words, it will not store previous time stamps.

I am searching now to find a solution for it.
 
 
  • Post #44
  • Quote
  • Oct 13, 2020 2:43am Oct 13, 2020 2:43am
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Hi antariks, Can you please elaborate more on what you are trying to accomplish? I am afraid the photo is not quite clear for me. My understanding is you want to initiate a buy order if volume equals a certain value. Am I right? Can you please show us the "If" formula you used? so we can see what is the problem with the formula. Any ideas are more than welcome as the main focus is to train ourselves on how to practically translate those ideas into formulas in Excel. Regarding using EXCEL RTD buy/sell orders, I have not yet used them but...
Ignored
Hi Mate

I tried to explain the whole thing by making a short video so that it is absolutely clear what I am trying to do.

Please have a look here and you will easily get it
Inserted Video


Lets talk here after that.
Cheers
 
 
  • Post #45
  • Quote
  • Oct 13, 2020 3:41am Oct 13, 2020 3:41am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting antariks
Disliked
{quote} Hi Mate I tried to explain the whole thing by making a short video so that it is absolutely clear what I am trying to do. Please have a look here and you will easily get it https://youtu.be/EAPXYQwFqUs Lets talk here after that. Cheers
Ignored

Hello,
I watched the video and will give a short answer until I come back for a further detailed response.

What you are trying to accomplish is easy. You do not need to click on the "Place Order". This is VBA coded to make life easier for the trader. However, if you check for now page 21-22 in the EXCEL RTD PDF in the first post, you will find a way to type a formula to execute a buy order for example whether it is a market order or a pending one.

I will work on it as I have not yet used the buy/sell orders and will come back with the formula.

My initial impression is that it is quite easy to do it with an IF statement by referencing another cell and if the condition meets a certain value, then execute the trade.
For example:
A1 cell has the value. In B1 we type =IF(A1="X", cmd.SendCommand("Account Number", "BUY", "s=AUDJPY|v=10000", 5), 0) ....NB(Not sure about the last number (5) is for but will find out). And also note you Specify volume and not lot sizes. Anyway, the last argument in the IF Statement is (0) so as not do anything if the condition is not met.

Anyway, give me some time and I will work on it.
 
 
  • Post #46
  • Quote
  • Oct 13, 2020 3:54am Oct 13, 2020 3:54am
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Hello, I watched the video and will give a short answer until I come back for a further detailed response. What you are trying to accomplish is easy. You do not need to click on the "Place Order". This is VBA coded to make life easier for the trader. However, if you check for now page 21-22 in the EXCEL RTD PDF in the first post, you will find a way to type a formula to execute a buy order for example whether it is a market order or a pending one. I will work on it as I have not yet used the buy/sell orders and will come back with the formula....
Ignored
Great, thank you. Will wait.

Please also look for a time based execution, for example at the end of a 15 min candle, i.e every 15 min or so. The other one could be a conditional one as you already mentioned. The time based one should also be a conditional one. Cheers
 
 
  • Post #47
  • Quote
  • Oct 13, 2020 4:37am Oct 13, 2020 4:37am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting antariks
Disliked
{quote} Great, thank you. Will wait. Please also look for a time based execution, for example at the end of a 15 min candle, i.e every 15 min or so. The other one could be a conditional one as you already mentioned. The time based one should also be a conditional one. Cheers
Ignored

Thinking of it 'theoretically', the most recent candle in the lookback period should be (1). for example, if you have a look back of the last 10 candles then the most recent one is the previous close. i.e (1) and not (0) as (0) means current price.

In this case, the condition will always be met at the end of the most recent closed candle (previous close (1)).
 
 
  • Post #48
  • Quote
  • Oct 13, 2020 5:19am Oct 13, 2020 5:19am
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Thinking of it 'theoretically', the most recent candle in the lookback period should be (1). for example, if you have a look back of the last 10 candles then the most recent one is the previous close. i.e (1) and not (0) as (0) means current price. In this case, the condition will always be met at the end of the most recent closed candle (previous close (1)).
Ignored
Makes sense. But this RTD worksheet lags a lot if you keep long history bars that need time to update once the candle/period is over. Since I work with 5 days range, I need to look back at 480 past candles on 15 min chart. Thinking of how to avoid that. Else, only 23 history bars are sufficient for my strategy.
 
 
  • Post #49
  • Quote
  • Oct 13, 2020 6:02am Oct 13, 2020 6:02am
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Thanks Jibala for helping. I am working on it to test it. {quote} I think your solution will only work for getting the time stamp whenever the cell (that has the condition) is refreshed. In other words, it will not store previous time stamps. I am searching now to find a solution for it.
Ignored
This will be a superb tool if we can store web-collected data in a timestamp format. I retrieve my fxbook community outlook data but fail to store in a time series format. Every time my excel is refreshed, the new data overlaps the old one.
 
 
  • Post #50
  • Quote
  • Oct 13, 2020 6:31pm Oct 13, 2020 6:31pm
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Hello, I watched the video and will give a short answer until I come back for a further detailed response. What you are trying to accomplish is easy. You do not need to click on the "Place Order". This is VBA coded to make life easier for the trader. However, if you check for now page 21-22 in the EXCEL RTD PDF in the first post, you will find a way to type a formula to execute a buy order for example whether it is a market order or a pending one. I will work on it as I have not yet used the buy/sell orders and will come back with the formula....
Ignored
Found it. The 5 stands for "The number of seconds to wait for a response"
 
 
  • Post #51
  • Quote
  • Oct 14, 2020 2:07am Oct 14, 2020 2:07am
  •  xzdluu
  • | Joined Mar 2020 | Status: Member | 49 Posts
Quoting JibalaPasan
Disliked
{quote} I guess what you want to know looks like that: {image} If once you're familiar with all that syntax stuff you can do lots of calculations. Together with little developer skills, you are able to develop amazing trading tools. My current favourite is the GER30 Scalper & Swing Trader. {image}{image} Best of luck and stay green always! Jibala
Ignored

hi sir, how can u do this ?
Attached Image
 
 
  • Post #52
  • Quote
  • Oct 15, 2020 12:28am Oct 15, 2020 12:28am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting xzdluu
Disliked
{quote} hi sir, how can u do this ? {image}
Ignored

The two keywords for learning how to do this is Linking Shapes to Data in Excel. An example is shown here
Inserted Video




NB: I am not sure if I am allowed to insert youtube links in FF?

If not I will delete it and the principle is the same. Search for Shapes and Data in Excel.
 
 
  • Post #53
  • Quote
  • Oct 15, 2020 12:33am Oct 15, 2020 12:33am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting antariks
Disliked
{quote} Found it. The 5 stands for "The number of seconds to wait for a response"
Ignored
That is great to know.

Sorry I was late. I was caught up with many family issues and I was not feeling well at the same time.

I will work on it tonight.
 
 
  • Post #54
  • Quote
  • Oct 15, 2020 3:09pm Oct 15, 2020 3:09pm
  •  JibalaPasan
  • Joined Jun 2014 | Status: Member | 2,496 Posts
Quoting mtharwat
Disliked
{quote} The two keywords for learning how to do this is Linking Shapes to Data in Excel. An example is shown here https://www.youtube.com/watch?v=bWiE6qVNAoU NB: I am not sure if I am allowed to insert youtube links in FF? If not I will delete it and the principle is the same. Search for Shapes and Data in Excel.
Ignored
Almost correct!
Attached Image (click to enlarge)
Click to Enlarge

Name: Ashampoo_Snap_2020.10.15_19h08m19s_002_.png
Size: 141 KB

Best of luck and stay green always!

Jibala
PDF & BCC (Patience Discipline Focus & Belief Confidence Consistency)
 
 
  • Post #55
  • Quote
  • Oct 16, 2020 5:15am Oct 16, 2020 5:15am
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} That is great to know. Sorry I was late. I was caught up with many family issues and I was not feeling well at the same time. I will work on it tonight.
Ignored
The so called pro traders in the prop trading firms will always say one thing...technical analysis doesn't work.

Let's prove them wrong.
 
 
  • Post #56
  • Quote
  • Oct 21, 2020 8:20am Oct 21, 2020 8:20am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting antariks
Disliked
{quote} The so-called pro traders in the prop trading firms will always say one thing...technical analysis doesn't work. Let's prove them wrong.
Ignored

Hi antariks,

Can you share the sample sheet that has the VBA code? I mean the one that has the clickable button. I could not find mine and it will take me a while.

I have read the PDF pages with regard to the sending of commands. They are not formulas to be written in a cell. They are rather a VBA. I do not know much about VBA but hopefully, I can make a few changes to the original sample sheet. I tried to create one in the "Developer" but it gave me back an error.
My hope is that if I see the original VB, I may be able to follow up and understand more the PDF instructions or at least perform what you need (i.e initiate the trade automatically without clicking on the button".


BTW, the PDF does mention how to create a clickable button but I could not implement it. I might have been missing a few commands.
 
 
  • Post #57
  • Quote
  • Oct 21, 2020 2:35pm Oct 21, 2020 2:35pm
  •  JibalaPasan
  • Joined Jun 2014 | Status: Member | 2,496 Posts
Quoting mtharwat
Disliked
{quote} Can you share the sample sheet that has the VBA code? I mean the one that has the clickable button.
Ignored
Just add an ActiveX Controls CommandButton and add the VBA Macro to it.
Attached Image

Attached Image

Inserted Code
Private Sub CommandButton1_Click()
Set cmd = CreateObject("FXBlueLabs.ExcelCommand")
strResult = cmd.SendCommand(RTD!A1, "BUY", "s=EURUSD|v=1500", 5)
End Sub
Private Sub CommandButton2_Click()
Set cmd = CreateObject("FXBlueLabs.ExcelCommand")
strResult = cmd.SendCommand(RTD!A1, "SELL", "s=EURUSD|v=1500", 5)
End Sub

Best of luck and stay green always!

Jibala
PDF & BCC (Patience Discipline Focus & Belief Confidence Consistency)
 
 
  • Post #58
  • Quote
  • Oct 22, 2020 1:09am Oct 22, 2020 1:09am
  •  mtharwat
  • Joined Aug 2015 | Status: Member | 980 Posts
Quoting JibalaPasan
Disliked
{quote} Just add an ActiveX Controls CommandButton and add the VBA Macro to it. {image} {image} Private Sub CommandButton1_Click() Set cmd = CreateObject("FXBlueLabs.ExcelCommand") strResult = cmd.SendCommand(RTD!A1, "BUY", "s=EURUSD|v=1500", 5) End Sub Private Sub CommandButton2_Click() Set cmd = CreateObject("FXBlueLabs.ExcelCommand") strResult = cmd.SendCommand(RTD!A1, "SELL", "s=EURUSD|v=1500", 5) End Sub Best of luck and stay green always! Jibala
Ignored

Thanks Jibala for your guidance. I will work on it tonight.
 
 
  • Post #59
  • Quote
  • Oct 22, 2020 8:59pm Oct 22, 2020 8:59pm
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting JibalaPasan
Disliked
{quote} Just add an ActiveX Controls CommandButton and add the VBA Macro to it. {image} {image} Private Sub CommandButton1_Click() Set cmd = CreateObject("FXBlueLabs.ExcelCommand") strResult = cmd.SendCommand(RTD!A1, "BUY", "s=EURUSD|v=1500", 5) End Sub Private Sub CommandButton2_Click() Set cmd = CreateObject("FXBlueLabs.ExcelCommand") strResult = cmd.SendCommand(RTD!A1, "SELL", "s=EURUSD|v=1500", 5) End Sub Best of luck and stay green always! Jibala
Ignored
Thanks a lot. I will also try to play with the code.

A question....instead of putting a constant volume there, I will try to put a cell reference number and see what happenes.

Can we make it more conditional? For ex, as in Excel, =IF(AND(R520>0, S520<0, S527=1),"Buy","Sell")
 
 
  • Post #60
  • Quote
  • Oct 22, 2020 8:59pm Oct 22, 2020 8:59pm
  •  antariks
  • | Joined Mar 2007 | Status: Member | 80 Posts
Quoting mtharwat
Disliked
{quote} Thanks Jibala for your guidance. I will work on it tonight.
Ignored
Thanks. Appreciate it.
 
 
  • Platform Tech
  • /
  • MT4 to Excel through Excel RTD (Finally!)
  • Reply to Thread
    • 1 2Page 3456 29
    • 1 2Page 34 29
1 trader 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