I need to write the program under MQL4 for automatic process of investment for each item of FOREX market (under x-Trade v. 4.00 Build 206 platform), for example: EURUSD, EURJPY, GBPUSD, OIL, GOLD etc...
The program should be based on "Ichimoku Kinko Hyo" & "RSI" indicators. We have the following data:
From the point of view of the Ichimoku Kinko Hyo paramters: 8,22,44 for example:
M char, the previous date should be calcuted as: Now()-(720/24)*22
W chart, the previous date should be calcuted as: Now()-(168/24)*22
D chart, the previous date should be calcuted as: Now()-(24/24)*22
H4 chart, the previous date should be calcuted as: Now()-(4/24)*22
H1 chart, the previous date should be calcuted as: Now()-(1/24)*22
M30 chart, the previous date should be calcuted as: Now()-(0.5/24)*22
M15 chart, the previous date should be calcuted as: Now()-(0.25/24)*22
M5 chart, the previous date should be calcuted as: Now()-(0.083333333/24)*22
M1 chart, the previous date should be calcuted as: Now()-(0.016666667/24)*22
------------------------------
How to write the code what will make the decision BUY or SELL the minimum quantity of the quoted item??? For example: EURUSD depending on current values of:
1/. Current price
2/. Tenkan-sen (red line)
3/. Kiju-sen (blue line)
4/. Chinkou Span (gray line) vs Previous date
5/. Up Kumo (orange line)
6/. Down Kumo (Violet line)
7/. RSI current value
Conditions to automatic investment:
Signals to BUY (conditions to open the transaction) :
================================
Current Price.Value > Tenkan-sen.Value
Current Price.Value > Kiju-sen.Value
Tenkan-sen.Value = Kiju-sen.Value
Tenkan-sen.Value of previous short time period (for example for chart H4, should be calculated as: Now()-(4/24)*3 <= warning: not 22 because of short time period) must be less than Kiju-sen.Value of the same previous short time period
Current Price should be less than Chinkou Span.value (gray line) vs Previous date (Now()-(4/24)*22)
RSI value should be
less or equeal 30
or
grater than 50 but less than 70
Signals to SELL (conditions to open the transaction) :
=================================
Current Price.Value < Tenkan-sen.Value
Current Price.Value < Kiju-sen.Value
Tenkan-sen.Value = Kiju-sen.Value
Tenkan-sen.Value of previous short time period (for example for chart H4, should be calculated as: Now()-(4/24)*3 <= warning: not 22 because of short time period) must be grater than Kiju-sen.Value of the same previous short time period
Current Price should be higher than Chinkou Span.value (gray line) vs Previous date (Now()-(4/24)*22)
RSI value should be
less than 50
or
grater or equeal than 70
TAKE PROFIT:
For the opened positions as BUY: should be set as the open transaction rate + 100 pips
For the opened positions as SELL: should be set as the open transaction rate - 100 pips
STOP LOSS: 0 (without stop loss)
If you have any idea how to write the proper code under this platform, please give me the answer on e-mail or here on this public forum.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I need to write the program under MQL4 for automatic process of investment for each item of FOREX market (under x-Trade v. 4.00 Build 206 platform), for example: EURUSD, EURJPY, GBPUSD, OIL, GOLD etc...
The program should be based on "Ichimoku Kinko Hyo" & "RSI" indicators. We have the following data:
Parameters of the Ichimoku Kinko Hyo indicator:
1/. Tenkan-sen (red line): 8
2/. Kiju-sen (blue line): 22
3/. Chinkou Span (gray line)
4/. Up Kumo (orange line)
5/. Down Kumo (Violet line)
6/. Senkou Span B: 44
Parameters of the RSI indicator:
7/. Current VALUE of RSI
8/. Current price: CP
Paramters for current char (M1, M5, M30, H1, H4, D, W, M)
M 720 (30*24)
W 168 (7*24)
D 24 (1*24)
H4 4
H1 1
M30 0.5 (30/60)
M15 0.25 (15/60)
M5 0.083333333 (5/60)
M1 0.016666667 (1/60)
9/. Current time: Now()
10/. Previous time: Now() - (Char type/24) * 22
11/. Previous short time period
============================================================
From the point of view of the Ichimoku Kinko Hyo paramters: 8,22,44 for example:
M char, the previous date should be calcuted as: Now()-(720/24)*22
W chart, the previous date should be calcuted as: Now()-(168/24)*22
D chart, the previous date should be calcuted as: Now()-(24/24)*22
H4 chart, the previous date should be calcuted as: Now()-(4/24)*22
H1 chart, the previous date should be calcuted as: Now()-(1/24)*22
M30 chart, the previous date should be calcuted as: Now()-(0.5/24)*22
M15 chart, the previous date should be calcuted as: Now()-(0.25/24)*22
M5 chart, the previous date should be calcuted as: Now()-(0.083333333/24)*22
M1 chart, the previous date should be calcuted as: Now()-(0.016666667/24)*22
------------------------------
How to write the code what will make the decision BUY or SELL the minimum quantity of the quoted item??? For example: EURUSD depending on current values of:
1/. Current price
2/. Tenkan-sen (red line)
3/. Kiju-sen (blue line)
4/. Chinkou Span (gray line) vs Previous date
5/. Up Kumo (orange line)
6/. Down Kumo (Violet line)
7/. RSI current value
Conditions to automatic investment:
Signals to BUY (conditions to open the transaction) :
================================
Current Price.Value > Tenkan-sen.Value
Current Price.Value > Kiju-sen.Value
Tenkan-sen.Value = Kiju-sen.Value
Tenkan-sen.Value of previous short time period (for example for chart H4, should be calculated as: Now()-(4/24)*3 <= warning: not 22 because of short time period) must be less than Kiju-sen.Value of the same previous short time period
Current Price should be less than Chinkou Span.value (gray line) vs Previous date (Now()-(4/24)*22)
RSI value should be
less or equeal 30
or
grater than 50 but less than 70
Signals to SELL (conditions to open the transaction) :
=================================
Current Price.Value < Tenkan-sen.Value
Current Price.Value < Kiju-sen.Value
Tenkan-sen.Value = Kiju-sen.Value
Tenkan-sen.Value of previous short time period (for example for chart H4, should be calculated as: Now()-(4/24)*3 <= warning: not 22 because of short time period) must be grater than Kiju-sen.Value of the same previous short time period
Current Price should be higher than Chinkou Span.value (gray line) vs Previous date (Now()-(4/24)*22)
RSI value should be
less than 50
or
grater or equeal than 70
TAKE PROFIT:
For the opened positions as BUY: should be set as the open transaction rate + 100 pips
For the opened positions as SELL: should be set as the open transaction rate - 100 pips
STOP LOSS: 0 (without stop loss)
If you have any idea how to write the proper code under this platform, please give me the answer on e-mail or here on this public forum.
Best regards,
Piotr