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

[amibroker] Re: Scale in on same bar



PureBytes Links

Trading Reference Links

If you want to do what you are proposing, you don't need CBT.

Whenever you recognize a "scalein" condition, just set the BuyPrice to the average of buyprice1 and buyprice2, and the position size to double the usual size. The backtester exits all positions (initial and scaled in) at a single Sell signal, so that is effectively what is happening anyway.

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "jmdeacon" <jmdeacon@xxx> wrote:
>
> What I want would not need intraday data.  The way I would want ti code with OHLC is something like this:
> 
> limitprice1 = (ref(c,-1)*0.99);
> limitprice2 = (ref(c,-1)*0.98);
> 
> buyprice1 = min(O,limitprice1);
> buyprice2 = min(O,limitprice2);
> 
> Buy would occur if L < limitprice1.
> Scalein would occur if L <limitprice2.
> 
> If the low is less than the limitprice1, I would enter the position.  If the low is less than the limitprice2, then I would scalein.  If the open is below both prices then I would enter a double position at the price of the open.
> 
> I already have this coded to work on seperate bars, but many times, the pullback occurs on the same bar and I would like to backtest that occuring on the day of the initial purchase.
> 
> So, the question is, is there some kind of CBT coding that would allow me to test what I want to test.
> 
> Thanks,
> 
> John
> --- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> >
> > Hi
> > 
> > You can't do that. All you know is open/high/low/close. You don't know what happened in between.
> > 
> > Consider these two scenarios:
> > 
> > Open, gentle steady decline in price down to -2%.
> > Open, next trade after the open is a 2% drop.
> > 
> > Now, would you still want both an initial buy and a scale in for both scenarios? How would you know if half the position was bought at -1% and the other half at -2% (first scenario) vs. all bought at -2% (second scenario).
> > 
> > If you want intraday trades, you need intraday data.
> > 
> > Mike
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "jmdeacon" <jmdeacon@> wrote:
> > >
> > > Is it possible to scale in on the same bar?  To make it clear, lets say I am using EOD data and I want enter a position as the price pulls back.  XYZ starts the day at $10 and I want to buy if it loses 1% and scalein to double to position if it loses another 1%.  Is there a way to code for that to occur on the same bar assuming XYZ traded below $9.80 on the bar in question?  I know how to do it with Scalein when it occurs on seperate bars?
> > > 
> > > Thanks,
> > > 
> > > John
> > >
> >
>




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

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

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

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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/