Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

derek2209

Convert MT4 Indicator into Tradestation

Recommended Posts

Hi,

 

Could you please help me to convert the Turbo_JRSX.mq4 code below into

Tradestation Easylanguage.

 

Thank you in advance

 

Derek

 

---------------------------------------------------------------------------

 

http://www.mql5.com/en/code/viewcode/7900/44457/Turbo_JRSX.mq4

 



//+------------------------------------------------------------------+
//|                                                                  |
//|                 Copyright © 1999-2007, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
#property copyright "strategybuilderfx.com - modified by bluto to use typical price (HLC/3)"
#property link "finger"
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Magenta
#property indicator_level1 70
#property indicator_level2 30
#property indicator_level3 50
#property indicator_maximum 100
#property indicator_minimum 0
//---- input parameters
extern int Len=14; //---- buffers
double rsx[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
 int init() 
 {
  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,rsx);
  IndicatorShortName("Turbo_JRSX");
  return(0);
 }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
 {
  return(0);
 }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
 {
  double f88, f90;
  double f0, v4, v8, vC, v10, v14, v18, v20;
  double f8, f10, f18, f20, f28, f30, f38, f48, v1C;
  double f50, f58, f60, f68, f70, f78, f80, f40;
  //int counted_bars = IndicatorCounted(),limit,shift;
  //if (counted_bars<0) return(-1);
  //if (counted_bars>0) counted_bars--;
  double limit=Bars-(Len)-1;
  //if(counted_bars>Len) limit=Bars-counted_bars-1;
    for(int shift=limit;shift>=0;shift--) 
    {
       if (f90==0.0) 
       {
        f90=1.0;
        f0=0.0;
        if (Len-1>=5) f88=Len-1.0; else f88=5.0;
        //      f8 = 100.0*(Close[shift]);
        // 
        //      Modified for median price
        //
        f8=100.0*((High[shift]+Low[shift]+Close[shift])/3);
        f18=3.0/(Len + 2.0);
        f20=1.0 - f18;
        }
         else
        {
        if (f88<=f90) f90=f88 + 1; else f90=f90 + 1;
        f10=f8;
        //      f8 = 100*Close[shift];
        f8=100.0*((High[shift]+Low[shift]+Close[shift])/3);
        v8=f8 - f10;
        f28=f20 * f28 + f18 * v8;
        f30=f18 * f28 + f20 * f30;
        vC=f28 * 1.5 - f30 * 0.5;
        f38=f20 * f38 + f18 * vC;
        f40=f18 * f38 + f20 * f40;
        v10=f38 * 1.5 - f40 * 0.5;
        f48=f20 * f48 + f18 * v10;
        f50=f18 * f48 + f20 * f50;
        v14=f48 * 1.5 - f50 * 0.5;
        f58=f20 * f58 + f18 * MathAbs(v8);
        f60=f18 * f58 + f20 * f60;
        v18=f58 * 1.5 - f60 * 0.5;
        f68=f20 * f68 + f18 * v18;
        f70=f18 * f68 + f20 * f70;
        v1C=f68 * 1.5 - f70 * 0.5;
        f78=f20 * f78 + f18 * v1C;
        f80=f18 * f78 + f20 * f80;
        v20=f78 * 1.5 - f80 * 0.5;
//----
        if ((f88>=f90) && (f8!=f10)) f0=1.0;
        if ((f88==f90) && (f0==0.0)) f90=0.0;
       }
       if ((f88 < f90) && (v20 > 0.0000000001)) 
       {
        v4=(v14/v20 + 1.0) * 50.0;
        if (v4 > 100.0) v4=100.0;
        if (v4 < 0.0) v4=0.0;
        }
         else 
        {
        v4=50.0;
       }
     rsx[shift]=v4;
    }
//----
  return(0);
 }
//+------------------------------------------------------------------+

Share this post


Link to post
Share on other sites

Close Not tested or compiled!, needs some cleaning up work! Compare MQ4 numbers and match them to Tradestation then repost corrected code if need be!

Using elsystem;
inputs:
	int Len(14);

variables:
	double rsx(0),
	double f90(0),
	double f0(0),
	double f88(0),
	double f8(0),
	double f18(0),
	double f20(0),
	double f10(0),
	double v8(0),
	double f28(0),
	double f30(0),
	double vC(0),
	double f38(0),
	double f40(0),
	double v10(0),
	double f48(0),
	double f50(0),
	double v14(0),
	double f58(0),
	double f60(0),
	double v18(0),
	double f68(0),
	double f70(0),
	double v1C(0),
	double f78(0),
	double f80(0),
	double v20(0),
	double v4(0);

IF f90 = 0.0 THEN BEGIN
    f90 = 1.0;
    f0 = 0.0;
    IF Len - 1 >= 5 THEN f88 = Len - 1.0
    ELSE f88 = 5.0;
    f8 = 100.0 * ((High + Low + Close) / 3);
    f18 = 3.0 / (Len + 2.0){WARNING:Possible division by zero};
    f20 = 1.0 - f18;
