Need algo afl for this LPT strategy .,

yasu222

Active Member
#1
Just like LPT (Line Pair Trading) strategy.

Two parallel lines on Amibroker basic chart -

UPPER LINE - BUY ON CANDLE CLOSE / IMMEDIATE above UPPER LINE .

DOWN LINE - SELL ON CANDLE CLOSE / IMMEDIATE below DOWN LINE.

BUY/SELL TGT = BUY/SELL PRICE + (BUY/SELL PRICE* X%).

NEEDS THE ABOVE LPT STRATEGY TO BE AUTO MATED AND SEND THE ORDERS FROM AMIBROKER TO NEST TRADING PLATFORM.
 
Last edited:

yasu222

Active Member
#3
// SU and RE studies Last Value

// To display last value of SU and RE studies

// manually draw SU ray
// Select SU and edit property to insert SU into Study ID
// ditto RE Study
// To do once, dont kill your lines then adjust your lines
// reinsley


_SECTION_BEGIN( "Price1" );
SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} \nOp %g, \nHi
%g, \nLo %g, \nCl %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 ) ) ) );
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle |
ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN( "Price" );
bc = BarCount;
trendlineRE = Study( "RE", GetChartID() );
trendlineSU = Study( "SU", GetChartID() );
StartXre = LastValue( ValueWhen( ExRem( trendlineRE, 0 ), DateTime() ) );
EndYre = LastValue( ValueWhen( trendlineRE, trendlineRE ) );
StartXsu = LastValue( ValueWhen( ExRem( trendlineSU, 0 ), DateTime() ) );
EndYsu = LastValue( ValueWhen( trendlineSU, trendlineSU ) );
Title = Title + "\nRE = " + EndYre + "\nSU = " + EndYsu;
PlotText( "R = " + EndYre , bc + 2, EndYre , colorWhite, bkcolor =
colorRed );
PlotText( "S = " + EndYsu , bc + 2, EndYsu , colorWhite, bkcolor =
colorGreen );
_SECTION_END();
 

yasu222

Active Member
#5
// SU and RE studies Last Value

// To display last value of SU and RE studies

// manually draw SU ray
// Select SU and edit property to insert SU into Study ID
// ditto RE Study
// To do once, dont kill your lines then adjust your lines
// reinsley


_SECTION_BEGIN( "Price1" );
SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} \nOp %g, \nHi
%g, \nLo %g, \nCl %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 ) ) ) );
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle |
ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN( "Price" );
bc = BarCount;
trendlineRE = Study( "RE", GetChartID() );
trendlineSU = Study( "SU", GetChartID() );
StartXre = LastValue( ValueWhen( ExRem( trendlineRE, 0 ), DateTime() ) );
EndYre = LastValue( ValueWhen( trendlineRE, trendlineRE ) );
StartXsu = LastValue( ValueWhen( ExRem( trendlineSU, 0 ), DateTime() ) );
EndYsu = LastValue( ValueWhen( trendlineSU, trendlineSU ) );
Title = Title + "\nRE = " + EndYre + "\nSU = " + EndYsu;
PlotText( "R = " + EndYre , bc + 2, EndYre , colorWhite, bkcolor =
colorRed );
PlotText( "S = " + EndYsu , bc + 2, EndYsu , colorWhite, bkcolor =
colorGreen );
_SECTION_END();
How can automate the trades with NEST platform?
 

Similar threads