indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Tools > Software > Tradestation

GFDL
Reply
 
Bookmark and Share LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16-03-2010, 07:17 PM
apollo12 apollo12 is offline
indiTraders VIP
 
Join Date: Oct 2009
Posts: 1,118
Thanks: 182
Thanked 2,156 Times in 903 Posts
apollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud ofapollo12 has much to be proud of
Default Request : MT4 to EL Conversion - Adaptive RSI

can any one convert this to tradestation code:-
Here is the code for Adaptive RSI

Then you just need to make a SMA of this indicator and plot it on the charts and you have the trend director

//+------------------------------------------------------------------+
//| ARSI.mq4
//+------------------------------------------------------------------+
#property copyright "Alexander Kirilyuk M."
#property link ""

#property indicator_chart_window
//#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 LimeGreen
#property indicator_color3 Red

extern int ARSIPeriod = 14;

//---- buffers
double ARSI[];
double adrsiup[];
double adrsidn[];
int init()
{
string short_name = "ARSI (" + ARSIPeriod + ")";

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ARSI);
//SetIndexDrawBegin(0,ARSIPeriod);

return(0);
}

int start()
{
int i, counted_bars = IndicatorCounted();
int limit;

if(Bars <= ARSIPeriod)
return(0);

if(counted_bars < 0)
{
return;
}

if(counted_bars == 0)
{
limit = Bars;
}
if(counted_bars > 0)
{
limit = Bars - counted_bars;
}

double sc;
for(i = limit; i >= 0; i--)
{
sc = MathAbs(iRSI(NULL, 0, ARSIPeriod, PRICE_CLOSE, i)/100.0 - 0.5) * 2.0;

if( Bars - i <= ARSIPeriod)
ARSI[i] = Close[i];
else
ARSI[i] = ARSI[i+1] + sc * (Close[i] - ARSI[i+1]);
}

return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2013, 09:30 AM
AmiSmart AmiSmart is offline
Regular
 
Join Date: Sep 2013
Posts: 53
Thanks: 2
Thanked 79 Times in 37 Posts
AmiSmart is on a distinguished roadAmiSmart is on a distinguished road
Default

Originally Posted by apollo12 View Post
can any one convert this to tradestation code:-
Here is the code for Adaptive RSI

Then you just need to make a SMA of this indicator and plot it on the charts and you have the trend director

//+------------------------------------------------------------------+
//| ARSI.mq4
//+------------------------------------------------------------------+
#property copyright "Alexander Kirilyuk M."
#property link ""

#property indicator_chart_window
//#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 LimeGreen
#property indicator_color3 Red

extern int ARSIPeriod = 14;

//---- buffers
double ARSI[];
double adrsiup[];
double adrsidn[];
int init()
{
string short_name = "ARSI (" + ARSIPeriod + ")";

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ARSI);
//SetIndexDrawBegin(0,ARSIPeriod);

return(0);
}

int start()
{
int i, counted_bars = IndicatorCounted();
int limit;

if(Bars <= ARSIPeriod)
return(0);

if(counted_bars < 0)
{
return;
}

if(counted_bars == 0)
{
limit = Bars;
}
if(counted_bars > 0)
{
limit = Bars - counted_bars;
}

double sc;
for(i = limit; i >= 0; i--)
{
sc = MathAbs(iRSI(NULL, 0, ARSIPeriod, PRICE_CLOSE, i)/100.0 - 0.5) * 2.0;

if( Bars - i <= ARSIPeriod)
ARSI[i] = Close[i];
else
ARSI[i] = ARSI[i+1] + sc * (Close[i] - ARSI[i+1]);
}

return(0);
}


PHP Code:

{*** Created by Am.I.Smart? ***}
Input:
ARSIPeriod(14);

Var: 
ARSI(0), iRSI(0), sc(0);


iRSI=RSI(Close,14);

if 
CurrentBar <=ARSIPeriod then
    ARSI 
Close
else
    
begin
       sc 
AbsValueiRSI/100.0-0.5)*2.0 ;    
       
arsi ARSI[1] + sc * ( Close ARSI[1] ) ;
    
end ;


Plot1(ARSI"ARSI"RGB(30,144,255)); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

indiTraders - Forum for the Active Indian Trader > Tools > Software > Tradestation


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


GFDL

All times are GMT +5.5. The time now is 12:11 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2