Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Luxor for Amibroker (AFL)
The book “Trading System” talking about building a luxor system for currency trading.
http://www.amazon.com/Trading-Systems-Development-Portfolio-Optimisation/dp/1905641796
Trading Systems: A New Approach to System Development and Portfolio Optimisation
Page 44 has Luxor in TradeStation Easy Language.
I have converted it to AFL
Screenshots
Similar Indicators / Formulas
Indicator / Formula
SmaPeriodFast = 10; SmaPeriodSlow = 30; StartTime = 1 ; // 10000 * Hour + 100 * Minute + Second, so 12:37:15 becomes 123715 EndTime = 22; tn = TimeNum(); timeCheck = tn >=( StartTime * 10000) AND tn <= ( EndTime * 10000); FastMA = MA(Close, SmaPeriodFast ); SlowMA = MA(Close, SmaPeriodSlow ); IsLong = FastMA > SlowMA; IsShort = SlowMA > FastMA; LongSignal = Cross(FastMA, SlowMA); ShortSignal = Cross(SlowMA, FastMA); LongConfirmPrice = ValueWhen(LongSignal, H) + 0.001; ShortConfirmPrice = ValueWhen(ShortSignal, L) - 0.001; Buy = IsLong AND H > LongConfirmPrice AND timeCheck ; Sell = (IsShort AND L < ShortConfirmPrice) OR Cross( tn, EndTime); Short = (IsShort AND L < ShortConfirmPrice) AND timeCheck ; Cover = ( IsLong AND H > LongConfirmPrice) OR Cross( tn, EndTime); Buy =ExRem(Buy,Sell); Sell =ExRem(Sell,Buy); Short=ExRem(Short,Cover); Cover= ExRem(Cover,Short); Plot(C,"Close", colorBlack, styleCandle); Plot(FastMA,"Fast MA", colorRed, styleThick); Plot(SlowMA,"Slow MA", colorBlue, styleThick ); PlotShapes( IIf( LongSignal , shapeSmallCircle + shapePositionAbove, shapeNone ), colorGreen ); PlotShapes( IIf( ShortSignal , shapeSmallCircle , shapeNone ), colorRed ); PlotShapes( IIf( Buy , shapeUpArrow, shapeNone ), colorGreen ); PlotShapes( IIf( Sell , shapeDownArrow, shapeNone ), colorRed );
7 comments
Leave Comment
Please login here to leave a comment.
Back
thx
The end of day close code is incorrect.
How do I update the submitted code?
It should be
Updated it for you.
Hi,
The time part is out of my mind. can ne one make for 9.15 to 03.30 pm ????
It is used to trade EUR currency.
great trading system for amibroker, thank bro !
Thank you for sharing this really nice system and the code! I already got the book also and learned a lot on trading systems already from it.
About the code- I applied it to some FOREX markets.
I think your above formula contains a mistake with the time filter. The system does not enter within the selected time window, but instead always at the beginning of the time window. Unfortunately my programming skills are too limited to correct this.
It should be programmed like this:
While the time filter condition is true: Check if the fast moving average crosses the slow one etc. Once the time filter condition is no longer true, no entries are possible. At the moment, the entry is always at the very first bar of the time window, e.g. every day at 9:35 (if the time window is 9:30 -12:00 and you work with 5 minute bars). Like this the time filter is useless.
And according to the book “Trading Systems” where the code is from, the time filter is the haert, the main point of the logic! This is a pity…
Maybe anyone can help?