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

Re: [amibroker] same problem



PureBytes Links

Trading Reference Links

Adrian,

You should change your code to:

buy = Cross(X, X);
sell = Cross(X, X);
Short = Sell;
Cover = Buy;
ApplyStop( 1, 1, Optimize( "Profit Target", X, X, X,X ), True ); /* Profit Target */
Equity(1); // evaluates stops
Short = Sell; // make sure that both normal sells (==1) and stops (==3) trigger entering short
ShortPrice = SellPrice;


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Adrian Zaremba" <headcutter@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, August 28, 2003 4:56 PM
Subject: [amibroker] same problem


> sell = Cross(X, X);
> buy = Cross(X, X);
> Short = Sell;
> Cover = Buy;
> ApplyStop( 1, 1, Optimize( "Profit Target", X, X, X,X ), False, 
> False ); /* Profit Target */
> Short = Sell == 3;
> Equity(0);
> ShortPrice = SellPrice;
> Equity(0);
> 
> OK I asked this question earlier but it still isnt working properly. 
> This code only generates Long signals(it is either Out or Long), if 
> I do not use the last 4 lines it generates long and short(it works 
> correctly) but it doesnt work in such a manner that when the profit 
> target is hit I trade in the opposite direction(and that is what I 
> want). Any ideas? Thanks
> 
> 
> 
> 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/