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

[amibroker] Is it possible to run a scan with every tick change ?



PureBytes Links

Trading Reference Links

hi Chuck,

the problem here (in my opinion) is that you need to trace the entry price. From the entry you need to track the exitLevel. Challenge is to use arraybased function for this.

as you see this comes close:

; ----------------------------------
Buy = C < BBandBot(C, 10, 2);
BuyPrice = Open;

exitLevel = ValueWhen(Ref(Buy,-1) - Ref(Buy,-2) == 1, BuyPrice);
Sell = C > exitLevel;
SellPrice = Close;

Equity(1);

Plot(C,"C",1,64);
Plot(exitLevel,"",colorWhite,1);
Plot(BBandBot(C, 10, 2),"",colorLightBlue,1);
PlotShapes(IIf(Ref(Buy,-1),shapeUpArrow,0),colorWhite, layer = 0, yposition = BuyPrice, offset = 0 );
PlotShapes(IIF(Sell,shapeDownArrow,0),colorYellow, layer = 0, yposition = SellPrice, offset = 0 );
; ----------------------------------

but not quite because your exit level is determined before you do the Equity(1) or ExRem operation. So if the another Buy is encountered before there is an exit it will adjust the exitLevel before you actually did an exit. This is wrong.

So in my opinion you will have to write a little exit loop. In this loop you track both the exit point and the exitLevel. But I am very interested if somebody else could do this using array based operations only,

regards, Ed




  ----- Original Message ----- 
  From: Chuck Rademacher 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Friday, September 03, 2004 6:15 PM
  Subject: [amibroker] Help with entry price?


  It's been a while since I've posted anything on this site as other 
  activities have been taking 150% of my time.  Regards to all of my 
  old mates!!

  I'm trying to code a system in AFL that I have backtested manually 
  and it seems to work quite well on most futures.

  Basically, I want to buy the open tomorrow if the close today is 
  below the bottom bollinger band.  No problem so far.

  I want to exit the position whenever the close is above my entry 
  price, including the close on the day of entry.

  My problem is ascertaining the entry price of the buy.

  There isn't any more to the system and any assistance would be really 
  appreciated.  

  Chuck Rademacher
  (currently in Denver)



  Check AmiBroker web page at:
  http://www.amibroker.com/

  Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

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



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/