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

[amibroker] Scaling into a position based on an indicator



PureBytes Links

Trading Reference Links

Let's say that I've got an indicator.  And I'm trying to scale into
positions as that indicator drops from 20 to 15 to 5.

I want to buy initially below 20, and then scale in again if the
indicator breaks 15, 10 and 5.  Here's the code I have so far:

Buy = IIf(BuySignal1 OR BuySignal2 OR BuySignal3,sigScaleIn,0);

>From this, I get the following:

Day 1 - the indicator is at 25.
Day 2 - the indicator is at 19.
Day 3 - Buy the open.  Indicator is at 17.
Day 4 - ScaleIn position.  Indicator is at 14.
Day 5 - ScaleIn position. Indicator is at 40.
Day 6 - Exit trade.

Now, what I wanted to do is a bit different.  I'll pick it up at Day 3
(this is my simulation of what I'm trying to do):

Day 3 - Buy the open.  Indicator is at 17.
Day 4 - No buy until it breaks the next level (15).  Indicator is at 14.
Day 5 - ScaleIn position.  Indicator is at 30.
Day 6 - Exit trade.

Can anyone explain how I would do this?  

Any help greatly appreciated.



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/