[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: profit target question



PureBytes Links

Trading Reference Links

I think Tomasz may have to jump in with some help..., I do not know if the
SellPrice and Coverprice arrays are updated with the stop price used by the
ApplyStop(), so that you can use it after the ApplyStop... you may play with
the code below, sorry I can't be more helpful mainly because this topic is
confuses the heck out of me.

Note that two == are needed where used.
h

LPos = Flip(Buy,Sell);
SPos = Flip(Short,Cover);
LPT = Optimize("LProfitTarget",3.4,0,10,0.1);
SPT= Optimize("SProfitTarget",5,0,10,0.1);
PT =IIf(LPos,LPT,IIf(SPos,SPT,0));
ApplyStop(1,1,PT,False);
Equity(1);

Short = Sell==3 OR Sell;
ShortPrice=SellPrice;
E=Equity(1);
Sell == Short ==3 OR Short;
SellPrice = ShortPrice;
E=Equity(1);
Plot(E,"Equity",1,1);


-----Original Message-----
From: Adrian Zaremba [mailto:headcutter@xxxxxxxx]
Sent: Monday, August 18, 2003 12:37 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: profit target question


You mean the code should look like this(it is not working)?:

ApplyStop( 1, 1, 1, True, False ); /* Profit Target */
Equity(1);
Short = Sell=3;
ShortPrice = SellPrice;
Equity(1);


--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen"
<psytek@xxxx> wrote:
> You could use
> Equity(1); // after the ApplyStop to update Signal and price
arrays.
> Short = Sell==3; // Profit stop was executed
> ShortPrice = SellPrice; // The SellPrice you used before (same bar)
>
> // You may need to call Equity(1) again to fix signal/price arrays
>
> You must enable "Allow same Bar Exits" in AA Settings
and "Activate Stops
> Immediately".
>
> Verify all prices in Trade Listings, this kind of stuff confuses
me.
>
> Hope i got this right... Good luck,
> Herman.
>
>
> -----Original Message-----
> From: Adrian Zaremba [mailto:headcutter@x...]
> Sent: Monday, August 18, 2003 7:22 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] profit target question
>
>
> I use this code for profit target:
>
> ApplyStop( 1, 1, Optimize( "Profit Target", 1, 1, 15, 0.5 ), True,
> False );
>
> The problem is that when the price reaches the profit target level
> it exits the trade, but I would also want to enter a opposite trade
> at the same time, so if I were long ,I want to go short. Can I
> modify this line in some way to make this work? Thanks
>
>
>
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/