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

[amibroker] Applystop turned on only after n days



PureBytes Links

Trading Reference Links

The Problem: Don't want my Applystop to be effective until in the 
trade for n days.  

Tried using the code below but I get an "Error 6" code.  Help tells me 
that I must act on Boolean expression (True or False) and not on 
arrays. I'm still having trouble understanding If,Else, For statements 
and how they are used in Amibroker.  It looks to me like I am working 
on a boolean statement.  

Any help here would be much appreciated.

Thanks
Mark

MY CODE:

Buy = Buy Rules;
Sell = Sell Rules;

for(i=0; i<BarCount; i++)
  {
    intrade = ExRem(Buy,Sell);
    DaysInTrade = BarsSince(Buy[i]>20)
    if(DaysInTrade)
      {
        ApplyStop(StopTypeTrailing, StopModePercent,15);
      }
  }





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hqi30rf/M=362131.6882500.7825259.1493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1124673910/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
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:
    http://docs.yahoo.com/info/terms/