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

[amibroker] Re: Sell price question



PureBytes Links

Trading Reference Links

 This is a interesting situtation. What you want to do is trade
between the High and the Low of a bar. Since there is zero time
between the High and Low of a bar the values in between are 
meaningless. This holds for intraday values as well( 1min, 5min and 
etc). The current price is always set at the close, this is where 
the calculations are preformed. The program only knows that an event 
has happened and not when it happended(between the high and the 
low), because time is zero. 

 I do something like you want on a daily basis(but there is no
way of backtesing this for the above reason). I use EOD and
update it every 5 min. This gives calculations every 5 min on
the High and Low and will give the time(and value) of the event or
events. Thus, at the end of the day I know when these event(s) 
happended. Since the back test never has the values other than Close 
and Open(High and low) it has no way of knowing when an event 
happened, only that it did happen.

The same sort of thing occurs when you set stops with a brokerage,
a stop becomes a market sell(or buy), but there is no guarantee what
price you bought or sold. The same for a stop limit, if the price
does not hit both of the conditions the stop will not execute.

I hope this makes some sense.

                Cliff s



> Hi All.
> 
> Hoping for some help with controlling the price a stock is sold at 
in the
> back tester. I'm doing all my sell signals in javascript (due to 
some fairly
> complex stop rules), and also want to determine the sell price 
that appears
> in the backtest - typically the price at which it crosses a 
particular
> indicator. So what I'm doing is something like:
> 
> for(i=0; i<aClose.length; i++)
> {
>   aSellPrice[i] = ... // my sell price rules
> }
> AFL("sellprice") = aSellPrice;
> 
> 
> But what I see in the backtester as "exit price" seems to be 
whatever is in
> the automatic analysis settings (eg. open, close, whatever), not 
the price I
> have set in my javascript.
> 
> Can anyone help me here? Is what I want to do possible? Seems like 
it
> shouldn't be hard.
> 
> Cheers,
> 
> Mark


------------------------ Yahoo! Groups Sponsor ---------------------~-->
New Yahoo! Mail Plus. More flexibility. More control. More power.
Get POP access, more storage, more filters, and more.
http://us.click.yahoo.com/Hcb0iA/P.iFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/