PureBytes Links
Trading Reference Links
|
--- In amibroker@xxxxxxxxxxxxxxx, "dbw451" <dbw451@xxx> wrote:
G'day David,
Thanks for your suggested solution.
I'll paste it in and see how we go.
I don't quite understand why it does work ... so, it's off the
function library for some enlightenment.
One day I guess some of this will stick!!
Cheers
Ian
> Hi Ian,
>
>
>
> All you have to do is determine the number of points between your entry
> price and your stop price and use the ApplyStop function. Here's an
example
> using your code (which would be placed at the end of your code):
>
>
>
> myStop = ValueWhen(Buy,C) - Ref(LLV(L,FXLbak),-1);
>
> ApplyStop(stopTypeLoss, stopModePoint, myStop, 1);
>
>
>
> Regards,
>
>
>
> David
>
> _____
>
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On Behalf
> Of ianjw2
> Sent: 03/02/2007 7:53 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] fixed stop loop???????????
>
>
>
> Hi all,
>
> Below is code for a system that I'm using, however, I want to
> introduce a Fixed Stop Loss. To be fixed on the Entry Signal day.
>
> Problem is, I do not have the faintest idea how to do it.
>
> As written, the value works like a trailing stop loss. I suspect it
> may need a loop. But my AFL skills still need a lot of improving I'm
> afraid. It would be great if someone could point me in the right
> direction.
>
> Cheers
> Ian
>
> /*Liquidity..........*/
> MinTo=2000000;
> LastDay=2000000;
> MinPrice=.40;
>
> TurnOv=MA(C,21)*MA(V,21)>MinTo AND V*C>Lastday AND C>Minprice;
>
> //Entry Signal
> TrendMA=MA(C,20);//Trend moving average
> EnSig=C>TrendMA;//Entry signal - Buy triggered on confirmation
>
> //Fixed Stop Loss
> //FXLbak=2;
> //FXStop=L<Ref(LLV(L,FXLbak),-1);// Fixed Stop Loss - Fixed from Entry
> Signal day
>
> // Sell Signal
> LBak=20;// Lookback periods
> ExSig=L<Ref(LLV(L,LBak),-1);// Exit signal - Sell on confirmation
>
> Buy=TurnOv AND EnSig;
> Sell=ExSig;
> Buy=ExRem(Buy,Sell);
> Sell=ExRem(Sell,Buy);
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Transfer from your equities account.
Receive up to $1,000 from GFT. Click here to learn more.
http://us.click.yahoo.com/aZttyC/X_xQAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
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/
|