Announcement

Collapse
No announcement yet.

Re: posted code

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

  • Re: posted code

    Code for first indic:-


    Inputs: Length(9),Length2(20),Vollength(3);
    Variables: CCIU(0),CCIU2(0),Condition1(false),Condition2(fals e),Condition3(false),Val1(0);


    Condition1 = CCI(Length) > 0;
    Condition2 = CCI(Length) < 0;
    Condition3 = CCI(Length) = 0;
    Val1 = average(close,4);
    If Condition1 = true then CCIU = ((CCI(Length))/40)+val1;
    If Condition2 = true then CCIU = val1 - ((CCI(Length))/-40);
    If Condition3 = true then CCIU = val1;

    CCIU2 = SmoothedAverage(CCIU, Length2);

    Plot1(CCIU, "CCI");
    Plot2(CCIU2,"CCI2");
    Plot3(Close of Data(1),"priceline");

    (This is the code for the indic itself. below is the TS CCI function code):


    Inputs: Length(NumericSimple);
    Variables: Sum(0), Counter(0), MD(0), Avg(0);

    If Length > 0 Then Begin
    Avg = Average(High + Low + Close, Length);
    MD = 0;
    For counter = 0 To Length - 1 Begin
    MD = MD + AbsValue(High[counter] + Low[counter] + Close[counter] - Avg);
    End;
    MD = MD / Length;
    If MD = 0 Then
    CCI = 0
    Else
    CCI = (High + Low + Close - Avg) / (0.015 * MD);
    End
    Else
    CCI = 0;



    The indicator plots normall cci lines, but instead of plotting them around a 0 line, treats the price line as the 0 line.

  • #2
    2nd indic

    inputs: len(3.618),Len2(30), Threshold(10);
    vars: val(0),val2(0);

    val = ergodic_CSI(len);

    val2 = ergodic_CSI(len2);


    plot1(val, "Ergotic_CSI");
    Plot2(val2, "Ergotic_CSI2");

    plot4( 0, "Zero");

    if AbsValue(val-val[1]) > Threshold then
    plot3(val, "ECO SLope")
    else
    noplot(3);

    ( Code below is ergodic function)

    inputs: len(numericsimple);
    vars: val(0),num(0), denom(0);

    num = XAverage(XAverage(C-O,5),len);
    denom = XAverage(XAverage(H-L,5),len);
    if denom > 0 then
    val = (num/denom)*100
    else
    val = 0;

    Ergodic_CSI = val;

    (courtesy Ralph Peterson)



    This plots 2 ergodic lines around a 0 line, their behaviour in relation to each other is very informative. I can elaborate if anyone is interested.

    Comment


    • #3
      third indic code

      Input: RSILen(9), LBLen(5), WAvgLen(3), oversold(25), overbought(75),Thresh(40);
      Var: RS(0),RSIL(0),RSIH(0),StochRSI(0),SRSI(0),SRSISlop e(0);

      RS=RSI(C,RSILen);
      RSIL = Lowest(RS,LBLen);
      RSIH = Highest(RS,LBLen);



      if (RSIH-RSIL) <> 0 then
      StochRSI = (RS - RSIL)/(RSIH-RSIL)
      else
      StochRSI = .5;

      Plot1(WAverage(StochRSI*100,WAvgLen),"Stoch RSI");
      Plot2( oversold, "OSold");
      Plot3( overbought,"OBought");

      SRSI = WAverage(StochRSI*100,WAvgLen);
      SRSISlope = TLSlope(SRSI[1],1,SRSI[0],0);


      If AbsValue(SRSISlope) > Thresh then
      Plot4(SRSI,"Slope alert")
      else
      NoPlot(4);

      (The code for the function is below)

      Inputs: Price(NumericSeries), Length(NumericSimple);
      Variables: Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);

      If CurrentBar = 1 AND Length > 0 Then Begin
      UpSum = 0;
      DownSum = 0;
      For Counter = 0 To Length - 1 Begin
      UpAmt = Price[Counter] - Price[Counter+1];
      If UpAmt >= 0 Then
      DownAmt = 0
      Else Begin
      DownAmt = -UpAmt;
      UpAmt = 0;
      End;
      UpSum = UpSum + UpAmt;
      DownSum = DownSum + DownAmt;
      End;
      UpAvg = UpSum / Length;
      DownAvg = DownSum / Length;
      End
      Else
      If CurrentBar > 1 AND Length > 0 Then Begin
      UpAmt = Price[0] - Price[1];
      If UpAmt >= 0 Then
      DownAmt = 0
      Else Begin
      DownAmt = -UpAmt;
      UpAmt = 0;
      End;
      UpAvg = (UpAvg[1] * (Length - 1) + UpAmt) / Length;
      DownAvg = (DownAvg[1] * (Length - 1) + DownAmt) / Length;
      End;

      If UpAvg + DownAvg <> 0 Then
      RSI = 100 * UpAvg / (UpAvg + DownAvg)
      Else
      RSI = 0;


      Ralph Peterson calls this stochastic RSI. Its a great indicator. I would imagine e signals function for RSI would do the job.

      Please note all slope alerts in TS2000i are plotted as dots on the indicator line. Useful, not essential.

      Comment


      • #4
        More code

        Inputs: Length(5);
        Variables: gap(0);

        gap = Absvalue(XAverage(Close, Length) - AverageFC(Open, Length));

        If Average(Close, Length) > Average(Open, Length)
        and gap > .2
        Then Begin
        Plot1(200, "CMA>OMA");
        Alert("Close Average is greater than Open Average");
        End
        Else Begin

        NoPlot(1);

        End;

        If Average(Close, Length) < AverageFC(Open, Length)
        and gap > .25
        Then Begin
        Plot2(200, "CMA<OMA");
        Alert("Close Average is less than Open Average");
        End
        Else Begin

        NoPlot(2);
        End;


        This code plots a series of blue and red dots or crosses in a subgraph. In TS the colour and size of the dots are user definable when u insert the indicator. This is a really great entry and exit signal and would be even better if codeable with e sigs vol weighted ma, though I see the code for this is not available or readable. I have traded off this indic alone with good results.

        The code can easily be modded to allow the gap to be a settable parameter.

        I call this indic Average Closes.

        Comment


        • #5
          Re: posted code

          If anyone is interested in the code for indics I have posted, and wants to know more about the indics, please contact me and I will explain.

          Comment


          • #6
            Looks very interesting. Please tell me more. I have been using a simple OvrBot/OvrSld system using the previously posted STOofRSI.

            Do you use the CCI and Ergodic together? It looks like they both plot around the price line. Are the STORSI and the red/blue dots from More Code confirming?

            Comment


            • #7
              re: code

              I maybe should explain why I have posted the el code below. I am looking for somebody to translate it into e sig code.
              thx in advance.

              Comment


              • #8
                Can you Post A TS Chart?

                Might Be helpful to see it Live on TS.....I am confused as to what it produces

                Comment

                Working...
                X