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)
-   -   Abfrage, ob der aktuelle Markt zwei Währungen hat? (http://www.expert-advisor.com/forum/showthread.php?t=5196)

freitag 02.10.16 14:27

Abfrage, ob der aktuelle Markt zwei Währungen hat?
 
Für die Positionsgrößenberechnung soll der EA wissen, ob er im Forexmarkt handelt (mit Primär- und Sekundärwährung) oder im Index-Aktien-Rohstoffmarkt mit nur einer Hauptwährung.

Kann das ein EA irgendwie schlau ermitteln?

Raul0 02.10.16 15:19

Eine Möglichkeit sehe ich in der Symbol() String Abfrage mit einer Liste, welche Währungen es gibt.

list = "EURUSD","GBPUSD"...

if( Symbol() == list ) dann Währung

So als Beispiel.

traderdoc 02.10.16 23:15

if (MarketInfo(Symbol(), MODE_PROFITCALCMODE) == 0) //Forex

if (MarketInfo(Symbol(), MODE_PROFITCALCMODE) != 0) //alles andere

traderdoc


Alle Zeitangaben in WEZ +2. Es ist jetzt 09:19 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