Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
Thank you.
Thanks Golubev. I will take care next time.
#property copyright "Copyright 2018, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #include <xlsgate.mqh> extern string StartAdress = "C3"; bool xlsgateok=false; string Addr; int OnInit() { Addr=StartAdress; if (ExcelInit("mt4") && ExcelStart("")) { Print("XLSgate init done"); xlsgateok=true; Print("Office version = "+ExcelVersion()); ExcelSheetAdd("MT4"); } return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ double lastBid=0; void OnTick() { if (xlsgateok && lastBid!=Bid) { ExcelSetValue(Addr,Bid); lastBid=Bid; Addr=ExcelRowAdd(Addr,1); } } //+------------------------------------------------------------------+

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Guys
I configured the XLSGate EA with My MT4 account and getting the Bid Price value in C3 excel sheet. Kindly guide me that how can I get the Account balance and Equity value in C4 and C5. what commands I should use?
this is the EA for XLSgate
""""""""""""""""""""""""""""""""""""""
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#include <xlsgate.mqh>
extern string StartAdress = "C3";
bool xlsgateok=false;
string Addr;
int OnInit()
{
Addr=StartAdress;
if (ExcelInit("mt4") && ExcelStart(""))
{
Print("XLSgate init done");
xlsgateok=true;
Print("Office version = "+ExcelVersion());
ExcelSheetAdd("MT4");
}
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
double lastBid=0;
void OnTick()
{
if (xlsgateok && lastBid!=Bid)
{
ExcelSetValue(Addr,Bid);
lastBid=Bid;
Addr=ExcelRowAdd(Addr,1);
}
}
//+------------------------------------------------------------------+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Thanks