logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

3 Pages<123>
Options
Go to last post Go to first unread
noumann  
#21 Posted : Saturday, July 7, 2012 10:48:01 AM(UTC)
noumann

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 10/16/2009(UTC)
Posts: 34

nothing...i can't publish the correct code..sorry...please help!
noumann  
#22 Posted : Saturday, July 7, 2012 11:33:21 AM(UTC)
noumann

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 10/16/2009(UTC)
Posts: 34

Sorry for the pain :-),buy it's the only way to publish the code http://uploading.com/fil...nd%2Bex%2BBullCharts.doc
jjstein  
#23 Posted : Saturday, July 7, 2012 11:35:58 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)
Where are "HiLimitUB" and "LoLimitC" defined?
jjstein  
#24 Posted : Saturday, July 7, 2012 11:38:52 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)
Y'know, if you look at the little buttons, you'll see a Globe with Chain-Links, which you use by highlighting some text, then click the Globe, then paste the link. Makes it easier.

Like this: Link to document

jjstein  
#25 Posted : Saturday, July 7, 2012 11:43:10 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)
noumann wrote:
Sorry for the pain :-),buy it's the only way to publish the code http://uploading.com/fil...nd%2Bex%2BBullCharts.doc


After downloading, the document shows up as "Corrupted". If you have a good copy, save it as an RTF using WordPad, use MINUS and post a link.
jjstein  
#26 Posted : Saturday, July 7, 2012 12:12:21 PM(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)
OK, think I managed to extract the code, using good-old, trusty LIST. Let's see if it will post, then I'll copy it back to MS with a paste:

Code:

Mult:= Input("ATR Multiplier",0.1,3,1);
Nb:= Input("NbPeriods",1,8,8);
x:= Input("Price:[1](H+L)/2 [2]Close",1,2,1);
TruRan:= Wilders(ATR(1),Nb)*Mult;
HiLimit:=If(x=1,(H+L)/2-TruRan,C-TruRan);
LoLimit:=If(x=1,(H+L)/2+TruRan,C+TruRan);
LB:=If(HiLimit>=PREV AND HiLimit<C,HiLimit,If(C<PREV,HiLimit-0.1,PREV));
UB:=If(LoLimit<PREV AND LoLimit>C,LoLimit,If(C>PREV,LoLimit+0.1,PREV));
Trend:=If(UB>Ref(UB,-1),1,If(LB<Ref(LB,-1),-1,PREV));
Super:=If((Trend=1 AND Ref(Trend,-1)=-1) OR (Trend=1 OR Trend=0),LB,UB);
Super;

jjstein  
#27 Posted : Saturday, July 7, 2012 12:14:42 PM(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)
OK, it works. Is that what you wanted, or is it a starting point for something else?

indexarb  
#28 Posted : Sunday, July 8, 2012 12:34:22 AM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

Hi How you you create an system test for this? thx Mehul
jjstein  
#29 Posted : Sunday, July 8, 2012 4:49:54 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)
Can't say, as I don't have any background on this indicator -- the *.DOC file was corrupted. Maybe noumann can shed some light.
noumann  
#30 Posted : Sunday, July 8, 2012 7:58:40 AM(UTC)
noumann

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 10/16/2009(UTC)
Posts: 34

johnatan, That's the Supertrend Indicator developed by Oliver Seban and it should be work in any time frame as a trend identification indicator.I hope my translation from Bullcharts language Is correct.There are several versions of this indicator.Maybe the best and also the most recent version has been written by Rajandran,author of www.marketcalls.in,but it's in afl language. I'm working abut its translation in ms language but i'd need a liitle help. This is the afl code: http://minus.com/lbiCM31oYWvNwh
indexarb  
#31 Posted : Sunday, July 8, 2012 8:37:59 AM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

What variable s do you think are optimal or intranet day 1 min bars, I presume you can't optimize without a system. Tester
jjstein  
#32 Posted : Sunday, July 8, 2012 1:01:50 PM(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)
noumann wrote:
johnatan, That's the Supertrend Indicator developed by Oliver Seban and it should be work in any time frame as a trend identification indicator.

Sounds like it's a guide for trading with the trend, not a trading system?

noumann wrote:
I'm working abut its translation in ms language but i'd need a liitle help.

While AFL is similar to MS, code processing allows subroutines (something I wish MS had). You will NOT be able to translate it directly. If you can figure out exactly what it does, it might be possible to do something similar, but don't hold your breath.

noumann wrote:
This is the afl code: http://minus.com/lbiCM31oYWvNwh

Doesn't appear to be complete.

mehul  
#33 Posted : Monday, July 9, 2012 8:00:58 AM(UTC)
mehul

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/13/2007(UTC)
Posts: 3

Hi I created this indicator and it looks quite good. How would one now create a signal that gives the values of +1 if the last traded price is above the indicator value -1 if the last traded price is below the indicator value thanks mehul ***********noumanns code above************* Mult:= Input("ATR Multiplier",0.1,3,1); Nb:= Input("NbPeriods",1,8,8); x:= Input("Price:[1](H+L)/2 [2]Close",1,2,1); TruRan:= Wilders(ATR(1),Nb)*Mult; HiLimit:=If(x=1,(H+L)/2-TruRan,C-TruRan); LoLimit:=If(x=1,(H+L)/2+TruRan,C+TruRan); LB:=If(HiLimit>=PREV AND HiLimit<c,HiLimit,If(C<prev,HiLimit-0.1,PREV)); UB:=If(LoLimit<prev AND LoLimit>C,LoLimit,If(C>PREV,LoLimit+0.1,PREV)); Trend:=If(UB>Ref(UB,-1),1,If(LB<ref(LB,-1),-1,PREV)); Super:=If((Trend=1 AND Ref(Trend,-1)=-1) OR (Trend=1 OR Trend=0),LB,UB); Super;
jjstein  
#34 Posted : Monday, July 9, 2012 8:46:11 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)
Add the following code:
Code:

