MQL4 Script: Fetch a CSV value from a URL

MQL4 Scripts

Spécifications

I need a script which fetches a value from a website URL, and then makes that fetched value available within the script to be compared against another manually typed in value. 

The value is found here:

https://www.quandl.com/data/FRED/PAYEMS-All-Employees-Total-nonfarm

 

The value can be fetched using the below URL:  

https://www.quandl.com/api/v3/datasets/FRED/PAYEMS.csv?exclude_column_names=true&rows=1&api_key=my_api_key

 A value of 2016-08-01, 144598.0 is returned. 

 

Once the value of [2016-08-01, 144598.0] has been fetched from the URL, I need to be able to compare it against another number which I will manually type in. 

I will be comparing the values using if and else statements, which would look something like this: 

 

void OnStart()
{

... //  code which fetches the value of 2016-08-01, 144598.0 from the .csv URL

double x = 155876.0     // value manually TYPED IN by myself
       y = 144598.0     // VALUE FETCHED FROM THE .CSV URL
                        // ignore column 1 consisting of 2016-08-01
   if ( x > y ) {

                        // executes code which I have already written

} 

else { 

                        // execute other code which I have already written

}

}


Ideally, if anyone can make it so that the date column of [2016-08-01] was ignored, that would be helpful as I only want to compare the numerical value of [144598.0] with another typed in value.

 

 

  

 

  

Répondu

1
Développeur 1
Évaluation
(26)
Projets
34
29%
Arbitrage
0
En retard
1
3%
Gratuit
2
Développeur 2
Évaluation
(564)
Projets
844
73%
Arbitrage
15
53% / 13%
En retard
193
23%
Gratuit
3
Développeur 3
Évaluation
(26)
Projets
29
3%
Arbitrage
11
9% / 73%
En retard
3
10%
Gratuit
Publié : 1 code
4
Développeur 4
Évaluation
(845)
Projets
1446
72%
Arbitrage
119
29% / 47%
En retard
355
25%
Travail
Publié : 3 articles
5
Développeur 5
Évaluation
(66)
Projets
95
28%
Arbitrage
20
25% / 55%
En retard
24
25%
Gratuit
6
Développeur 6
Évaluation
(47)
Projets
140
49%
Arbitrage
9
56% / 0%
En retard
27
19%
Gratuit
7
Développeur 7
Évaluation
(28)
Projets
36
17%
Arbitrage
5
20% / 40%
En retard
17
47%
Gratuit
Publié : 5 codes
8
Développeur 8
Évaluation
(49)
Projets
134
27%
Arbitrage
62
13% / 53%
En retard
58
43%
Gratuit
Publié : 273 articles, 1 code
9
Développeur 9
Évaluation
(1)
Projets
4
25%
Arbitrage
1
0% / 100%
En retard
1
25%
Gratuit
Publié : 6 codes
10
Développeur 10
Évaluation
(64)
Projets
144
46%
Arbitrage
19
42% / 16%
En retard
32
22%
Gratuit
11
Développeur 11
Évaluation
(1)
Projets
1
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit

Informations sur le projet

Budget
40 - 50 USD
Délais
de 1 à 2 jour(s)