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

Re: [amibroker] logic to determine position



PureBytes Links

Trading Reference Links




Sidney,
 
Could you use something like the 
following:
 
InLong = Flip( Buy, Sell OR Short );InShort = Flip( Short, Buy OR Cover 
);State = IIF( InLong, 1, IIF( InShort, -1, 0 ) );
 
Anthony
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Sidney 
  Kaiser 
  To: <A title=AmiBroker@xxxxxxxxxxxxxxx 
  href="">AmiBroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, July 06, 2003 1:49 PM
  Subject: [amibroker] logic to determine 
  position
  As a Tradestation guy I really miss having the "position" 
  function when trying to code up something in AB.Here is where I 
  need some help.  I need a way to determine whether I currently have a 
  long / short / out position in a stock.The only thing I can figure is 
  to use "barssince" buy condition or sell condition and test the value of 
  barssince.  Does anyone know what  value  barssince takes 
  if the array  is false.  ie: barssince(buy) where buy is 
  false.  Is it zero, NAN, or some large negative number?That is my 
  poor attempt at the logic...what are you guys using to determine what the 
  current position is when working in the middle of a script.My context 
  would be: If I am long I want to impose a filter that would NOT be used if 
  I am out or short.  Eg: exit long if price crosses under an MA, but 
  do not use an MA test to determine entries.TIASidSend 
  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. 

  
  

  
  ---Outgoing mail is certified Virus Free.Checked by AVG 
  anti-virus system (http://www.grisoft.com).Version: 6.0.493 / Virus 
  Database: 292 - Release Date: 6/25/2003
   
  ---Outgoing mail is certified Virus Free.Checked by AVG 
  anti-virus system (<A 
  href="">http://www.grisoft.com).Version: 6.0.497 
  / Virus Database: 296 - Release Date: 7/4/2003






Yahoo! Groups Sponsor












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.