Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   Filtern ungültige Symbole (http://www.expert-advisor.com/forum/showthread.php?t=7345)

TraumExpert 04.08.23 11:38

Filtern ungültige Symbole
 
Hallo,

in einem Script verwende ich folgenden Code:

[..]
string symbol = SymbolName(i, marketwatch);

double spreadPoints = MarketInfo(symbol, MODE_SPREAD) /MathPow(10,MarketInfo(symbol,MODE_DIGITS));
if(spreadPoints <= 0)
{
if(debug)
Print(symbol + " Spread <=0. Symbol No. "+(string)i+ " from "+ (string)totalSymbols);
continue;
} // Skip symbols with invalid spreads
[...]
Ich prüfe anhand des Spreads ob der Wert handbar ist, in der Annahme das bei kleiner gleich 0 kein aktueller Handel stattfindet. Tatsächlich filtert (skipped) er bei marketwatch = false, auch Symbole heraus die einen aktuellen Spread > 0 haben heraus. Hat jemand eine Idee an was das liegen kann?

Gruß

TraumExpert

Indikator-Trading 07.08.23 08:20

Vielleicht bekommt dein Script dann keine aktuellen Daten, ggf. weil der jeweilige Markt geschlossen ist. Ist jetzt nur aber eine Annahme. Versuche mal mit RefreshRates() die Daten von dem jeweiligen Symbol vorher zu aktualisieren

TraumExpert 07.08.23 18:32

Danke Indi,

mit Refresh hat nichts gebracht. Habe eine Lösung gefunden über ein paar Ecken, die mit der ursprünglichen Idee der Selektion nicht mehr viel zu tun hat.

Gruß

TraumExpert


Alle Zeitangaben in WEZ +2. Es ist jetzt 19:20 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum