Coding Forum Collaborate, receive help, or discuss indicators and other codingrelated topics 
05252010, 11:02 AM  #17  
Re: Convert MT4 Indicator into Tradestation Eld? its only my simple indicator to plot local time on chart Quote:
Last edited by furtrader; 05252010 at 11:23 AM.  

09212011, 06:51 AM  #18  
Re: Convert MT4 Indicator into Tradestation Eld?
i just curious that anyone could convert following MT4 indicators to easy language. as far as i know these advanced indicators are never been converted to TS. One Side Gaussian Filter One side gaussian ... Fractal Graph Dimension Indicator Fractal Graph Dimension Indicator (FGDI)  MQL4 Code Base Variation Index Variation Index  MQL4 Code Base  

09262011, 03:43 PM  #19  
Re: Convert MT4 Indicator into Tradestation Eld? Code: //+ + / /  Hodrick  Prescott Filter.mq5  / /  Copyright 2010 gpwr  / /  vlad1004@yahoo.com  //+ + # property copyright "gpwr" # property version "1.00" # property description "Hodrick  Prescott Filter" # property indicator_chart_window # property indicator_buffers 1 # property indicator_plots 1 # property indicator_label1 "filter" # property indicator_type1 DRAW_LINE # property indicator_color1 Red # property indicator_style1 STYLE_SOLID # property indicator_width1 1 //===================================== INPUTS ========== ================================= input int Per = 50; / / HP filter period input int N = 500 / / # of prices to smooth / / Global variables int PrevBars; double Lambda; / / Indicator buffers double hpf []; / / Custom indicator initialization function   + void OnInit () { / / Initialize global variables PrevBars = Bars (_Symbol, _Period) 1; Lambda = 0.0625/MathPow (MathSin (M_PI / Per), 4); / / Map indicator buffers ArraySetAsSeries (hpf, true); SetIndexBuffer (0 hpf, INDICATOR_DATA); IndicatorSetInteger (INDICATOR_DIGITS, _Digits); IndicatorSetString (INDICATOR_SHORTNAME "HPF ("+ string (Per )+")"); } //====================================== MAIN ========= =================================== int OnCalculate (const int bars, const int prev_calculated, const datetime & Time [], const double & Open [], const double & High [], const double & Low [], const double & Close [], const long & tick_volume [], const long & volume [], const int & spread []) { / / Check for insufficient data and new bar if (bars <N) { Print ( "Error : not enough bars in history!"); return (0); } if (PrevBars == bars) return (bars); PrevBars = bars; / / Initialize indicator buffer to EMPTY_VALUE ArrayInitialize (hpf, EMPTY_VALUE); / / Reverse indexing direction for Open ArraySetAsSeries (Open, true); / / Main cycle  + for (int i = 0; i <N; i + +) hpf [i] = Open [i]; HPF (N, Lambda, hpf); return (bars); } //==================================== FUNCTIONS =========== ============================== / / Hodrick  Prescott Filter  + void HPF (int n, double lambda, double & x []) { double a [], b [], c [], h1, h2, h3, h4, h5, hh1, hh2, hh3, hh5, hb, hc, z; ArrayResize (a, n); ArrayResize (b, n); ArrayResize (c, n); a [0] = 1.0 + lambda; b [0] = 2.0 * lambda; c [0] = lambda; for (int i = 1; i <n  2; i + +) { a [i] = 6.0 * lambda +1.0; b [i] = 4.0 * lambda; c [i] = lambda; } a [1] = 5.0 * lambda +1; a [n  1] = 1.0 + lambda; a [n  2] = 5.0 * lambda +1.0; b [n  2] = 2.0 * lambda; b [n  1] = 0.0; c [n  2] = 0.0; c [n  1] = 0.0; / / Forward for (int i = 0; i <n; i + +) { z = a [i]  h4 * h1  hh5 * hh2; hb = b [i]; hh1 = h1; h1 = (hb  h4 * h2) / z; b [i] = h1; hc = c [i]; hh2 = h2; h2 = hc / z; c [i] = h2; a [i] = (x [i]  hh3 * hh5  h3 * h4) / z; hh3 = h3; h3 = a [i]; h4 = hb  h5 * hh1; hh5 = h5; h5 = hc; } / / Backward h2 = 0; h1 = a [n  1]; x [n  1] = h1; for (int i = n  2; i> = 0; i ) { x [i] = a [i]  b [i] * h1  c [i] * h2; h2 = h1; h1 = x [i]; } } i've tried by myself but i've stucked in the Forward iteration part. he used one variable named x in the forward interation and it's third parameter of the function itself. but i don't know how to handle it on tradestation. Last edited by r4bb1t; 09262011 at 04:07 PM.  

09262011, 07:53 PM  #20  
Re: Convert MT4 Indicator into Tradestation Eld? Quote:
what chances are someone would like to collaborate in this ?
__________________ Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.  

09262011, 08:44 PM  #21  
Re: Convert MT4 Indicator into Tradestation Eld? Quote:
eKam Clock and Timer Here is some really simple code that I create: Code: Once Begin Value1=Text_new(D,T,H,numtostr(T,2)); End; Text_SetString(Value1, NumToStr(T,2)); Text_SetLocation(Value1, D, T, getappinfo(aihighestDispValue));  

09262011, 09:00 PM  #22  
Re: Convert MT4 Indicator into Tradestation Eld? Quote:
this code only gives you the ending time of the bar. you should use currenttime: Text_SetString(Value1, NumToStr(CURRENTTIME,0)); MultiCharts user can use CURRENTTIME_s, which gives the seconds portion of the time. ps. there is a function/keyword to format the time into hh:mm:ss
__________________ Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.  

The Following User Says Thank You to Tams For This Useful Post:  
Tradewinds (09262011) 
09262011, 09:33 PM  #23  
Re: Convert MT4 Indicator into Tradestation Eld? Quote:
 

09262011, 10:05 PM  #24  
Re: Convert MT4 Indicator into Tradestation Eld? Quote:
__________________ Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.  

Thread Tools  
Display Modes  Help Others By Rating This Thread 

∧ Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Any Tradestation Market Profile Indicator?  agabr  Coding Forum  6  08122011 05:23 PM 
BidAsk Pressure Indicator for Tradestation  Soultrader  Trading Indicators  81  08182009 03:29 PM 
Alchemy TradeStation Indicator Package  captjoe  Coding Forum  1  11292008 08:05 PM 
Colby Indicator For Tradestation  slableak  Brokers and Data Feeds  12  11292008 10:23 AM 
BRICKS Indicator for Tradestation  Soultrader  Trading Indicators  8  02232008 09:10 PM 