{Super;} <--ADD BRACES
Entry:=C>Super;
Exit:=C<Super;
Signal:=Entry-Exit;
Signal;

mehul  
#35 Posted : Monday, July 9, 2012 9:17:41 AM(UTC)
mehul

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/13/2007(UTC)
Posts: 3

so i create a new indicator with this code or add it to the existing code / indicator where do the +1 or -1 numbers go? thanks
jjstein  
#36 Posted : Monday, July 9, 2012 11:02:03 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)
You need to understand the MetaStock Formula Language (MSFL); look down, below my name, and click to get the Formula Primer.

A logical condition will evaluate to 1 for TRUE and 0 for FALSE. So, both Entry and Exit will be 1 when TRUE, and Entry - Exit will be:

Entry = +1, Exit = 0: Entry - Exit = 1 - 0 = Signal = +1
Entry = 0, Exit = 1: Entry - Exit = 0 - 1 = Signal = -1

Drag the indicator to the X-Axis, and you'll see the plot as +1 or -1.
indexarb  
#37 Posted : Wednesday, July 18, 2012 8:02:32 AM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

Hi JJstein, Thanks for the help above, another question, is there anyway that i could add, dont change the current signal if the move in the security since the last bar is less than the average move of the move inbetween the last 10 bars thx
jjstein  
#38 Posted : Wednesday, July 18, 2012 10:18:02 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)
indexarb wrote:
Hi JJstein, Thanks for the help above, another question, is there anyway that i could add, dont change the current signal if the move in the security since the last bar is less than the average move of the move inbetween the last 10 bars thx


OK, this description makes me cross-eyed! You need to explain it in detail, and more simply.

It sounds like you want to ignore a counter-signal based on certain additional conditions -- is that right?

Does "since the last bar" actually mean "since the last signal bar"?

Does "move in the security" mean change in the CLOSE price?

What does "average move of the move in between the last 10 bars" mean -- average change in the day-to-day CLOSE price?

Feel free to "dummy up" something on a chart/screen-capture.

indexarb  
#39 Posted : Thursday, July 19, 2012 12:26:06 AM(UTC)
indexarb

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/12/2012(UTC)
Posts: 44

ok let me try ... :-) if i am using 5 min bars the range for each one of the last 10 bars (T-50min) is ; range = high in bar - low in bar (5min) bar 1 - 7 ticks bar 2 - 5 ticks bar 3 - 10 ticks bar 4 - 3 ticks bar 5 - 8 ticks bar 6 - 5 ticks bar 7 - 4 ticks bar 8 - 6 ticks bar 9 - 5 ticks bar 10 - 3 ticks average = 5.6 so if the move in the latest bar generates a signal, but the range in the latest bar is less than 5.6, then the signal is ignored / not changed. however in the next bar, if the range is greater than the average, the change in signal is carried over and the overall signal is changed. any better?
jjstein  
#40 Posted : Friday, July 20, 2012 11:47:13 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)
So, you want to "filter" the signal -- use if the current Low-to-High range is greater than the 10-bar average. I only use the EOD version, but the following should work, or at least be close to what you want:

Code:

Mult:= Input("ATR Multiplier",0.1,3,1);
Nb:= Input("NbPeriods",1,8,8);
x:= Input("Price:[1](H+L)/2 [2]Close",1,2,1);
RangePds:=Input("Range",2,250,10);
Plot:=Input("Plot 0=Signal 1=SuperTrend",0,1,0);

TruRan:= Wilders(ATR(1),Nb)*Mult;
HiLimit:=If(x=1,(H+L)/2-TruRan,C-TruRan);
LoLimit:=If(x=1,(H+L)/2+TruRan,C+TruRan);
LB:=If(HiLimit>=PREV AND HiLimit<C,HiLimit,If(C<PREV,HiLimit-0.1,PREV));
UB:=If(LoLimit<PREV AND LoLimit>C,LoLimit,If(C>PREV,LoLimit+0.1,PREV));
Trend:=If(UB>Ref(UB,-1),1,If(LB<Ref(LB,-1),-1,PREV));
Super:=If((Trend=1 AND Ref(Trend,-1)=-1) OR (Trend=1 OR Trend=0),LB,UB);

Range:=H-L;
RangeAvg:=Ref(Mov(Range,RangePds,S),-1);
Filter:=Range>RangeAvg;

Entry:=Cross(CLOSE,Super) AND Filter;
Exit:=Cross(Super,CLOSE) AND Filter;

{ REMOVE EXTRA SIGNALS, +1=Buy -1=Sell }
Signal:=Cum(IsDefined(Entry+Exit))=1; { Enough data ? }
Signal:=ValueWhen(1,Entry-Exit<>0 OR Signal,Entry); { Current }
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 }
Entry:=(Exit=0)*entry; { favor EXIT }
Signal:=Entry-Exit; { Signal }
Season:=ValueWhen(1,Signal<>0,Entry)*2-1; { Signal active }

{ PLOT }
If(Plot,Super,Signal);


Users browsing this topic
Guest (Hidden)
Similar Topics
Exploration with Supertrend Indicator (Formula Assistance)
by andbertini 10/9/2017 3:09:36 PM(UTC)
Supertrend Indicator (Formula Assistance)
by hitrader 2/1/2017 10:09:39 PM(UTC)
forex supertrend indicator from prorealtime (Formula Assistance)
by garrei 8/11/2005 10:54:24 PM(UTC)
3 Pages<123>
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.