Announcement

Collapse
No announcement yet.

NEWS...I am releasing my "Favourite Code"...for Code Conversion !!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NEWS...I am releasing my "Favourite Code"...for Code Conversion !!!

    Releasing my "Ratio Stop" tool.

    Why, because I would like some one to convert it to Esignal code for FREE, even esignal can include it in your library if you wish.

    The Indicator is in the same family of Parabolic stop, and the Danton Stop. ( http://www.janarps.com/products/dantonstop.htm)

    I have developed the code myself, based on the tools mentioned above. I must state the "Ratio Stop" may look like the Danton Stop but its is not his code, I have never seen any of his code or have ever purchased his code. ( ie so no legal issues)

    Its based on higher highs, and lower lows and a stop ratio that you can use to ( ie 0.68, 1.68, Fibonacci ratios are best) hold the stop and reverse line back before make as confirmed a change.

    PLEASE IF you use this code please post the ESIGNAL VERSION on this thread....as a trader I realise that two traders can have exactly the same tools and yet one can win and the other loose because its more than your tools that make you a winner, so I hope you do as well, and post your code here freely.


    HERE IS THE Tradestation 2000i ELA code.....

    Inputs :
    Series(Close),
    Ratio(1.25),{0.68,1.00,1.32,1.50,1.68}
    Forward(2),
    Back(2),
    ColorDwn(red),
    ColorUp(Blue),
    BackColor(white), {Color equals the back color of your chart}
    LineWidth(1);

    Variables : LongStop(0),Lstop(0),ShortStop(0),Sstop(0), CloseX(0), HighX(0), LowX(0), DataInput(0);

    {Using a moving average can produce better results and less }{whipsaws, use a MA thats has less lag}
    {DataInput = T3Average(Series,6);}
    {DataInput = jrc.jma.2k(Series,6,0);}
    DataInput = Series;

    CloseX = DataInput;
    HighX = High;
    LowX = Low;


    {calculate long stop}
    Lstop = lowx-(highx[1] - lowx[1])*ratio;

    If Lstop < Longstop[1] and condition1 = true then Lstop = Longstop[1];

    If closex > highest(closex[1],Forward) or lowx < lowest(lowx[1],Back) and condition1 = true then begin
    Longstop = Lstop;
    end
    else begin
    Longstop = Longstop[1];
    end;

    Condition1 = closex > Longstop;
    Condition2 = closex < Longstop;

    IF Condition1 and condition98 = false THEN
    Condition99 = TRUE{short}
    ELSE IF Condition2 THEN
    Condition99 = FALSE;{long}

    If Condition99 then Begin
    SetPlotColor(1, ColorUp);
    SetPlotWidth(1,LineWidth);
    END
    ELSE BEGIN
    SetPlotColor(1, BackColor);
    SetPlotWidth(1,0);
    End;



    Sstop = highx+(highx[1] - lowx[1])*ratio;

    If Sstop > Shortstop[1] and condition3 = true then Sstop = shortstop[1];

    If closex < lowest(closex[1],Forward) or highx > highest(highx[1],Back) and condition3 = true then begin
    Shortstop = Sstop;
    end
    else begin
    Shortstop = Shortstop[1];
    end;

    Condition3 = closex <= Shortstop;
    Condition4 = closex > Shortstop;

    IF Condition3 and condition99 = false THEN
    Condition98 = TRUE{short}
    ELSE IF Condition4 THEN
    Condition98 = FALSE;{long}


    If Condition98 then Begin
    SetPlotColor(2, ColorDwn);
    SetPlotWidth(2,LineWidth);
    END
    ELSE BEGIN
    SetPlotColor(2, BackColor);
    SetplotWidth(2,0);
    End;


    Plot1(Longstop,"Long");
    Plot2(Shortstop,"Short");


    Thx for your help......

  • #2
    Are there no takers...come on this is great code...

    Excellent for Breakout traders, or on long term charts trend determination...

    Comment


    • #3
      No offense Digs! But, welcome to the world of learning code. It can be pain staking, but very rewarding.

      Fibbgann
      Excellent book on JavaScript for beginners

      Comment


      • #4
        I cant be bothered learning the new code...,

        COME ON you coders, this code will make you money... others charge $100 dollars for this clever stuff...turn my code in to esignal and we all can prosper...

        Must be some kind sole out there !

        Comment


        • #5
          A quick TS-to-eSignal conversion is attached. Could definitely be made more efficient but it should work fine as is.

          Chris
          Attached Files

          Comment


          • #6
            ckryza, thx I will check it out...

            You are a kind sole...they do exist...

            Comment


            • #7
              I see that many of you have download my converted code, hope you enjoy it, therefore I hope you show the same kindness that I have and post any possible code improvements or indicator uses.

              As I have stated in the code example, the data series going into the stop loss tool can either be close or a data series like a moving average ( say the Juriks JMA, or T3Average).

              Also you can use the code on a higher time frame like 5 min bars and use 1 min bars to trade with the 5 min trend.

              Ok just like parabolic stop, but you will find this code is much better when the stock gaps or jumps quickly.


              Like I said please share your improvements to this code ... as I have done.

              Cheers

              Comment


              • #8
                Just check the code on sone stocks with 1 min bars, its is excellent.

                Add changes.....
                Turn Off calc by every tick, see line 62
                Set ratio Default to 0.68
                Set Price to HL/2

                add this code to "getPrice" Function, around line 262

                else if ( Price == "HL/2" ) {
                return( (high(-nOffset)+low(-nOffset)) / 2 );
                }

                and add this to line 79
                addOption( "HL/2" );

                NOTE : The stop line is not a continous line, I will check this out.

                Comment


                • #9
                  Digs,
                  I just took a quick look at the code Chris wrote for you...there seems to be an error in the last two "else if..." statements in the getPrice() function. They are backwards. I mean the "else if( Price == High) return low(-nOffset)" should read "return(high(-nOffset)" and vice versa for the following else if statement.

                  I haven't had the chance to look at much else with the study.

                  I went to the Danton Long info link you posted...interesting...do you also use the other study they mention? That is, the Danton ShockWave?

                  Thanks for the code Chris, as always.

                  Bob

                  Comment


                  • #10
                    I am using code realtime on 1 min charts, all seams fine here.

                    NO i do not use any of the DANTON indicators , only the ratio stop. I mostly use it around entry time on break outs, for my "oh hell" line when things a going wrong. This keeps me out of really big losses on one trade.

                    Comment


                    • #11
                      rmClean,

                      Also please re write the code as you thing it should be, see if it worksm if its better please post it here, as improved code. THX

                      Comment


                      • #12
                        Digs,
                        There only the two changes that I mentioned earlier. (So far, I haven't had time to go any deeper)

                        These lines should replace the last two else if statements in the function named getPrice( Price, nOffset )

                        Here are the correct statements:

                        else if ( Price == "High" ) {
                        return( high(-nOffset) );
                        }
                        else if ( Price == "Low" ) {
                        return( low(-nOffset) );
                        }

                        If you don't know how to open the script editor and change the lines, I will post the whole study...let me know

                        Bob

                        Comment


                        • #13
                          Your correct code was back to front..thx for the fix.

                          Comment


                          • #14
                            Please post the code

                            rmcclean:
                            Can you please post the code or just attach the efs.

                            Thanks,
                            Harndog

                            Comment


                            • #15
                              Harndog,
                              Here is the file attached. I renamed it with capital letters to distinguish it from the original...which I hope will work on this Bulletin Board file system...

                              Good luck, Bob
                              Attached Files

                              Comment

                              Working...
                              X