Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid Point access" error on calling SymbolAnalyzer::getConversionSymbol of FxSymbol module #53

Open
xz9lc2 opened this issue Dec 29, 2019 · 1 comment

Comments

@xz9lc2
Copy link

xz9lc2 commented Dec 29, 2019

I try to trace the code of SymbolAnalyzer::buildCurrencyIndex of FxSymbol module then find symbol is added into m_spacials HashMap rather than building m_index if Base currency equals to Profit currency of the given symbol.
However, broker "IG Market" provides symbols all having Base currency being the same to Profit currency, which cause zero size to m_index HashMap, so Invalid Point access error occurs when calling SymbolAnalyzer::getConversionSymbol, as the member function uses pointers to refer to a zero-size map (i.e., m_index).
May I know what is m_spacials used for? as I don't see any access or operation to it on given code. appreciated if you would like to provide example or explanation to SymbolAnalyzer

@xz9lc2
Copy link
Author

xz9lc2 commented Dec 31, 2019

I modify getBaseCurrency member function in FxSymbol class as the workaround to fix the issue that broker falsely return a wrong base currency via SymbolInfoString(symbol,SYMBOL_CURRENCY_BASE)

static string getBaseCurrency(string symbol)
{
string s ;
s = SymbolInfoString(symbol,SYMBOL_CURRENCY_BASE);
if(FxSymbol::getMarginCalcMode(symbol) == 0 &&
StringCompare(s, SymbolInfoString(symbol,SYMBOL_CURRENCY_PROFIT))== 0)
{
s = StringSubstr(symbol, 0, 3) ;
}
return(s);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant