PureBytes Links
Trading Reference Links
|
hi Werner,
in my opinion it should look something like (I did not test this !). Rgds, Ed
// Buy and Short definition
Buy = your definition;
BuyPrice = ....;
Short = your definition;
ShortPrice = ....;
// now define the profit level. Make it 2% at all places and Adjust in the neighbourhood of Buy and Short signal
profitLevel = 2;
profitLevel = IIF(Buy OR Short,6,profitLevel);
profitLevel = IIF(Ref(Buy,-1) OR Ref(Short,-1),5,profitLevel);
profitLevel = IIF(Ref(Buy,-2) OR Ref(Short,-2),4,profitLevel);
profitLevel = IIF(Ref(Buy,-3) OR Ref(Short,-3),3,profitLevel);
// set the Sell and Cover
Sell = 0;
Cover = 0;
ApplyStop(stopTypeProfit, stopModePercent, profitLevel, ExitAtStop=1,Volatile=False, ReEntryDelay=3);
SellPrice = ......;
CoverPrice = .....;
Equity(1);
----- Original Message -----
From: Werner
To: amibroker@xxxxxxxxxxxxxxx
Sent: Thursday, November 04, 2004 3:02 PM
Subject: [amibroker] Re: Can I have different APPLYSTOPs ?
Ed,
thanks for your reply.
I am still scratching my head on HOW to do this?
I am thinking I need the "BarsSince" function,
but could not formulate a working array for my ApplyStop.
Maybe someone can enlighten me?
Thanks,
Werner
---------------------------------------------------------------------
--- In amibroker@xxxxxxxxxxxxxxx, "ed nl" <ed2000nl@xxxx> wrote:
> hi,
>
> like the manual says the "amount" can be a number or an array. So
if you like to use a dynamic stop level you need to fill an array to
your liking. Trick now is how to fill this array properly. Because at
the position of a Buy or Short signal you want to fill this array
with 6, the next day with 3 etc.
>
> If you know the positions of the Buy, Sell, Short, Cover then this
is easy. Problem is that you do not have all this information since
you only can see the full picture after Applystop is applied. That is
one of the reasons I write my own stop code using loops.
>
> But what you like to do is apply a dynamic stop and that is
possible,
>
> rgds, Ed
>
>
> ----- Original Message -----
> From: Werner
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Thursday, November 04, 2004 1:34 PM
> Subject: [amibroker] Can I have different APPLYSTOPs ?
>
>
>
> Good day,
>
> I have a question with ApplyStop.
> I would like to test Profit Targets depending on how many days
have
> passed in the trade. This is because the 6% Profit Stop is fine
for
> the first day, but on the 2nd or 3rd day only a 3% Profit might be
> available, but not a 6%. The idea is, to lower the profit target
as
> the trade matures.
>
> So far, I have:
>
> ApplyStop (stopTypeProfit, stopModePercent, 6, ExitAtStop=1,
> Volatile=False, ReEntryDelay=3);
>
> For DAY 2, I'd like to change the StopModePercent to - let's say -
3%
> and
> on Day 3 maybe to 2%.
>
> How do I do that?
>
> Thanks.
>
> Werner
>
>
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> Yahoo! Groups Sponsor
>
> Get unlimited calls to
>
> U.S./Canada
>
>
>
>
> --------------------------------------------------------------------
----------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/amibroker/
>
> b.. To unsubscribe from this group, send an email to:
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
>
> [Non-text portions of this message have been removed]
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
Get unlimited calls to
U.S./Canada
------------------------------------------------------------------------------
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
b.. To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|