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

[amibroker] Re: I need some loop-programming help



PureBytes Links

Trading Reference Links




a problem I had: I entered a long position 
at the open. The next day the profitStop is hit. However also this same day a 
new position is entered at the open price. This was not 
posible. You need to sell first before you reenter.
 
if this is what you mean then you need to set the 
Reentrydelay to a value greater than 0.
 
ApplyStop( Type, Mode, Amount, ExitAtStop = 1, Volatile = False, 
ReentryDelay = 1 )
 
rgds, Ed
 
 

<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Paul Binnell 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, March 09, 2004 7:19 
  PM
  Subject: [amibroker] Applystop 
  problem
  
  
      I 
  have an issue with the applystop function.  I have searched the archives 
  but do not seem to be able to find a solution and I'm sure I have seen mention 
  of this before.  This piece of test code when run shows trades that are 
  entered before the last one is exited.  This occurs when the stop is hit 
  intra day.  I have set my trade time to open.  
  I followed the 
  setting mentioned in the help for applystop which follows
  ActivateStopsImmediately turned 
  ONExitAtStop = 1Trade delays set to oneTrade price set to 
  open
  But I still get this 
  problem.  Does anyone know a solution?
  <SPAN 
  class=584415320-08032004> 
  <SPAN 
  class=584415320-08032004>Thanx
  <SPAN 
  class=584415320-08032004>Paul
  <FONT face=Arial 
  size=2>//------------------------------------------------------------------------------------------------------------------- 
  rScore = close / ref(close,-1);   //Set Trade Delays 
  and Initial Equity SetOption("InitialEquity", 1000000); 
  SetTradeDelays(1,1,1,1); SetOption("MinShares",100); MaxPos = 
  1;SetOption("MaxOpenPositions",MaxPos); PositionSize = -100/MaxPos; 
  RoundLotSize = 100;  //Scoring Routine Begins 
  PositionScore  = rScore; Buy = Close > ref(close,-1); Sell 
  = Close < 
  ref(close,-1);   ApplyStop(stopTypeProfit,stopModePercent,10,1,False,1); 
  //------------------------------------------------------------------------------------------------------------------- 
  Send 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 
  


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








Yahoo! Groups Sponsor


ADVERTISEMENT




Click Here















Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.