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

[amibroker] Re: charting delayed intraday data



PureBytes Links

Trading Reference Links

HI there !

Here is the formula:

//start
TickSize=0.01;
TradeLong = H > TimeFrameGetPrice( "H", inDaily, -1 )AND Hour() < 17;
TradeShort = L < TimeFrameGetPrice( "L", inDaily, -1 )AND Hour() < 17;

BuyPrice= TimeFrameGetPrice( "H", inDaily, -1);
ShortPrice = TimeFrameGetPrice( "L", inDaily, -1 );
NumContracts = 1;
PositionSize = NumContracts * MarginDeposit;
PointValue =100;
DayEnd = TimeNum()==170000; 
Buy = tradelong;
ApplyStop( stopTypeProfit, stopModePoint, 0.2, 1,False,28 );
Sell=Dayend;
Short = tradeshort;
Cover=Dayend;
//end

A previouse member also mentioned that he did not know how to only 
allow trades at or during spesific time, the solution to that is also 
in the above formula...

In the solution above, I used the TimeNum()  function to close all 
trades if any are open at 17H00. 

I also do not wnat to place new orders after this untel 0H00 hours 
hence the  Hour() < 17  method.

There are probably many other and eaven better ways to do this, but 
this is what I could get from my resources.

Kind regards 

Louw







 
ApplyStop( stopTypeLoss, stopModePoint, 0.30, True,False,28 );

--- In amibroker@xxxxxxxxxxxxxxx, "Collectable Images" 
<telecard@xxxx> wrote:
> So what was the answer??
> 
> Reading these replies is a good source of info. If the answers are 
given :-)
> 
> -----Original Message-----
> From: louwcoetzer [mailto:lcoetzer@x...]
> Sent: Saturday, 3 July 2004 9:20 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Help with Breakout Backtest
> 
> 
> Hi there again !
> 
> Nevermind, I befriended the F1 button and got everything sorted out
> ( just a pitty there are not clear esamples with lots of the AFL
> functions...)
> 
> Regards,
> 
> Louw
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Louw-Roux Coetzer"
> <lcoetzer@xxxx> wrote:
> > Hallo all :-)
> >
> > I am trying to back test the concept of buying the High/Low break-
> out of the
> > previous day's price on a 15min chart such as the one below.  I
> have
> > constructed the following formula, but something is clearly wrong
> with the
> > results.
> >
> > Sometimes it does buy at the break-out, but also just a bit
> before, see the
> > graph for an example.  It is as if  the day end and beginning of
> the 15min
> > chart does not coincide with the daily High/Low, I think !
> >
> > The entry of the first green arrow is clearly wrong, although the
> second one
> > is 100% correct.
> >
> > If there is any one out there that has tried this before or can
> show me my
> > error I would greatly appreciate it !!!
> >
> > Kind regards,
> >
> > Louw
> >
> > The formula I am using:
> >
> > TickSize=0.0001;
> > TradeLong = H > TimeFrameGetPrice( "H", inDaily, -1 );
> > TradeShort = L < TimeFrameGetPrice( "L", inDaily, -1 );
> > BuyPrice= TimeFrameGetPrice( "H", inDaily, -1);
> > ShortPrice = TimeFrameGetPrice( "L", inDaily, -1 );
> > NumContracts = 1;
> > PositionSize = NumContracts * MarginDeposit;
> > PointValue =1;
> > Buy = tradelong;
> > Sell=0;
> > Short = tradeshort;
> > Cover=0;
> > //ApplyStop( type, mode, amount, exitatstop, volatile = False,
> ReEntryDelay
> > = 0 )
> > ApplyStop( stopTypeProfit, stopModePoint, 0.0030, 1,False,20 );
> > ApplyStop( stopTypeLoss, stopModePoint, 0.0027, True );
> 
> 
> 
> 
> 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



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/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/