Provide function checking Momentum for past

MQL4 Uzmanlar

İş tamamlandı

Tamamlanma süresi: 9 gün
Müşteri tarafından geri bildirim
well done!

Şartname

Please implement a fuction:

double chk_momentum_performance(int tf, int period, int bars=0){...}

For the given TimeFrame tf and perio it calculates the result of Momentum as a direct buy/sell indicator. Example:

i pass tf=PERIOD_H1 and period=20 and you calculate for all available history (bars=0 or x bars if this parameter is filled) MOMENTUM-Indicator performance if we buy at positive momentum crossing (at 0 up) and sell at negative momentum crossing (at 0 down) as shown in the picture:




Please use for the buy/sell not directly the Momentum but its Moving Avarage with perio 5. Or use the given MA_MOMENTUM indicator. Its very important you choose most performant solution here (call indicator max 1 per bar, by saving previous 5 indicator values).

Green Arrow means: close all Sell-Positions and open 1 Buy-Position.

Red Arrow means: close all Buy-Position and open 1 Sell-Position.


But in this function we do not really open Position, but we calculate the profit:

Example for given picture:

First we calculate profit for open Sell-Position at 10840 and close it at 10505 = + 335 (but we do not really open any Positions, but only calculate profit!!)

Than we calculate profit for open Buy-Position at 10505 and close it at 10335= - 170.

That for all given history.

The function will be called once a bar at the first tick of the bar.

The function has to use the Bar 1, not the current bar 0 for the Momentum indicator. Hence we react only on fully closed bars/Momentum. Hence the Moving Avarage has to be calculates with bars 1,2,3,4,5.


If you do this job good, i have more such jobs with function for calculation of profit for others indicators like Stochastic, RSI,MACD,ADX,...

The returning value is the profit. //Edit 20161115

Dosyalar:

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(253)
Projeler
358
49%
Arabuluculuk
24
25% / 50%
Süresi dolmuş
80
22%
Serbest
2
Geliştirici 2
Derecelendirme
(414)
Projeler
478
40%
Arabuluculuk
7
43% / 29%
Süresi dolmuş
16
3%
Serbest
3
Geliştirici 3
Derecelendirme
(851)
Projeler
1459
72%
Arabuluculuk
122
29% / 48%
Süresi dolmuş
356
24%
Çalışıyor
Yayınlandı: 3 makale
4
Geliştirici 4
Derecelendirme
(91)
Projeler
144
38%
Arabuluculuk
67
15% / 48%
Süresi dolmuş
55
38%
Serbest
5
Geliştirici 5
Derecelendirme
(76)
Projeler
136
45%
Arabuluculuk
11
27% / 64%
Süresi dolmuş
26
19%
Serbest
Yayınlandı: 5 kod

Proje bilgisi

Bütçe
20 - 100 USD
Son teslim tarihi
from 1 to 5 gün