Amibroker with IB

looser89

Active Member
#2
is paper trading account in ib opened before real account. I want to test my afl real time. what is. brokerage in paper trading
 

manojborle

Well-Known Member
#3
Hi Bait.
How's Interactive Brokers ?
Are you using charts from IB or feeding data to amibroker ?
Is it expensive ?
I would like to know more about it.
 
#5
to looser89

is paper trading account in ib opened before real account. I want to test my afl real time. what is. brokerage in paper trading
paper trading account is opened after the real account is opened. the paper trading account is free when you open the real trading account but there is a fee of 5 usd if dont do any trading.

if you want to do real time testing show me the afl : email me or post it over here - just make sure that it is working properly -- i cant fix errors in it and we will test your afl in real time.

manojborle
Hi Bait.
How's Interactive Brokers ?
Are you using charts from IB or feeding data to amibroker ?
Is it expensive ?
I would like to know more about it.
IB is excellent.
i am using charts from both IB and feeding data to amibroker ( there is an interface available that allows you to send automated orders from amibroker to IB
no the brokerage is very reasonable and competitive you can find it on their website.
to open an account you will need US$ 2000 equivalent in indian currency and to know anything more call their customer service.


tradersumo
Hi Bait

I am also interested .
thanks for your interest, do send me the afl that you think shows good signals and we can test it out.
 

manojborle

Well-Known Member
#6
StopMode = ParamList("Stop Mode", "Fixed|Chandelier|Modified ATR" );

StopLevel = Param("Fixed perc %", 1, 0.1, 5, 0.1)/100;

StopATRFactor = Param("ATR multiple", 4, 0.5, 10, 0.1 );
StopATRPeriod = Param("ATR period", 14, 3, 50,1 );

// calculate support and resistance levels
if( StopMode == "Fixed" ) // fixed percent trailing stop
{
sup = C * ( 1 - stoplevel );
res = C * ( 1 + stoplevel );
}
else // Chandelier ATR-based stop
if( StopMode == "Chandelier" )
{
sup = C - StopATRFactor * ATR( StopATRPeriod );
res = C + StopATRFactor * ATR( StopATRPeriod );
}
else
{
HL = H - L;
MAHL = 1.5 * MA( HL, StopATRPeriod );
HiLo = IIf( HL < MAHL, HL, MAHL );
H1 = Ref( H, -1 );
L1 = Ref( L, -1 );
C1 = Ref( C, -1 );
Href = IIf( L <= H1, H - C1, ( H - C1 ) - ( L - H1 ) / 2 );
Lref = IIf( H >= L1, C1 - L, ( C1 - L ) - ( L1 - H ) / 2 );

diff1 = Max( HiLo, HRef );
diff2 = Max( diff1, LRef );

ATRmod = Wilders( diff2, StopATRPeriod );

sup = C - StopATRFactor * ATRmod ;
res = C + StopATRFactor * ATRmod ;
}

// calculate trailing stop line
trailARRAY = Null;
trailstop = 0;
for( i = 1; i < BarCount; i++ )
{
//if( Started[ i ] == 0 ) continue;

if( C[ i ] > trailstop AND C[ i - 1 ] > trailstop )
trailstop = Max( trailstop, sup[ i ] );
else
if( C[ i ] < trailstop AND C[ i - 1 ] < trailstop )
trailstop = Min( trailstop, res[ i ] );
else
trailstop = IIf( C[ i ] > trailstop, sup[ i ], res[ i ] );

trailARRAY[ i ] = trailstop;
}

// generate buy/sell signals based on crossover with trail stop line
Buy = Cross( C, trailArray );
Sell = Cross( trailArray, C );

PlotShapes(Buy*shapeUpArrow,colorGreen,0,trailarray);
PlotShapes(Sell*shapeDownArrow,colorRed,0,trailarray);

Plot( Close,"Price",colorBlack,styleBar);
//SetBarFillColor( colorYellow );
TRAILCOLOR =IIf(C>trailARRAY,colorBlue,colorRed);
Plot( trailARRAY,"trailing stop level", TRAILCOLOR, styleLine );

In this afl use these settings and post the results here.
then You can try with different settings and find which is more suitable.


image hosting free
 

pareshR

Well-Known Member
#7
StopMode = ParamList("Stop Mode", "Fixed|Chandelier|Modified ATR" );

StopLevel = Param("Fixed perc %", 1, 0.1, 5, 0.1)/100;

StopATRFactor = Param("ATR multiple", 4, 0.5, 10, 0.1 );
StopATRPeriod = Param("ATR period", 14, 3, 50,1 );

// calculate support and resistance levels
if( StopMode == "Fixed" ) // fixed percent trailing stop
{
sup = C * ( 1 - stoplevel );
res = C * ( 1 + stoplevel );
}
else // Chandelier ATR-based stop
if( StopMode == "Chandelier" )
{
sup = C - StopATRFactor * ATR( StopATRPeriod );
res = C + StopATRFactor * ATR( StopATRPeriod );
}
else
{
HL = H - L;
MAHL = 1.5 * MA( HL, StopATRPeriod );
HiLo = IIf( HL < MAHL, HL, MAHL );
H1 = Ref( H, -1 );
L1 = Ref( L, -1 );
C1 = Ref( C, -1 );
Href = IIf( L <= H1, H - C1, ( H - C1 ) - ( L - H1 ) / 2 );
Lref = IIf( H >= L1, C1 - L, ( C1 - L ) - ( L1 - H ) / 2 );

diff1 = Max( HiLo, HRef );
diff2 = Max( diff1, LRef );

ATRmod = Wilders( diff2, StopATRPeriod );

sup = C - StopATRFactor * ATRmod ;
res = C + StopATRFactor * ATRmod ;
}

// calculate trailing stop line
trailARRAY = Null;
trailstop = 0;
for( i = 1; i < BarCount; i++ )
{
//if( Started[ i ] == 0 ) continue;

if( C[ i ] > trailstop AND C[ i - 1 ] > trailstop )
trailstop = Max( trailstop, sup[ i ] );
else
if( C[ i ] < trailstop AND C[ i - 1 ] < trailstop )
trailstop = Min( trailstop, res[ i ] );
else
trailstop = IIf( C[ i ] > trailstop, sup[ i ], res[ i ] );

trailARRAY[ i ] = trailstop;
}

// generate buy/sell signals based on crossover with trail stop line
Buy = Cross( C, trailArray );
Sell = Cross( trailArray, C );

PlotShapes(Buy*shapeUpArrow,colorGreen,0,trailarray);
PlotShapes(Sell*shapeDownArrow,colorRed,0,trailarray);

Plot( Close,"Price",colorBlack,styleBar);
//SetBarFillColor( colorYellow );
TRAILCOLOR =IIf(C>trailARRAY,colorBlue,colorRed);
Plot( trailARRAY,"trailing stop level", TRAILCOLOR, styleLine );

In this afl use these settings and post the results here.
then You can try with different settings and find which is more suitable.


image hosting free

Hello

afl looks good..


can you give more idea on parameters ( ATR multiples and ATR period settings)

thx
paresh
 

Similar threads