Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

MQL4 TUTORIAL BASICS - 78 SIMPLE MULTI CURRENCY ORDER

Автор: MQL4Tutorial

Загружено: 2020-07-11

Просмотров: 7139

Описание:

https://mql4tutorial.com

With MQL4 for Metatrader4 we create an Expert Advisor that is able to buy and sell multiple currency pairs at the same time - even in the strategy tester...

In this video, we are going to create an expert advisor that is able to trade randomized signals on multiple currency pairs in one chart, so let’s drag the expert advisor onto a live chart, I need to allow auto trading, I click on okay and now we see that it is able to open multiple positions on one chart, so let's find out how to do that with mql4.
To get started please click on a little icon here or press the F4 key on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple multi-currency order, click on continue, continue and finish.
Now you can delete everything above the ontick function and let’s also remove the two comment lines here.
We start with a statement to calculate the ask price, this is very uncommon for mql4, it’s what we usually do in mql5 and to calculate an ask price you can use symbol info double, in this case for the current symbol on the chart, the second parameter here is symbol underscore ask – all in capital letters – and with normalize double and underscore digits I am going to cut the number of digits behind the dot to automatically fit the currency pair because we have currency pairs with three digits behind the dot and others with five digits behind the dot. And that’s what we do here.
Well usually we just would take the ask price as it is but in this case we are going to open multiple positions for different currency pairs and therefore we need to find a way to calculate the ask prices for the other currency pairs, in this case for the US dollar against the Canadian dollar and this is how we can do it, in this case, I have exchanged the first parameter for the currency pair I want to trade.
Please make sure that it matches what you see here in the market watch because some brokers use suffixes so let’s make sure that you get it right.
Now let’s repeat that for the second currency pair. This is almost the same, except for the name of the variable and the currency pair string.
Of course, we can do the same for the bid price, in this case, its symbol info double for the current symbol on the chart and we use symbol underscore bid and now we repeat that for the US dollar against the Canadian dollar. I have called this one USDCADBid and I have exchanged the first parameter and you might have guessed it we also do it here for the British pound against the US dollar.
Now that we have all those bid prices and ask prices let's create a string variable called signal. We are not going to assign a value here because this is going to be calculated now.
In this case, we are going to use random entries, so I use mathsrand and gettickcount to create an initial value because gettickcount returns the number of milliseconds since we have started the system, this is a unique value and this whole expression will make sure that we do not get the same random values all the time and to calculate the actual random number we are going to use mathrand.
This looks almost like the one we used before except the s in the middle and mathrand is used to calculate pseudorandom integer values between zero and thirty-two thousand seven hundred sixty-seven and this suffix here, percent two will give us two random numbers, so whenever the random number equals zero we would consider that to be a buy signal, so we assign the word buy to our signal.
And if the random number equals one we consider that to be a sell signal so now we assign the word sell to our signal and whenever we have a buy signal and when orders total equals zero – that would mean we have a buy signal and no open orders – that’s when we are going to send three orders for the current symbol on the chart, the British pound against the US dollar and for the US dollar against the Canadian dollar.
In the other case if the signal equals sell and we also have no open orders I would like to use order send to sell for the current symbol, for the British pound against the US dollar and for the US dollar against the Canadian dollar.
Now let’s add a chart output by using the comment statement that will output the current signal and the current symbol we trade directly on our chart.
That’s about it.
If this was too fast for you or if you have no idea what all the code here does maybe you want to watch one of the other videos in the basic video series first or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7 on your keyboard, you shouldn’t get any errors and if this is the case you can click on the little button here or press F4 to go back to Metatrader.

MQL4 TUTORIAL BASICS - 78 SIMPLE MULTI CURRENCY ORDER

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

MQL4 TUTORIAL BASICS - 15 HOW TO SET A BUYSTOP

MQL4 TUTORIAL BASICS - 15 HOW TO SET A BUYSTOP

MQL4 TUTORIAL BASICS - 75 SIMPLE TIME FILTER

MQL4 TUTORIAL BASICS - 75 SIMPLE TIME FILTER

The Earnings Volatility Strategy Big Funds Use (That You Don't Know About)

The Earnings Volatility Strategy Big Funds Use (That You Don't Know About)

MQL4 TUTORIAL BASICS - 64 SIMPLE MULTIPLE RSI

MQL4 TUTORIAL BASICS - 64 SIMPLE MULTIPLE RSI

Самая холодная деревня в мире: Оймякон (-71°C)

Самая холодная деревня в мире: Оймякон (-71°C)

Что такое TCP/IP: Объясняем на пальцах

Что такое TCP/IP: Объясняем на пальцах

Алгоритмический скальпель: как Python помогает находить и использовать рыночные неэффективности

Алгоритмический скальпель: как Python помогает находить и использовать рыночные неэффективности

Нет дров — нет газа! Бесплатный обогреватель круглосуточно от компрессора холодильника, о которо....

Нет дров — нет газа! Бесплатный обогреватель круглосуточно от компрессора холодильника, о которо....

Учебное пособие по торговле скользящими средними (для дневной торговли)

Учебное пособие по торговле скользящими средними (для дневной торговли)

КОЗЫРЕВ - астрофизик ДОКАЗАЛ, что ВРЕМЯ это ЭНЕРГИЯ: дважды СИДЕЛ, приговорён к РАССТРЕЛУ

КОЗЫРЕВ - астрофизик ДОКАЗАЛ, что ВРЕМЯ это ЭНЕРГИЯ: дважды СИДЕЛ, приговорён к РАССТРЕЛУ

5 шагов к поиску сегодняшних сделок

5 шагов к поиску сегодняшних сделок

ТЕХНИЧЕСКИЙ АНАЛИЗ - ОДНО ВИДЕО, ВМЕСТО 100 УЧЕБНИКОВ: ПОЛНЫЙ КУРС ОТ НОВИЧКА ДО ПРОДВИНУТОГО УРОВНЯ

ТЕХНИЧЕСКИЙ АНАЛИЗ - ОДНО ВИДЕО, ВМЕСТО 100 УЧЕБНИКОВ: ПОЛНЫЙ КУРС ОТ НОВИЧКА ДО ПРОДВИНУТОГО УРОВНЯ

MQL4 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP

MQL4 TUTORIAL BASICS - 40 SIMPLE BUY BREAKEVEN STOP

Моя стратегия скальпинга СКУЧНА, но она приносит мне 45 833 доллара в месяц

Моя стратегия скальпинга СКУЧНА, но она приносит мне 45 833 доллара в месяц

MQL4 Programming Tutorial 1.09 - Loops & Lists

MQL4 Programming Tutorial 1.09 - Loops & Lists

Полный курс торговли по свечным паттернам (ПРО МГНОВЕННО)

Полный курс торговли по свечным паттернам (ПРО МГНОВЕННО)

Learn MQL4 Programming in 112 Minutes (Easy for Beginners)

Learn MQL4 Programming in 112 Minutes (Easy for Beginners)

MQL4 TUTORIAl BASICS - 90 SIMPLE LOW PRICE TREND LINE OBJECT

MQL4 TUTORIAl BASICS - 90 SIMPLE LOW PRICE TREND LINE OBJECT

СРОЧНО отключи это в Telegram! Защити себя ПРОСТЫМ и ЗАКОННЫМ способом

СРОЧНО отключи это в Telegram! Защити себя ПРОСТЫМ и ЗАКОННЫМ способом

Маска подсети — пояснения

Маска подсети — пояснения

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com