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

[amibroker] Re: Code challenge - gurus on your toes!



PureBytes Links

Trading Reference Links

<Dale, you have probably forgotten more about system design than I
know but for what it is worth I do use delay=1 and Price=Open for
evaluation and back testing in AA, although in practice I seldom
actual buy the open. I have been burned too many times by this fickle
market. Instead I wait 30 minutes to let the dust settle. Interday I
plot actual signals based on high or low. (delay=o)>

I don't target to trade Mkt OPEN either... but prefer to trade Limit
or Stop orders based upon previous days price action. 

In the case of Buy Limit orders, I usually determine the Limit price
from previous days Close, and to my surprise, I very often get actual
executions at OPEN the following day which are significantly less than
previous days close (my limit order) and have experienced positive
trading system outcomes as a result (my primary trading system is a
pullback system). Also, when this occurs it is not unusual for the
OPEN to be the low for the day!

You can setup your backtest's for this condition, and depending upon
your trading system you will observe backtest results that mirror what
I have encountered in actual trades.

Logically, I thought that MM's would look at limit orders at open and
take them out before gapping down, but that has not been my actual
trading experience with these orders (either NYSE or NASD).

My point is that while you may not want to trade the OPEN with market
orders... the OPEN is not necessarily your enemy either... it can be
your friend when your trading system picks out pullbacks that are
close enough to exhaustion gaps which can be exploited using Limit orders.

And as far as using Amibroker to signal trades with delay = 1 and
Price = Open on the evening before the trade... here is a code snipet
that should come close:

(b is the boolean BUY trigger variable)

b = BUY CONDITION SETUP
PctRisk = C - (L - 0.1) / C;
TargetPrice = HHV(C,10);
PctGain = (TargetPrice - C) / C;
b = b AND PctGain >= 0.12;    // At least 12% Profit potential
BuyPrice = Min(Ref(C,-1),O); // Lessor of Previous Close or Todays open
b = b AND BuyPrice > L;
Buy = b;

That should do it, if I have not mis-understood what you are asking for.

OR simply code BuyPrice = O;

Phsst

--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> Dale,
> 
> Often I just guess <G>
> 
> Help defines an array as....
> What is an Array?
> 
> An array is simply a list (or row) of values. In some books it may be
> referred to as a vector. Each numbered row of values in the example
> represents an individual array. Amibroker has stored in its database 6
> arrays for each stock. One for opening price, one for the low price,
one for
> the high price, one for the closing price and one for volume (see
the rows
> labeled 1-5 below) and one for open interest. These can be
referenced in AFL
> as open, low, high, close, volume, openint or o, l, h, c, v, oi.
> 
> If you are referencing one of the 6 arrays or making calculations
based on
> them then it is an array.  In your example you used Status to
determine what
> AB was doing (Scan, Explore etc) Since this state is not stored nor
> calculated from the six arrays you must  use lastvalue() .
> 
> " One more thing: Do you use Amibroker to signal trades with delay =
1 and
> Price = Open?  On the evening before the trade do you use plots to
tell you
> to trade the next morning or do you use some formula in the AA and run a
> Scan or Explore to tell you?"
> 
> Dale, you have probably forgotten more about system design than I
know but
> for what it is worth I do use delay=1 and Price=Open for evaluation
and back
> testing in AA, although in practice I seldom actual buy the open. I have
> been burned too many times by this fickle market. Instead I wait 30
minutes
> to let the dust settle. Interday I plot actual signals based on high
or low.
> (delay=o)
> 
> Regards,
> 
> jayson
> 
> 
> 
> 
> 
> 
> 
> Jayson
> -----Original Message-----
> From: dingo [mailto:dingo@x...]
> Sent: Monday, March 17, 2003 4:23 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] Code challenge - gurus on your toes!
> 
> 
> Have I tried it? NO but looks like that is the magic answer!!!
> 
> 
> 
> I get totally wrapped around the axle to this day on what is an
array and
> what is not an array.
> 
> 
> 
> If you have the time could you explain how this works at the
individual bar
> level? If not I understand and really appreciate this!! It just
might help
> the little light go on in my head (yea, right!).
> 
> 
> 
> One more thing: Do you use Amibroker to signal trades with delay = 1 and
> Price = Open?  On the evening before the trade do you use plots to
tell you
> to trade the next morning or do you use some formula in the AA and run a
> Scan or Explore to tell you?
> 
> 
> 
> Thanks Jason!  You are great to be here help us as much as you do!
> 
> 
> 
> d
> 
> 
> 
> -----Original Message-----
> From: Jayson [mailto:jcasavant@x...]
> Sent: Monday, March 17, 2003 3:56 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] Code challenge - gurus on your toes!
> 
> 
> 
> Dale have you tried lastvalue(tmpdelay)
> 
> 
> 
> 
> 
> tmpDelay = IIf(Status("action") == 5, 1, 0);
> 
> tmpdelay=LastValue(tmpdelay);
> 
> 
> 
> I think this needs to be a fixed number..
> 
> 
> 
> Jayson
> 
> -----Original Message-----
> From: dingo [mailto:dingo@x...]
> Sent: Monday, March 17, 2003 3:41 PM
> To: _amibroker_yahoo
> Subject: [amibroker] Code challenge - gurus on your toes!
> 
> I'm trying to write some AFL code that will change the trade delays and
> trade prices based solely on whether the code is being run in the back
> tester/optimizer or not.
> 
> Here's a feeble attempt that doesn't work:
> 
> tmpDelay = IIf(Status("action") == 5, 1, 0);
> tmpPrice = IIf(Status("action") == 5, Open, Close);
> 
> SetTradeDelays(tmpDelay, tmpDelay, tmpDelay, tmpDelay);
> BuyPrice = SellPrice = ShortPrice = CoverPrice = tmpPrice;
> 
> Lets see if you can solve this one!  (Use of vbScript is permissable)
> 
> d
> 
> 
> 
> 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 the Yahoo! Terms of Service.
> 
> 
> 
> 
> 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 the Yahoo! Terms of Service.
> 
> 
> 
> 
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
> 
> 
> 
> 
> 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 the Yahoo! Terms of Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/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/