[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EquisMetaStock Group] How do I generate a conditional clear signal for an average price?
- To: equismetastock@xxxxxxxxxxxxxxx
- Subject: [EquisMetaStock Group] How do I generate a conditional clear signal for an average price?
- From: "wwflhp" <wwfarr@xxxxxxxxx>
- Date: Thu, 14 Dec 2006 19:48:46 -0000
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Delivered-to: mailing list equismetastock@xxxxxxxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=lima; d=yahoogroups.com;b=qm0rib3sI/3VEO5x2w3yKu1Mc3Uz9fJzPy9wY/UYReNDJWzGFfrSOJp6SYfEjbP1jDYrbZc5lUpQHaw4nWnj7MY6HnVvbXLkUPzDIREmyuN3jutHZwYeILfLWWeuQnOl;
- List-id: <equismetastock.yahoogroups.com>
- List-unsubscribe: <mailto:equismetastock-unsubscribe@xxxxxxxxxxxxxxx>
- Mailing-list: list equismetastock@xxxxxxxxxxxxxxx; contact equismetastock-owner@xxxxxxxxxxxxxxx
- Reply-to: equismetastock@xxxxxxxxxxxxxxx
- Sender: equismetastock@xxxxxxxxxxxxxxx
- User-agent: eGroups-EW/0.82
Version Used 9.0
Date: 12-9-06
Subject: How do I generate a conditional clear signal for an average
price?
I want to have a sell signal that is conditional on the average price
of pyramided buys. That is, the sell signal is only generated if the
current closing price of a stock exceeds the average purchase price
after several pyramided fixed $ amount buy signals. The problem is,
how do I clear the total invested and total shares owned sum variables
to zero only after the conditional sell signal is generated?
Specifically;
PurchaseAmount:=5000;
BuySignal:= Cross(C,Mov(C,20,E));
TotalInvested:= If(BuySignal,PREV+PurchaseAmount,PREV);
TotalShares:= If(BuySignal,PREV+(PurchaseAmount/C),PREV);
AvePrice:=TotalInvested/TotalShares;
SellCondition:=Cross(Mov(C,20,E),C);
SellSignal:=SellCondition AND (C>(AvePrice));
How do I clear TotalInvested and TotalShares, to 0 only if sell signal
is true?
I tried many variations following the SellSignal including;
If(SellSignal,TotalInvested=0,Ref(TotalInvested,-1));
If(SellSignal,TotalShares=0,Ref(TotalShares,-1));
I've also tried
If(Ref(SellSignal,-1),TotalInvested=0,Ref(TotalInvested,-1));
If(Ref(SellSignal,-1),TotalShares=0,Ref(TotalShares,-1));
And I've tried
If(Ref(SellSignal,-1),TotalInvested=0,
TotalInvested=Ref(TotalInvested,-1));
If(Ref(SellSignal,-1),TotalShares=0, TotalShares=Ref(TotalShares,-1));
But I get strange results. I can't get TotalInvested and TotalShares
to go to 0 after the SellSignal and to stay 0 until the next
BuySignal. Thanks and Happy Holidays, Bill
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/

PureLinks - Finance Banners.