[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Re: Help with an Indicator



PureBytes Links

Trading Reference Links

Hi
   
  I m also having difficulty with a formula 
   
  I m trying to put together a simple  Darvas Buys and Sells scan with stop losses and some history as to how many days the last signal was and what value the underlying equity was when that signal was given. 
   
  So far I have two explorations one for buys and one for sells.  I ve tried putting in barsince and the value when the last signal was given 
   
  Because I m unable to distinguish what the last signal was,  I m getting one value for longs ie the last buy in days and for sells I m getting another value thus the same equity appears on both the sell and buy history list.
   
  Short of just filtering the buys and sells as they are generated in their respective scans is there away of filtering equities so they do not apprear on both lists?
   
  I think what I need is a filtering system that uses what was the last signal
   
  Any ideas?
   
  Bill
   
  

Jose Silva <josesilva22@xxxxxxxxx> wrote:
  Chorlton, try this indicator code:


===============
Chorlton custom
===============
---8<---------------------------

{ http://www.metastocktools.com }

{ User inputs }
sm:=Input("Starting Month",1,12,1);
sd:=Input("Starting Day of Month",1,31,1);
sy:=Input("Starting Year",1980,2100,2006);
type:=Input("Band type  [1]High/Low since day 1,  [2]H/L of bar",1,2,
1);

{ Selected date signal }
start:=Year()>sy
OR (Year()=sy AND (Month()>sm
OR Month()=sm AND DayOfMonth()>=sd));
d1:=start AND Alert(start=0,2);

{ Custom plot }
pv:=MP()*Cum(V);
denom:=If(Cum(V)-ValueWhen(1,d1,V)=0,1,
Cum(V)-ValueWhen(1,d1,V));
plot:=If(BarsSince(d1),(pv)/denom,MP());

{ Upper/Lower bands }
Hi:=HighestSince(1,d1,H);
Lo:=LowestSince(1,d1,L);
range:=If(type=1,(Hi-Lo)/2,(H-L)/2);
UpperBand:=plot+range;
LowerBand:=plot-range;

{ Plot on price chart }
UpperBand;LowerBand;plot

---8<---------------------------


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, "chorlton_c_hardy" 
<micro_dot_uk@xxx> wrote:
>
> 
> Hi All,
> 
> I'm having a few problems trying to modify an existing indicator and 
> would very much welcome any help in solving it.
> 
> I currently have the following indicator which plots a line on the 
> price chart:
> 
> sm:=Input("Starting Month         (Month must exist in 
> chart)",1,12,1);
> sd:=Input("Starting Day of Month (Day must exist in chart)",1,31,1);
> sy:=Input("Starting Year",1980,2100,2000);
> d1:= sd=DayOfMonth() AND sm=Month() AND sy=Year();
> pv:=MP()*Cum(V);
> denom:=If(Cum(V)-ValueWhen(1,d1,V)=0,1,Cum(V)-ValueWhen(1,d1,V));
> 
> If(BarsSince(d1),(pv)/denom, MP())
> 
> 
> What I would like to do is add 2 further lines which will act as an 
> UPPER and a LOWER band. 
> 
> The Upper band should be the value of the above indicator PLUS the 
> difference between the HIGH & LOW for the same period divided by 2. 
> (ie. Value for above indicator + (HIGH-LOW)/2
> 
> The Lower band should be similar to the above but instead of adding 
> the (HIGH-LOW)/2 it should be deducted.
> 
> I hope this makes sense :-/
> 
> Any help much appreciated........
> 
> Many Thanks,
> 
> Chorlton








  SPONSORED LINKS 
        Business finance course   Business to business finance   Small business finance     Business finance consultant   Business finance magazine   Business finance schools 
    
---------------------------------
  YAHOO! GROUPS LINKS 

    
    Visit your group "equismetastock" on the web.
    
    To unsubscribe from this group, send an email to:
 equismetastock-unsubscribe@xxxxxxxxxxxxxxx
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

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



Send instant messages to your online friends http://uk.messenger.yahoo.com 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/