logo
  • Home
  • Discussions
  • Files
  • Register
  • Login
Welcome Guest! To enable all features please Login or Register.
  • Forum
  • Active Topics
  • Search
  • Help
  • Login
  • Register
  Search Search

Notification

Icon
Error

OK


Discussions  »  Product and Service Development  »  Formula Assistance  »  Help me develop my Formula ( related with Inside bar)
Help me develop my Formula ( related with Inside bar) - Help me develop my Formula ( related with Inside bar)
Options
  • Email this topic Email this topic
  • Watch this topic Watch this topic
  • Print this topic Print this topic
  • » Normal
  • Threaded
Go to last post Go to first unread
Previous Topic Next Topic
ankur_chops  
#1 Posted : Wednesday, September 5, 2012 8:09:54 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

Hi,
I want to write a formula in explorer of Metastock.
My key requirements are:
1. 5 day before range of the stock ( open-close or close-open) should be greater than or equal to average of last 20 day range( each day range is calculated by open-close or close-open )
2. after that stock should move inside of the Big day ( in this case 5 day before) ( inside )
3. and break above or below the Big day ( which came 5 day before) should be buy or sell with stop as other high or low.

please help me to write this simple exploration formula and also plz tell how will I write this in expert system.

Thanks
Ankur

Back to top
  • User Profile
  • View All Posts by User
  • View Thanks

Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.

Back to top  
jjstein  
#2 Posted : Friday, September 7, 2012 11:36:20 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Item 1 sounds like you're looking for the short-term range expansion to be equal to or greater than the long-term -- your "Big Day" condition. Item 2 you're going to need to explain more clearly. How does the "stock" move "inside"?
Back to top
  • User Profile
  • View All Posts by User
  • View Thanks
ankur_chops  
#3 Posted : Saturday, September 8, 2012 1:53:15 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

let me give u an example....
say the average range of the stock is 3 points ( open-close or close - open , avg taken for last 20 days)
5 days before, that stock abc range becomes 5 points ( so this stock can be considered )
then after this BIG candle rest 4 days are inside the big candle( i.e. open and close are inside high and low of BIG candle for each of the last 4 days)
any breakout( on closing basis) above or below the high/low of the big candle is a buy or sell signal.
hope this clears my point.
Back to top
  • User Profile
  • View All Posts by User
  • View Thanks
jjstein  
#4 Posted : Sunday, September 23, 2012 10:54:24 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Give this a try:

Code:
{ DEFINE }Range:=Abs(O-C);Range05:=Mov(Range,5,S);Range20:=Mov(Range,20,S);
{ CONDITIONS }RangeExpand:=Range05>=Range20;BigCandle:=Range>=5 AND RangeExpand;BigCandleValue:=ValueWhen(1,BigCandle,Range);Last4:={BarsSince(BigCandle)>=5 AND}Sum(Range<BigCandleValue,4)=0 ANDRangeExpand;
Entry:=CLOSE>ValueWhen(1,Last4,HIGH) AND RangeExpand;Exit:=CLOSE<ValueWhen(1,Last4,LOW) AND RangeExpand;
{ REMOVE EXTRA SIGNALS, +1=Buy -1=Sell }Init:=Cum(IsDefined(entry+exit))=1; { Flag=enough data }Same:=Entry AND Exit; { Same Bar }Signal:=ValueWhen(1,Entry-Exit<>0 OR Init,Entry); { Current Entry }Entry:=If(Same,Entry*(Signal=0),Entry); { Valid }Exit:=If(Same,Exit*Signal,Exit); { Valid }Signal:=ValueWhen(1,Entry-Exit<>0 OR Init,Entry); { Valid Current Entry }Entry:=Signal*(Alert(Signal=0,2) OR Entry*Cum(Entry)=1); { Current or 1st }Exit:=(Signal=0)*(Alert(Signal,2) OR Exit*Cum(Exit)=1); { Current or 1st }Signal:=Entry-Exit; { Filtered }Season:=ValueWhen(1,Signal<>0,Entry)*2-1; { Signal active }
{ DISPLAY }Signal;
Back to top
  • User Profile
  • View All Posts by User
  • View Thanks
ankur_chops  
#5 Posted : Wednesday, October 10, 2012 3:53:55 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

many thanks Jistein.

[edited by wabbit -- problem already posted in many other threads!]
Back to top
  • User Profile
  • View All Posts by User
  • View Thanks
Users browsing this topic
Guest (Hidden)
Discussions  »  Product and Service Development  »  Formula Assistance  »  Help me develop my Formula ( related with Inside bar)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2025, Yet Another Forum.NET
  • Terms
  • Privacy Statement
  •  
© Copyright 2025 MetaStock. All rights reserved.