[R] R and Mt4 trading platform connection
Hi guys , Can anyone suggest how to make a MT4 EA strategy using R code . I had seen many strategy builders online but have no idea about how to build ne using R. THanks and Regards , ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] HANDLER FUNCTION PROBLEM
Hello , I have a function handler using gWidgets like below ,, i had declared a function inside this function . But dont have the idea how to call the function outside the handler function. addHandlerClicked(AAS,handler=function(h,...) { ga() THIS IS THE FUNCTION TO BE CALLED OUTSIDE { } }) ga() ---WANTED IT OUTSIDE can anyone help please [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] GETTING SOM CLUSTERING RESULT
Hi all, I have a normalized data set , in which i had done SOM clustering , as we can get clustering results in kmeans like :-k$cluster , we can get which element belongs to which cluster . But in case of SOM , can we get the cluster results like kmeans. Another thing I am not getting anyreply of my queries , am i banned I didn't use any offensive languageor anything , can any 1 help or the admins . THanks ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] GETTING CLUSTERING RESULTS IN SOM , LIKE K-MEAN
Hi all, I was doingk-mean clusteringthrough which i could find out each and every clusters and the contents aroundeach cluster centroid likebelow :- x-read.csv(normalizedata.csv, header = TRUE)#To read the dataset km- kmeans(x, 3, 150) print(km) in this I could get every clusters and centroids . km$cluster- It gaveme the clusters which comes up during clustering like [1] 3 3 1 2 3 2 1 2 1 3 2 1 3 1 1 1 3 2 1 1 1 1 3 1 1 2 2 2 1 3 3 1 3 3 2 2 2 [38] 3 1 3 1 3 3 1 1 1 3 1 1 2 1 3 3 3 3 3 3 3 3 3 3 1 3 2 3 2 2 3 3 3 3 2 3 2 [75] 1 2 2 1 1 3 3 1 3 1 1 1 1 3 3 2 1 3 3 3 1 3 1 1 1 1 1 2 1 3 1 1 1 2 1 3 3 [112] 1 3 1 2 1 1 1 1 1 1 1 2 2 1 3 1 2 3 1 1 3 2 1 1 1 2 1 3 2 1 3 1 1 1 3 2 1 [149] 3 2 3 3 3 3 1 2 1 1 1 1 1 1 3 2 2 2 1 1 1 3 3 1 1 3 2 1 3 1 1 1 1 1 2 1 1 [186] 3 1 2 1 3 2 3 2 1 2 1 2 3 1 1 1 2 3 2 1 1 2 3 3 1 2 2 1 3 1 1 2 3 3 1 1 3 [223] 3 1 1 3 3 3 2 2 1 3 3 3 2 2 1 2 3 1 1 2 1 1 1 1 1 3 1 3 2 1 1 3 1 1 2 2 3 [260] 1 3 3 3 1 1 2 1 3 1 3 1 2 1 1 1 3 3 2 3 1 1 1 2 1 3 3 1 3 3 1 1 2 1 2 3 3 But in case of SOM clustering when i had triedlike:- require(kohonen) require (som)#To load Kohonen Package x-read.csv(normalizedata.csv,header=TRUE) x.sc - scale(x)#To scale set.seed(7) xx.som- SOM(data = x.sc, grid = somgrid(1, 3, hexagonal))#som function print(xx.som) I got :- $codes hrefCount Number.of.times.Visited Total.time.Spent [1,] -0.008926424 0.01642686 -0.01059301 [2,] -0.008926424 0.01642686 -0.01059301 [3,] -0.023231402 -0.06730921 -0.02705149 I hope this are the centroids , I need the clusterresults like kmeans , how to achieve it , can any onehelps . THanks ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] K-mean Clustering URL's and ranking them according to there recent visit .
Hi all , I am having some URL's of facebook ,youtube , etc . I would like to applyk-mean clustering algorithm on those URL's which gives me the most recomended URL's which are visited frequently , I had seen some papers related to Web crawling using clustering ,but could not find outhow to proceed in R . is there any package to do so . Any idea would be much helpful . Thank You ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] K-mean Clustering in URL's
Hi , I have some URL's like :- 2 facebook http://www.facebook.com http://www.facebook.com/ http://twitter.com/facebook http://twitter.com/facebook http://en.wikipedia.org/wiki/Facebook http://play.google.com/store/apps/developer?id=Facebookhl=en http://mashable.com/category/facebook http://www.facebookstories.com How to find kmean clusterring of this text URL data? THanks ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Counting number of days my program runs
Hi all , I have a package and i want to count the 1st execution day of the package till 30 days afterwards ? I hope I am clear with this question . Please reply if you have anything to share . Thanks ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Getting data s from Think or Swim platform through R.
Hi all , Is it possible to get datas from Think or Swim database like we do in Yahoo.finance through Quantmod package like getSymbol . We know they aretaking money for datas. Than You ASHIS dEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Making a trial based Package for 30-days.
Hi all , I have a GUI package , which I want to make it work for a certain period,say-30days ,after which it should be self destructive . Could it be possible ?? ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R Package making error
Hi all , I have a GUI package function like below , trader-function() { install.packages(Rgtk2) install.packages(cluster) install.packages(gWidgets) install.packages(gWidgetsRGtk2) install.packages(scales) install.packages(RGtk2Extras) install.packages(FuzzyToolkitUoN) install.packages(splines) install.packages(plyr) install.packages(cairo) install.packages(cairoDevices) install.packages(e1071) install.packages(quantmod) install.packages(TTR) install.packages(xts) library(RGtk2) library(RGtk2Extras) library(FuzzyToolkitUoN) library(splines) library(plyr) library(Cairo) library(cairoDevice) library(gWidgets2) library(gWidgetsRGtk2) library(e1071) library(quantmod) library(TTR) library(xts) } Ididn't put the whole code here , My problem is I had converted thisfunction into an package , it works good ,but every time it has to install all the packages, is there something by which only once it will install the packages and next time it is not needed . Thanks ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Making a package works on any R version
Hi all I had made a package in R-3.0.3 , and its running well , my issue is it is not running in other versions or R like R-3.0.2/3.0.1 it is showing error like --- Error: This is R 3.0.2, package âxxxâ needs = 3.0.3 Does anybody have the solution on how to make this package run on any versions . i know its not a big problem , please forgive my ignorance if it sounds silly . Thanks , ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problem in handling Date format
Hi all , I have this data like , ashdata YHOO.Open YHOO.High YHOO.Low YHOO.Close YHOO.Volume YHOO.Adjusted 2007-01-03 25.85 26.2625.26 25.6126352700 25.61 2007-01-04 25.64 26.9225.52 26.8532512200 26.85 2007-01-05 26.70 27.8726.66 27.7464264600 27.74 2007-01-08 27.70 28.0427.43 27.9225713700 27.92 2007-01-09 28.00 28.0527.41 27.5825621500 27.58 2007-01-10 27.48 28.9227.44 28.704024 28.70 I had put it in a csv in my desktop using write.csv(ashdata,D:/ashdata1.csv) Then I tried to access the csv using read.csv(D:/ashdata1.csv) but when I accessed the data , the date format changed to numeric expression like 10 ,20 ,30 , Can anybody suggest a simple way to handle Dates in R , could not find any function . Sorry for such a basic Questions. Thanks You ASHIS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Writing a function in a corrrect way
Hi all , I am about to make a package using gWidgets and RGTK, so for that I had put all my codes into a empty function to access it afterward by the function name using liketrade() . Here is the below code example :--- trade-function() HERE IS THE EMPTY FUNCTION { library(RGtk2) library(gWidgets) library(gWidgets2) library(gWidgetsRGtk2) library(FuzzyToolkitUoN) library(splines) library(plyr) library(Cairo) library(cairoDevice) library(e1071) library(quantmod) library(TTR) library(xts) #main GUI code win=gwindow( PREDICTIVE TRADER ,visible=FALSE) group-ggroup(cont=win) left_group-ggroup(cont=group,horizontal=FALSE) right_group-ggroup(cont=group,horizontal=FALSE) frame-gframe(widgets,cont=left_group,expand=TRUE) size(frame)-c(400,450) tbl=glayout(cont=frame) tbl[7,1]= gbutton(BUYANDSELLSIGNALS ,cont=tbl,handler=BSS) tbl[5,1]=glabel(ENTER SYMBOL:-,cont=tbl) tbl[5,2]-gedit( , cont=tbl,coerce.with=as.character) tbl[11,1]-glabel(ENTER PROFIT TARGET:-,cont=tbl) tbl[11,2]= gedit(, cont=tbl,coerce.with=as.numeric) tbl[17,1]= gbutton(RUNBACKTEST ,cont=tbl,handler=RBS) tbl[22,1]- plut-gbutton(PLOT GRAPH ,cont=tbl,handler=ploit) tbl[22,2]-rprt-gbutton(TRADEREPORT,cont=tbl,handler=report) tbl[1,1]=img - gimage(E:/clusterring/pr.1.png) tbl[19,1]-b-gbutton(GENERATING BACKTEST SUMMARY ,cont=tbl,handler=gbs) tbl[24,1]-gbutton(CLEAR,cont=tbl,handler=clear) tbl[13,1] =glabel(STOP LOSS TARGET:-) tbl[13,2] =gedit(, container=tbl,coerce.with=as.numeric) visible(win)=TRUE } I Didn't put the whole function handlers and the remaining codesfor its lengthiness , my issue is the function is showingsome problem like when i execute the function and called the GUI using trade() it is showing the GUI ,but when I click any button it is showing some errorlike below :- Error in svalue(tbl[5, 2]) : error in evaluating the argument 'obj' in selecting a method for function 'svalue': Error in (function (classes, fdef, mtable) : unable to find an inherited method for function â.tagâ for signature âinvalid, guiWidgetsToolkitRGtk2â Can any body help me with this issue , I am sorry if I had not follwed any rules in here , will learn if taught . Thank You ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] WANT TO CONVERT R PACKAGE TO A DLL TO USE IN C#
HI ALL, I have a package [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] HOW TO MAKE A R PACKAGE TO A DLL FILE TO USE IN C#
HI ALL, I made a package such that when i call the function inside the package like rabbit() , it gives my GUI very well , now I want to convert this package into a Dynamic link library(DLL) ,such that I can use it in C# using RDOT NET package , is it possible , if it is then please show me the way , will be greatful. Thank You, ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Wanted to make g widgets GUI a Package
Hi all , I know i am asking a silly question , please help me a bit , fun-function() ---I have this function , dont know what to return here. { JUSTGIVING HERE THE MAINWINDOW , AVOIDING GIVING THE WHOLE FUNCTION HANDLERS--- library(scales) library(cluster) library(plyr) library(sqldf) library(gWidgets2) library(gWidgetsRGtk2) library(e1071) library(RGtk2) options(guiToolkit=RGtk2) #main GUI code win=gwindow(BIG CLUST ) img - gdkPixbufNewFromFile(E:/clusterring/str.1.png) getToolkitWidget(win)$setIcon(img$retval) paned-gpanedgroup(cont=win) group- ggroup ( cont = paned , horizontal = FALSE ) library(RGtk2); getBlock(win)$modifyBg(GtkStateType[normal], skyblue) tbl=glayout(cont=group) size(tbl)-c(600,450) tbl[2,1] = gfilebrowse (text = Select file..., type = open, quote = FALSE, filter = list(Text File = list(patterns = c(*.csv))), container = tbl) tbl[14,1]= gbutton(CLEAR,cont=tbl,handler=function(h,...) clear_data()) tbl[14,2]-H-gbutton(HELP,cont=tbl,handler=function(h,...) help()) tbl[11,1]-EDATA-gbutton(DATA EDIT,cont=tbl) tbl[6,1]= glabel(CHOOSE YOUR CLUSTER TYPE :-) tbl[23,1]= glabel(STATUS,cont=tbl) tbl[2,2]-SHOW- gbutton(SHOW DATA,cont=tbl) tbl[1,2]=img - gimage(E:/clusterring/pr.1.png) tbl[9,1]-b-gcombobox(c(CLARA,CMEANS,KMEANS,PAM,SOM), selected = NULL, editable = TRUE, coerce.with=NULL, handler = NULL, action = NULL, container = tbl, toolkit = guiToolkit()) tbl[13,1]-Rbutton- gbutton(GET CLUSTER RESULT,cont=tbl) frame - gframe ( RESULT: , cont = paned , horizontal = TRUE) size(frame)-c(400,400) } Now this is stupid , I had called the function like :- fun() But it is not executing ,just i m getting the window ,nothing else , so any one who can help me to declare this GUI as an function . Actually , i want to make it as an package and run like THE RATTLE , so anybody have any idea please help me , Thank You in advance . [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Calling a source file from R to C#
I had this code like :-- using System.Text; using RDotNet; using RDotNet.NativeLibrary; using Stats; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string rhome = System.Environment.GetEnvironmentVariable(R_HOME); if (string.IsNullOrEmpty(rhome)) rhome = @C:\Program Files (x86)\R\R-2.11.1; System.Environment.SetEnvironmentVariable(R_HOME, rhome); System.Environment.SetEnvironmentVariable(PATH, System.Environment.GetEnvironmentVariable(PATH) + ; + rhome + @\bin\i386); REngine.SetDllDirectory(@C:\Program Files (x86)\R\R-2.11.1\bin); using (REngine engine = REngine.CreateInstance(RDotNet)) { engine.Initialize(); REngine R = REngine.GetInstanceFromID(RDotNet); engine.Evaluate(source('D:/n1.R')); --- here i m calling a r script contain a function . Console.ReadKey(); } } } } My function looks like :--- fun-function(x,y) { z=x*y return(z) } But i getting the error like :- Parse exception was unhanded in the command line its showing like : Error in source :-D:/n1.R) : D:/n1.R:1:1: unexpected ')' 1: ) I am using R 2.11.1 and vs2010 . Does anybody have any solution for this ?? ,please help me out with this issue. PS :- ashis deb [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Calling a R function in RDOTNET inside C#.
Hi all , I had connected R and C# using RDoTNET, I want to call every packages of R in there and functions ,anybody have a code snippets to help me out , as the coding here is hard to understand. Thank You, PS ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Making a dll in C# using R codes.
Hi all I want to add R with C# and want to call the R functions in C# and do computation . I had used the package Rdotnet package in C# , but cannot call a fuction of R in C# , if any one could help me with this . Thank You, ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] acessing symbols dynamically through a gedit box using getsymbol function
I had tried a little weird way of accessing symbols from YAHOO.FINANCE in my GUI which is made in gwidgets ...Here is an example:-- tbl[5,1]=glabel(ENTER SYMBOL:-,cont=tbl) tbl[5,2]=gedit(, cont=tbl,coerce.with=as.character) BSS-function(h,...) { options(guiToolkit=RGtk2) data - new.env() getSymbols(svalue(tbl[5,2]),env = data, auto.assign = T) options(getSymbols.warning4.0=FALSE) ashdata1-data.frame(tbl[5,2]) } My question is I could not get those symbols from the getSymbol function , can any one show me some way how to access this symbols dynamically ,such that the users can specify any symbols and could access those data in a click of a button .. Thanks You. ASHIS DEB [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.