PureBytes Links
Trading Reference Links
|
Hi Phsst,
I am kind of lost here. ^^_^^ Please see my comments in line below.
Thursday, November 27, 2003, 2:25:11 AM, you wrote:
P> Yuki,
P> This meets your first requirement. You can probably figure out #2, but
P> yell if you need help.
P> This was altered from someone else's sample code but I don't remember who.
P> //--------------------------------
P> // Test Next Day Exit
P> Buy = Sell = Short = Cover = False; // Initialize Arrays
Where would I put the line above? I already have a system in place
that exits on the next day. Would that statement go after the normal
buy statement?
P> // overide default settings
P> SetTradeDelays(0,0,0,0);
I use this line above already.
P> // make a simple trading system
P> Buy = Cross(RSI(),30);
This is easy enough, just substitute my own buy rules here. But I
need to include the short side as well, and I have rules for that
too, of course.
P> // buy the next day at the open
P> // use Ref(Buy -1) because the Ref function returns a value
P> // so the "1" numbers inside the Buy array are moved forward this way.
P> Buy = Ref(Buy, -1);
Okay . . . I think I have become terribly confused here, which is
normal for me when trying to figure out code. ^_-
If I buy 'next day at the open', that is not my system then, is it?
My system buys or shorts intraday, depending on price reaching a
'BStopLevel' or a 'SStopLevel'. Then buyprice = BStopLevel and
shortprice = SStopLevel. Doesn't the code in the graph directly
below foul up my own code?
P> // define the BuyPrice
P> BuyPrice = ValueWhen( Buy, Open);
P> Sell = BarsSince(Buy) == 1;
P> SellPrice = IIf(Open >= BuyPrice,Open,C);
Okay . . . *this* line just above looks right to me. It's an exit
that exits on the open if the open is > buyprice. I can write the
opposite for the short I'm sure, using coverprice.
P> Buy = ExRem(Buy,Sell);
P> Sell = ExRem(Sell,Buy);
P> Filter = 1;
P> AddColumn(BarsSince(Buy),"BarsSince(Buy)",1.0);
P> //-----------------------------------------
P> Regards,
P> Phsst
I take it you would set this up as an exploration? That never
occurred to me, and I had wanted to set it up as a system, so I could
get some profitability feedback on it.
I wish I wish I wish I was better at this.
Yuki
------------------------ 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/mOAaAA/3exGAA/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/
|