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

Re: [amibroker] How Do I --- Implement Limit Orders



PureBytes Links

Trading Reference Links




This might give you a start.
 
If your setup occurs today, then check if 
Ref(LLV(L,3),3) <= L. This tells you if there is any price in the next 3 days 
that match or better your limit.
 
If so, then set a variable TargetEntryPrice to stay 
ALERTed for 3 days and if the low of any day when the alert is set is 
<= TargetEntryPrice when the signal occurred, then your BuyPrice is the 
MIN(O,TargetEntryPrice);
 
My apologies if the hints above are in Metastock 
speak. I'm quickly dashing off a response without looking at my AMI 
doco.
 
Peter K
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=howardbandy@xxxxxxxxx 
  href="">howardbandy 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, August 02, 2003 8:40 
  AM
  Subject: [amibroker] How Do I --- 
  Implement Limit Orders
  How Do I --- Implement Limit OrdersI have a trading 
  system based on pattern recognition.  I am using end of day data and 
  will be processing after the close, then placing my order before the open 
  of the next day.  When a pattern occurs, I want to place a limit 
  order.  After some number of days, if the limit order is not filled, 
  I want to withdraw it.  How do I code this into AmiBroker so that 
  A.  the BackTester properly accounts for the trades that would have 
  actually taken place; and also  B.  Explorer indicates that 
  I should place a limit order for the next day, and at what 
  price?The code should work correctly without regard to the Backtester 
  Settings of when to trade and how much delay. Specific (but very 
  artificial) example :Trade Entry1.  Whenever today's high is 
  greater than yesterday's high AND today's low is lower than yesterday's 
  low AND today's 5 day moving average of close is higher than yesterday's 5 
  day moving average of close, then my pattern is true and a buy signal is 
  generated and I want to place a limit order for tomorrow.2.  I 
  want to buy at a limit of 0.99 times the low price on the day the buy 
  signal was generated.3.  I want to place that order for up to three 
  consecutive days.  A.  If it is filled on any of the days, I 
  want to know exactly what my fill price was.  (It could be my limit 
  price, or the open if that is lower).B.  If it is not filled in 
  three days, I want to cancel the order.  That is, drop the buy 
  signal.4.  If the pattern occurs a second time before the limit order 
  is filled, I want to renew the buy signal, calculate a new limit price, 
  and restart the three day clock.Trade Exit1.  Once in a 
  trade, exit at the next open when today's close crosses down through the 5 
  day moving average of close.Thanks in 
  advance,HowardSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.