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

[amibroker] Intrabar entries



PureBytes Links

Trading Reference Links

Hi,

I currently have my system set up as below.
The way its set up is as an EOD system.

Now I want to modify it to have intraday entries.
So as soon as todays bar meets the system entry criteria (in terms of price% change, volume, and liquidity) then enter immediately (ie. don't wait for the close).

How would i do that?

Thanks.

Nizar.

settradedelays( 1, 1, 1, 1 );

LBP = Param("ATR Look Back", 10, 5, 50, 1);;
Multi = Param("ATR Multiple", 2, 1, 5, 0.1);;
Pr = Close;
AT = ATR(LBP);

Entry1 = Indicator1;
Entry2 = Indicator2;
Entry3 = Indicator3;
Entry4 = Indicator4;
Entry5 = Indicator5;

Buy = Entry1 && Entry2 && Entry3 && Entry4 && Entry5;
BuyPrice = Open;
trailARRAY = Null;
trailstop = 0;
Longtriggerbar = 0;

for( i = 1; i < BarCount; i++ )
{

if( trailstop == 0 AND Buy[ i ] ) 
{ 
trailstop = Pr[ i ] - Multi * AT[i];
Longtriggerbar = i;
}
else Buy[ i ] = 0; // remove excess buy signals

if( trailstop > 0 AND Low[ i ] < trailstop  and i != Longtriggerbar)
{
Sell[ i ] = 1;
SellPrice[ i ] = trailstop;
trailstop = 0;
}

if( trailstop > 0 )
{ 
trailstop = Max( Pr[ i ] - Multi * AT [i], trailstop );
trailARRAY[ i ] = trailstop;
}

}


Plot( Close,"Price",colorBlack,styleBar);
Plot( trailARRAY,"trailing stop level", colorRed );

// Rank trades according to ATR if insufficient capital

PositionScore = 100-ATR(10);

// Divide capital into 4 positions
// Plot equity chart

NumPos = 4;
SetOption("MaxOpenPositions",NumPos);
PositionSize = -100/NumPos;

Plot(C,"C",colorBlack,styleCandle);
e = Equity();
Plot(e,"Equity",colorGreen,styleLine | styleOwnScale);




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

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