Skip to content

Introducing TFX: An R Interface to the TrueFX Web API

8 messages · veepsirtt, G See

#
Hello gsee,

I tryied the examples given in your documentation.
But I am getting errors.
what is the problem?
With regards
veepsirtt.
------------------------------------------------------------------------

## Cannot run these because there may not be an internet connection
## Not run:
library(TFX)
QueryTrueFX() #unauthenticated
QueryTrueFX(pretty=FALSE)
QueryTrueFX(parse=FALSE)

## For authenticated session, you must have a username and password (it?s
free).
## Use your username and passward instead of JSTrader and Ou812

id <- ConnectTrueFX(?EUR/USD,GBP/USD?, username=?veepsirtt?,
password=?veeps203?)
QueryTrueFX(id)
QueryTrueFX(ConnectTrueFX(username=?veepsirtt?,
password=?veeps203?,format=?csv?), parse=FALSE)
QueryTrueFX(ConnectTrueFX(username=?veepsirtt?,
password=?veeps203?,format=?html?), parse=FALSE)
## If you have shiny installed
## install.packages("shiny", repos="http://rstudio.org/_packages")
library(shiny)

runGist("4122626")

## view the code for this shiny app at
#browseURL("https://gist.github.com/4122626")
## End(Not run)--------------------------------------



************************RESULTS*******************
Error in source("~/.active-rstudio-document", echo = TRUE) : 
  ~/.active-rstudio-document:11:21: unexpected input
10: 
11: id <- ConnectTrueFX(?
                       ^
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                
LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] shiny_0.8.0     TFX_0.1.0       ggplot2_0.9.3.1 xtsExtra_0.0-1 
tseries_0.10-32 quantmod_0.4-0 
 [7] TTR_0.21-1      xts_0.9-3       zoo_1.7-9       Defaults_1.1-1 

loaded via a namespace (and not attached):
 [1] bitops_1.0-4.1     caTools_1.13       colorspace_1.2-0  
dichromat_1.2-4    digest_0.5.2      
 [6] grid_2.15.3        gtable_0.1.1       httpuv_1.2.0       labeling_0.1      
lattice_0.20-13   
[11] MASS_7.3-23        munsell_0.4        plyr_1.7.1         proto_0.3-9.2     
quadprog_1.5-5    
[16] RColorBrewer_1.0-5 Rcpp_0.10.2        reshape2_1.2.1     RJSONIO_1.0-1     
scales_0.2.3      
[21] stringr_0.6.1      tools_2.15.3       XML_3.98-1.1       xtable_1.7-0
--
View this message in context: http://r.789695.n4.nabble.com/Introducing-TFX-An-R-Interface-to-the-TrueFX-Web-API-tp4651827p4681163.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
Try typing that command.  Your single quote is a weird character.  Try this:

id <- ConnectTrueFX('EUR/USD,GBP/USD', username='veepsirtt',
                                      password='veeps203')
On Tue, Nov 26, 2013 at 3:47 AM, veepsirtt <veepsirtt at gmail.com> wrote:
1 day later
#
Hello Gsee,
Why I am getting this error?.
unexpected input in "QueryTrueFX(ConnectTrueFX(username=?"
-----------------------------------------------------------
Symbol Bid.Price Ask.Price      High       Low           TimeStamp
1  EUR/USD   1.35773   1.35781   1.35804   1.35634 2013-11-28 04:29:35
2  USD/JPY 102.05800 102.06400 102.29100 101.93300 2013-11-28 04:29:38
3  GBP/USD   1.63036   1.63055   1.63074   1.62763 2013-11-28 04:29:35
4  EUR/GBP   0.83265   0.83282   0.83436   0.83235 2013-11-28 04:29:35
5  USD/CHF   0.90768   0.90784   0.90874   0.90725 2013-11-28 04:29:40
6  EUR/JPY 138.56800 138.58300 138.84900 138.29900 2013-11-28 04:29:35
7  EUR/CHF   1.23241   1.23266   1.23308   1.23195 2013-11-28 04:29:35
8  USD/CAD   1.05844   1.05867   1.05987   1.05746 2013-11-28 04:29:34
9  AUD/USD   0.91259   0.91270   0.91411   0.90742 2013-11-28 04:29:34
10 GBP/JPY 166.38900 166.42000 166.61000 165.95600 2013-11-28 04:29:35
$Symbol
 [1] "EUR/USD" "USD/JPY" "GBP/USD" "EUR/GBP" "USD/CHF" "EUR/JPY" "EUR/CHF"
