Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

TSP Strategy for Amibroker (AFL)

Rating:
2 / 5 (Votes 4)
Tags:
trading system, amibroker

My attempt at connors TSP strategy

Similar Indicators / Formulas

weighted moving average scan
Submitted by naninn over 8 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 5 years ago
Kase CD V2batu
Submitted by batu1453 over 5 years ago
Ichimoku
Submitted by prashantrdx over 5 years ago
EMA System Ribbon
Submitted by yo123 over 8 years ago
Three-Bar Inside Bar Pattern
Submitted by EliStern over 8 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();



SetTradeDelays(0, 0, 0, 0); 
BuyPrice = Close; 
SellPrice = Close; 

previousClose = Ref(Close, -1); 
rsi2 = RSI(2); 

Sell = Cross(rsi2, 70); 

bull100 = Close > EMA(Close, 200) AND Sum(rsi2 < 25, 2) == 2; 
inFirstPos = Flip(bull100, Sell); 

bull200 = Close < previousClose AND inFirstPos AND Ref(inFirstPos, -1); 
inSecondPos = Flip(bull200, Sell); 

bull300 = Close < previousClose AND inSecondPos AND Ref(inSecondPos, -1); 
inThirdPos = Flip(bull300, Sell); 

bull400 = Close < previousClose AND inThirdPos AND Ref(inThirdPos, -1); 
inFourthPos = Flip(bull400, Sell); 

firstTrigger = ExRem(inFirstPos, Sell); 
secondTrigger = ExRem(inSecondPos, Sell); 
thirdTrigger = ExRem(inThirdPos, Sell); 
fourthTrigger = ExRem(inFourthPos, Sell); 

Buy = firstTrigger + (secondTrigger * sigScaleIn) + (thirdTrigger * sigScaleIn) + (fourthTrigger * sigScaleIn); 
SetPositionSize(IIf(firstTrigger, 100, IIf(secondTrigger, 200, IIf(thirdTrigger, 300, 400))), spsShares); 


Buy= ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); 
//Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short);

priceColors = IIf(Close > previousClose, colorDarkGreen, IIf(Close < previousClose, colorDarkRed, colorDarkGrey)); 
buyColors = IIf(firstTrigger, colorGreen, IIf(secondTrigger, colorLime, IIf(thirdTrigger, colorYellow, colorOrange))); 

Plot(Close, "Price", priceColors, styleBar); 
PlotShapes((Buy > 0) * shapeUpArrow, buyColors, 0, L, -10); 

0 comments

Leave Comment

Please login here to leave a comment.

Back