Forum on trading, automated trading systems and testing trading strategies
Hello,
Please EDIT your post and use the SRC button when you post code.
Thank you.
I was unable to edit the post, sorry, but here is the SRC
. . } //+------------------------------------------------------------------+ int OnCalculate(const int rates_total,const int prev_calculated, const datetime &Time[], const double &Open[], const double &High[], const double &Low[], const double &Close[], const long &TickVolume[], const long &Volume[], const int &Spread[]) { . . . InitSymbolNames(); . . . //--- done return(rates_total); } //+------------------------------------------------------------------+ void InitSymbolNames() { AddSymbolToMarketWatch(SYMBOLS_NAMES[1],"EUR","eur","GBP","gbp"); } //+------------------------------------------------------------------+ string AddSymbolToMarketWatch(string name,string PART_1,string part_1,string PART_2,string part_2) { name=empty_symbol; // Symbol name total_symbol=SymbolsTotal(false); //--- Total symbols on the server //--- Iterate over the entire list of symbols for(int i=0;i<total_symbol;i++) { if( (SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_BASE)==PART_1&&SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_PROFIT)==PART_2) || (SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_BASE)==part_1&&SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_PROFIT)==part_2) ) { name=SymbolName(i,false); //--- If this symbol is available, SymbolSelect(name,true); //--- add it to the Market Watch window and return(name); //--- return its name break; } } return(name); } //********************************************************************************************************************
johmabe:
I was unable to edit the post, sorry, but here is the SRC
up
What is the error ?
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
Just got a signal and it is sent to tickers EURUSD.m, GBPUSD.m
I'm allowed to trade EURUSDMicro, and don't want to take the huge lots of EURUSD so I'd like to adapt this signal on my side (user). I gathered by reading the forum that creating an indicator to make MT5 recognize only the 6 first letters of the ticker would be a solution, but the code posted doesn't work anymore when I compile, and I don't know much about coding either.
So can anyone fix this code that another forumer posted?
.
.
}
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,
const datetime &Time[],
const double &Open[],
const double &High[],
const double &Low[],
const double &Close[],
const long &TickVolume[],
const long &Volume[],
const int &Spread[])
{
.
.
.
InitSymbolNames();
.
.
.
//--- done
return(rates_total);
}
//+------------------------------------------------------------------+
void InitSymbolNames()
{
AddSymbolToMarketWatch(SYMBOLS_NAMES[1],"EUR","eur","GBP","gbp");
}
//+------------------------------------------------------------------+
string AddSymbolToMarketWatch(string name,string PART_1,string part_1,string PART_2,string part_2)
{
name=empty_symbol; // Symbol name
total_symbol=SymbolsTotal(false); //--- Total symbols on the server
//--- Iterate over the entire list of symbols
for(int i=0;i<total_symbol;i++)
{
if(
(SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_BASE)==PART_1&&SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_PROFIT)==PART_2)
||
(SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_BASE)==part_1&&SymbolInfoString(SymbolName(i,false),SYMBOL_CURRENCY_PROFIT)==part_2)
)
{
name=SymbolName(i,false); //--- If this symbol is available,
SymbolSelect(name,true); //--- add it to the Market Watch window and
return(name); //--- return its name
break;
}
}
return(name);
}
//********************************************************************************************************************