Anybody use delphi with DCOM to drive R ?

How to create strategies and indicators
Message
Author
Phil_Trade
Posts: 94
Joined: Tue Jan 31, 2012 5:14 am
Contact:

Anybody use delphi with DCOM to drive R ?

#1 Postby Phil_Trade » Thu Feb 02, 2012 3:50 am

I have trouble with GetSymbol('xxx'). If anyone, would be glad to share experience.

Philippe
my live account - 8 based pairs with optimized parameters : +188%
http://www.myfxbook.com/members/Philipp ... jpg/519044
TradeSlide : http://bit.ly/14R9Nf6

to be informed about Windev/MT4 services : a04486-tradingsignal@yahoo.fr

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#2 Postby FT Support » Thu Feb 02, 2012 7:20 am

Hello,

What concrete trouble do you have?
Check our other product here:
http://www.forexcopier.com

Phil_Trade
Posts: 94
Joined: Tue Jan 31, 2012 5:14 am
Contact:

#3 Postby Phil_Trade » Thu Feb 02, 2012 7:59 am

FT Support wrote:Hello,

What concrete trouble do you have?


Ok the full story :D

I wrote a multi currency MT4 EA that communicate with R software via a DLL to compute cointegration p_value. It'work fine in forward test.

My goal is to verify it with ForexTesTer.
I have installed a new R sofware with Rdcom.
I have integrated in Delphi 7 the STATCONNECTORSRVLib_TLB library.
so far so good I can "talk" with R to compute 1+2=3 and read the result.

for getSymbol() i just find that i need Pchar() like this

MonTest:double;
Command := Pchar('mapaire <- 1+1') ;
RHandle.EvaluateNoReturn(Command);
MonTest := RHandle.GetSymbol(Pchar('mapaire'));

-> R compute well and i receive 2 in MonTest

But I have trouble to pass a matrix of iclose('xxx',5,i) and read the result of computation.

It seems we need to translate :
- double iclose into variant
- string into Pchar


my test to pass 10 iclose value from FT / Delphi to R

i : integer;
Prix : OleVariant;
Cours1,Cours2 : variant;

Prix := VarArrayCreate([1, 10 , 2, 1], varDouble);

for i:=1 to 10 do
begin

Cours1 := iClose('EURUSD',TimeFrame,i);
Cours2 := iClose('USDJPY',TimeFrame,i);

Prix[i,1] := Cours1;
Prix[i,2] := Cours2;
end;

but i not sure at all about variant etc

Could you help me to manage matrix that transfert iclose() value from FR into R ?

thks

Philippe
my live account - 8 based pairs with optimized parameters : +188%

http://www.myfxbook.com/members/Philipp ... jpg/519044

TradeSlide : http://bit.ly/14R9Nf6



to be informed about Windev/MT4 services : a04486-tradingsignal@yahoo.fr


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 15 guests