"USD/CAD" "AUD/USD" "GBP/JPY"

$BidBigNumber
 [1] "1.35" "102." "1.63" "0.83" "0.90" "138." "1.23" "1.05" "0.91" "166."

$BidPip
 [1] "773" "058" "036" "265" "768" "568" "241" "844" "259" "389"

$OfferBigNumber
 [1] "1.35" "102." "1.63" "0.83" "0.90" "138." "1.23" "1.05" "0.91" "166."

$OfferPip
 [1] "781" "064" "055" "282" "784" "583" "266" "867" "270" "420"

$High
 [1] "1.35804" "102.291" "1.63074" "0.83436" "0.90874" "138.849" "1.23308"
"1.05987" "0.91411" "166.610"

$Low
 [1] "1.35634" "101.933" "1.62763" "0.83235" "0.90725" "138.299" "1.23195"
"1.05746" "0.90742" "165.956"

$TimeStamp
 [1] "1385612975232" "1385612978277" "1385612975780" "1385612975128"
"1385612980409" "1385612975181"
 [7] "1385612975905" "1385612974630" "1385612974758" "1385612975675"
[1]
"EUR/USDUSD/JPYGBP/USDEUR/GBPUSD/CHFEUR/JPYEUR/CHFUSD/CADAUD/USDGBP/JPY1.35102.1.630.830.90138.1.231.050.91166.7690580362627735672398442593891.35102.1.630.830.90138.1.231.050.91166.7770640552787875812638672704201.35804102.2911.630740.834360.90874138.8491.233081.059870.91411166.6101.35634101.9331.627630.832350.90725138.2991.231951.057460.90742165.9561385612981970138561297827713856129820241385612981995138561298220413856129818141385612981814138561297463013856129747581385612975675"
Error: unexpected input in "id <- ConnectTrueFX(?"
Symbol Bid.Price Ask.Price    High     Low           TimeStamp
1 EUR/USD   1.35769   1.35777 1.35804 1.35634 2013-11-28 04:29:52
2 GBP/USD   1.63031   1.63048 1.63074 1.62763 2013-11-28 04:29:52
<environment: 0x10459290>
attr(,"class")
[1] "TFXsession"  "environment"
Error: unexpected input in "QueryTrueFX(ConnectTrueFX(username=?"
Error: unexpected input in "QueryTrueFX(ConnectTrueFX(username=?"
--
View this message in context: http://r.789695.n4.nabble.com/Introducing-TFX-An-R-Interface-to-the-TrueFX-Web-API-tp4651827p4681300.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
Because you've pasted a right single quote unicode symbol instead of
typing an apostrophe.

When I copy/paste from the command you entered, I get

R> charToRaw("?")
[1] e2 80 99

When I type an apostrophe using the keyboard, I get

R> charToRaw("'")
[1] 27

Try typing your command instead of copy/pasting it.

Hope this helps,
Garrett
On Wed, Nov 27, 2013 at 10:37 PM, veepsirtt <veepsirtt at gmail.com> wrote:
#
Error in id < ConnectTrueFX("EUR/USD", username = "veepsirtt", password =
"veeps203") : 
  comparison (3) is possible only for atomic and list types




--
View this message in context: http://r.789695.n4.nabble.com/Introducing-TFX-An-R-Interface-to-the-TrueFX-Web-API-tp4651827p4681302.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
you entered a less than sign instead of an assignment operator.

instead of
  id < ConnectTrueFX(...
it should be
  id <- ConnectTrueFX(...
On Wed, Nov 27, 2013 at 11:10 PM, veepsirtt <veepsirtt at gmail.com> wrote: