in Search

REFERENCE IN EXPLORER QUESTION FOR DOP

Last post 05-31-2008, 3:14 by wdgigi. 10 replies.
Sort Posts: Previous Next
  •  04-30-2008, 5:37 27077

    REFERENCE IN EXPLORER QUESTION FOR DOP

    Goodmorning,

    i would write an explorer code that says to me how many days are departed from the last peak low of  Dop() indicator. So i can see the stocks that are in buy zone of  hurst's cycle.

    I know what in manual is written about reference in explorer, but have you some idea to resolve the problem?

     

    Thanks.

     

    gigi

  •  04-30-2008, 20:49 27085 in reply to 27077

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    Hi gigi,

    I assume for dop, you are actually referring to the Detrended Price Oscillator (DPO() function)?

    The first thing you have to do is define the "last peak low".  You could do something like:

    Code:

    ind := dpo(25);
    level := -0.3;
    lastPeakLow:=ind < level;


    or maybe:
    Code:

    ind := dpo(25);
    lastPeakLow:= ind > ref(ind,-1) and ref(ind,-1) < ref(ind,-2);


    and then use the BarsSince() function to find the time periods (in bars) elapsed since the condition was true.  How you define it is up to you.


    Hope this helps.

    wabbit Big Smile [:D]

    P.S. Another way might be to use the Trough() function and/or TroughBars() function, but you must be accutely aware of how these functions work before attempting to use it in trading system; if you do not know how these functions work, do not use them.


    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status : wabbit.com.au SkyPE online status
    My SkyPE account : wabbit.com.au

  •  05-01-2008, 6:32 27090 in reply to 27085

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    I've put the code that you have written in idicator builder and then i've used the BarsSince() function in Explorer but there was not selected any stock.

    Where have i was wrong?

     

    thx.

     

    gigi

  •  05-01-2008, 6:40 27091 in reply to 27090

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    Please post all of the code for the exploration.

    Please indicate which code is in which column, if you have used multiple columns.


    wabbit Big Smile [:D]


    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status : wabbit.com.au SkyPE online status
    My SkyPE account : wabbit.com.au

  •  05-01-2008, 7:05 27092 in reply to 27091

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    In Explorer:

    Col A:   BarsSince(  FmlVar("Hurst Indicator","LASTPEAKLOW") )

    result: N/A

    In Indicator Builder:

    ind := DPO(42);
    level := -0.3;
    lastPeakLow:=ind < level;

    thanks.

     

    gigi

  •  05-01-2008, 9:35 27097 in reply to 27092

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    In the explorer options, uncheck the "load minimum records" and load about 200 bars of data.


    wabbit Big Smile [:D]

    P.S. You know that dpo() uses and left shifted moving average, so at the right hand edge of the chart there are N/A bars, don't you?

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status : wabbit.com.au SkyPE online status
    My SkyPE account : wabbit.com.au

  •  05-02-2008, 1:02 27108 in reply to 27097

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    Right now!

    You have turned the light! In colB i've written:  (i use the 42 span and 22 half span)

    Ref(BarsSince(  FmlVar("Hurst Indicator","LASTPEAKLOW") ),-22)+22 ;

    so i have the days from today and last peak low.

    Now i modify the DPO() with this:

    SPAN:=Input("SPAN",1,70,42);

    CLOSE-Ref( Mov(CLOSE, SPAN, SIMPLE),(SPAN/2+1));

    and then i must transform this code in percet from point so i can explorer evey stock.

    THIS IS THE CODE:

    SPAN:=Input("SPAN",1,70,42);

    (CLOSE-Ref( Mov(CLOSE, SPAN, SIMPLE),(SPAN/2+1)))*100/CLOSE

    THX

     

    gigi

     

  •  05-07-2008, 12:22 27140 in reply to 27108

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    The first footstep is made. Now the part most difficult. 
    It would need to find the distance between the last low and the low precedent and to use this distance as value for the dpo. 
     Better between the last low and the precedent. From this to that preceding anchor, to make an average to use as value for the dpo. 
    Then in explorer making the scan of the stocks that  are distant (in days) from the value dpo. 
    In this way we should find the stocks that are near to cyclical low.

    Some ideas?

     

    gigi

  •  05-30-2008, 11:50 27270 in reply to 27140

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    Hi wabbit,

    i've made a trading system with the channel from "Moving Average - Centered v4.0 by Jose Silva" and the results are too good to be true. Infact, the indicator plot on future the line and so the signal is not correct. But it would be fantastic.

    The code of system:

    buy order: Ref(LOW,-1) < Ref((FmlVar("Moving Average - Centered v4.0 by Jose Silva","CMA")*(1-(opt1/100))),-1) AND CLOSE > (FmlVar("Moving Average - Centered v4.0 by Jose Silva","CMA")*(1-(opt1/100)))

    sell order: Ref(HIGH,-1) > Ref((FmlVar("Moving Average - Centered v4.0 by Jose Silva","CMA")*(1+(opt1/100))),-1) AND CLOSE < ((FmlVar("Moving Average - Centered v4.0 by Jose Silva","CMA")*(1+(opt1/100))))

    opt1:= 3-7-1;

    I could insert an image of this system but i don't know how must i do it.

    Then i have an excel file where i've build the Hurst Cycles with some mathematic operation. I wuold insert this formula in metastock but i've no idea how make it. This would be very interesting for a trader who want to study in equis forum the market cycles.

    The excel file can i send you with skype if you want.

    thanks.

    gigi

  •  05-30-2008, 21:02 27273 in reply to 27270

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    wdgigi:
    ... the results are too good to be true.

    Whenever it seems too good to be true, it usually is. You cannot use the centered moving average as a basis for trading becuase it uses hindsight.  If you read in the info at the top of the file, it even mentions this, "{ Uses forward-referencing to center Mov Avg and project future direction.}{ Uses hindsight - do not trade! }"


    Before using any code, you MUST be fully aware of how the function works.  Sometimes, authors will point out potential pitfalls for you, warnings you are wll advised to heed; but even if there are warnings, you should still fully evaluate how each function works to understand when it will give accurate results (if ever) and when it will give erroneous or misleading results.


    wabbit Big Smile [:D]


    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status : wabbit.com.au SkyPE online status
    My SkyPE account : wabbit.com.au

  •  05-31-2008, 3:14 27276 in reply to 27273

    Re: REFERENCE IN EXPLORER QUESTION FOR DOP

    Thanks wabbit, but i am on market form almost 20 years..and i know what it means to see a fantastic equity line and then to discorver that it's impossible

    But the hurst cycles are an important help for trader who like to use forecast methods and to scann the stocks with the indicator by joe silva is very intersting.

    If you use 3 channels of the 3 cycles 60-30-15 togheter and the low price touch these channels i have good probability that the stock is near a cycle bottom. If you have a forecast of 3 cycles in the same direction and to the same price-zone it is statistically probable that you are near a reversal  pattern.

    The Dpo is used to set the probable correct duration of cycles and its peaks in percent are used to set the probable correct percentage of the envelope channel. These are the pricipal rules.

    Now we have the 2 indicators: DPO and channel by joe silva. It would need to succeed in uniting them. To calculate the middle distance from the last 3 or 4 or 5 peaks of dpo and use this distance as parameter of the centered moving average with which to calulate the channel indicator by joe silva.Then calculate the middle ampleness percentage of DPO to set the percentage of  channel by joe silva.

    Than to coplete the work is necessary to draw on the chart the cycles build with the formula that i 've written on an excel file but that i don't know write in metastock.

    I repeat, this would be a work that we can make togheter for the community in equis forum.

    bye wabbit and thank you for the help.

     

    gigi

     

View as RSS news feed in XML