END
ELSE BEGIN
    IF f88 <= f90 THEN f90 = f88 + 1
    ELSE f90 = f90 + 1;
    f10 = f8;
    f8 = 100.0 * ((High + Low + Close) / 3);
    v8 = f8 - f10;
    f28 = f20 * f28 + f18 * v8;
    f30 = f18 * f28 + f20 * f30;
    vC = f28 * 1.5 - f30 * 0.5;
    f38 = f20 * f38 + f18 * vC;
    f40 = f18 * f38 + f20 * f40;
    v10 = f38 * 1.5 - f40 * 0.5;
    f48 = f20 * f48 + f18 * v10;
    f50 = f18 * f48 + f20 * f50;
    v14 = f48 * 1.5 - f50 * 0.5;
    f58 = f20 * f58 + f18 * AbsValue(v8);
    f60 = f18 * f58 + f20 * f60;
    v18 = f58 * 1.5 - f60 * 0.5;
    f68 = f20 * f68 + f18 * v18;
    f70 = f18 * f68 + f20 * f70;
    v1C = f68 * 1.5 - f70 * 0.5;
    f78 = f20 * f78 + f18 * v1C;
    f80 = f18 * f78 + f20 * f80;
    v20 = f78 * 1.5 - f80 * 0.5;
    IF (f88 >= f90) AND (f8 <> f10) THEN f0 = 1.0;
    IF (f88 = f90) AND (f0 = 0.0) THEN f90 = 0.0;
END;
IF (f88 < f90) AND (v20 > 0_0000000001) THEN BEGIN
    v4 = (v14 / v20{WARNING:Possible division by zero} + 1.0) * 50.0;
    IF v4 > 100.0 THEN v4 = 100.0;
    IF v4 < 0.0 THEN v4 = 0.0;
END
ELSE v4 = 50.0;
rsx = v4;

Plot1(rsx,"rsx");

Plot2(70,"level1");
Plot3(30,"level2");
Plot4(50,"level3");

 

On 7/13/2014 at 10:22 AM, derek2209 said:

Hi,

 

I have attached an Image of the Turbo_JRSX

I hope this will help

 

Best regards,

Derek

 

150029d1404068860t

 

On 7/13/2014 at 10:22 AM, derek2209 said:

Hi,

 

I have attached an Image of the Turbo_JRSX

I hope this will help

 

Best regards,

Derek

 

150029d1404068860t

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Topics

  • Posts

    • Actions for the 23rd.  Hugely frustrating day, picked my spots but my timing was off.  I don't seem able to find a trade that will survive long enough for me to manage and test my patience, that in itself is testing me right now.
    • Actions for the 22nd.  I seem to be on a bad run, I'm really struggling with the opening minutes of the trades I'm taking and then get sucked into a little over trading.
    •   Date : 23rd January 2019.

      MACRO EVENTS & NEWS OF 23rd January 2019.



      FX News Today 10-year Treasury yields are down from overnight highs, but still up 0.7 bp at 2.746%, and 10-year JGB yields climbed 0.8 bp to -0.004%. Stock markets remained cautious during the Asian session. The Bank of Japan held policy steady, as expected, while further reducing its outlook for inflation. The resulting weakness in the Yen didn’t help stock markets and Topix and Nikkei dropped -0.60% and -0.14% respectively. The Hang Seng is also down -0.04%, despite mainland China markets initially moving higher as China’s central bank pumped liquidity into the banking system once again. Still, the measures are also a sign that officials are nervous about the slowdown in the economy and CSI 300 and Shanghai Comp are down -0.24% and -0.13%. The bank offered around 258 bln Yuan (USD 38 bln) to banks through its medium term lending tool. Markets continue to question the progress in the US-Sino trade talks, even though White House adviser Lawrence Kudlow said that the trade talks are still on and the story about cancelled preparatory meetings was “not true, there was never any meeting. We are moving toward negotiations.” The negotiations next week will be “very, very important” and “determinative”. Meanwhile, there are the first signs of a possible way out of the US government shutdown. Markets remain easily spooked, but appear to have already priced in a lot of risk last year and US stock futures are moving higher after yesterday’s sell off. Oil prices are trading at USD 53.27 per barrel. Charts of the Day

      Main Macro Events Today Canadian Retail Sales – After Wholesale Sales plummeted yesterday, Canadian Retail Sales are expected to have also declined by 0.4% m/m, with core Retail Sales (ex autos) expected to have declined by 0.6%. World Economic Forum at Davos –The second day of the WEF annual meetings held in Davos and attended by officials from over 90 countries. Comments from central bankers and other influential officials can create significant market volatility. Richmond Manufacturing Index – Expectations – The index is expected to have remained at a sub-zero level, standing at -2 after the -8 in the December release. Support and Resistance Levels
       

      Always trade with strict risk management. Your capital is the single most important aspect of your trading business.

      Please note that times displayed based on local time zone and are from time of writing this report.

      Click HERE to access the full HotForex Economic calendar.

      Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!

      Click HERE to READ more Market news.

      Dr Nektarios Michail
      Market Analyst
      HotForex

      Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • USDJPY Eyes The 109.88 Resistance Zone And Beyond USDJPY eyes the 109.88 resistance zone beyond as it looks to resume its upside pressure. On the upside, resistance comes in at 110.00 level. A turn above here will turn attention to the 110.50 level. Further out, we expect a possible move towards the 111.00 level if the earlier resistance is invalidated out. The next resistance resides at the 111.50. Its daily RSI is bullish and pointing higher suggesting further strength. On the downside, support comes in at the 109.50 level where a break will target the 109.00 level. Below that level will turn focus to the 108.50 level and then lower the 108.00 level. On the whole, USDJPY faces further upside pressure on corrective recovery.  
    • $AVGR (AVGR) Avinger stock strong day w/ bottom breakout watch above 0.38,


      analysis https://stockconsultant.com/?AVGR
×

Important Information

By using this site, you agree to our Terms of Use.