PureBytes Links
Trading Reference Links
|
Hi thanks for that it was very close. Ive attached two pictures to try and
clarify things. SMI_trade only trades/plots long if it is above 0 and
positive/rising and only shorts/plots short if it is below 0 and decreasing.
As soon as either of these is not true (ie above 0 and negative or flat it
closes any trades or does not trade). I edited your indicator to only show
one line and changed the colours so its very close but I am not sure how to
set it so that it does not trade if above 0 but flat/negative or below 0 but
flat/rising. Ultimately I am trying to get it to optimize the (range,
ema1,ema2) values for buy/sell. Thanks very much for the work you did.
Jolon
>From: Lester Vanhoff <ebsn247lsm@xxxxxxxxxxxxx>
>Reply-To: amibroker@xxxxxxxxxxxxxxx
>To: amibroker@xxxxxxxxxxxxxxx
>Subject: [amibroker] Re: Help with AFL for simple system/test
>Date: Fri, 11 May 2007 20:47:39 +0000 (UTC)
>
>Try this, but double check, I don't have any clear references identifying
>this indicator.
>
>/*** START ***/
>
>// Stochastic MOM
>// Ref: http://finance.groups.yahoo.com/group/amibroker/message/109020
>
>function StochMom(array, periods, smoothpds, smoothpds2)
>{
>mid = ( HHV(H,periods) + LLV(L,periods) )/2 ;
>diff = HHV(H,periods) - LLV(L,periods) ;
>alpha = 2 / (smoothpds+1);
>alpha2 = 2 / (smoothpds2+1);
>X1 = AMA(array-mid, alpha);
>X2 = AMA(X1, alpha2);
>X3 = AMA(diff,alpha);
>X4 = AMA(X3,alpha2)/2;
>return Min(1,(X2/X4))*100 ;
>}
>
>Param1 = ParamToggle("Price Field","Close|(H+L)/2",0);
>Price = IIf(Param1==0,C,(H+L)/2);
>
>//Stochastics
>LongK = StochMom(Price,21,10,3); // function control
>LongD = EMA(LongK,4);
>ShortK = StochMom(Price,7,3,3); // function control
>ShortD = EMA(ShortK,3);
>
>//Colour Arrays
>LongColour = IIf(LongK>LongD,colorGreen,colorRed);
>ShortColour = IIf(ShortK>ShortD,colorBlue,colorOrange);
>
>PlotOHLC(LongK,LongK,LongD,LongK,"",LongColour,styleCloud);
>PlotOHLC(ShortK,ShortK,ShortD,ShortK,"",ShortColour,styleCloud);
>Plot(50,"",colorGrey50,styleDashed|styleNoLabel);
>Plot(60,"",colorGrey50,styleDashed|styleNoLabel);
>Plot(-60,"",colorGrey50,styleDashed|styleNoLabel);
>Plot(-50,"",colorGrey50,styleDashed|styleNoLabel);
>
>/*** END ***/
>
>
>"Alan Nouray" <alann@xxxxxxxxxxxx> wrote in
>news:f22iui+3l5a@xxxxxxxxxxx:
>
> > Can you please tell me where can I get the code for Stochastic
> > Momentum Index Trade by Bill Blau?
> >
> > Alan
>
>
>
>Please note that this group is for discussion between users only.
>
>To get support from AmiBroker please send an e-mail directly to
>SUPPORT {at} amibroker.com
>
>For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>http://www.amibroker.com/devlog/
>
>For other support material please check also:
>http://www.amibroker.com/support.html
>
>Yahoo! Groups Links
>
>
>
_________________________________________________________________
Advertisement: Your Future Starts Here. Dream it? Then be it! Find it at
www.seek.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ask%3Anine%3A0%3Ahot%3Atext&_t=763838044&_r=seek_may07_futurestartshere&_m=EXT
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Attachment:
smi_and_smitrade.png
Description: PNG image
Attachment:
smi2.png
Description: PNG image
|