Forum Replies Created
-
AuthorPosts
-
TrentRothallParticipant
Thanks Howard. I watched it over the weekend.
I recently finished the book, ‘Trades about to happen’ by David Weis so it was interesting to hear from him.
A lot of the Wyckoff principles align with my observations especially springs and retests, not that i have put these to great use yet. It is amazing how often a buy limit order for my MR system is sitting on or just above support after a breakout of a previous high.
How has your discretionary trading been going over the last few years?
I’m not sure if you use it but i coded up the Weis wave indicator on the weekend – the one that plots each waves volume on the chart. I thought that was interesting. I think its correct…
Code://=================================================================================
//Weis wave plot
// Plots the total value of the volume on each wave on a chart
// uses the zig indicator for wave identification
//=================================================================================//=================================================================================
//Zig indicator
_SECTION_BEGIN(“weis wave size “);
P = ParamField( “Price field” );
zchange = Param(“% change”,5,0.1,25,0.1);
Plot( Zig(P, zchange), _DEFAULT_NAME(), ParamColor( “Color”, colorCycle ), ParamStyle(“Style”) );
_SECTION_END();
//=================================================================================//my weis wave
Z = Zig(C, zchange);
Trough1 = Z < Ref(Z,1) AND Z < Ref(Z,-1); Peak1 = Z > Ref(Z,1) AND Z > Ref(Z,-1);“is a = “+WriteIf(Trough1,”TROUGH”, “No”);
“Is b = “+WriteIf(Peak1, “PEAK”, “no”);Change = IIf(Trough1 == 1 OR Peak1 == 1, 1, 0);
“No Change – True/False”+WriteIf(Change,” = True”, ” = False”);
Vol = Null;
WaveVol = 0;
bars = 0;
BIW = 0;for( i = 1; i < BarCount; i++ ) { if (Change[i-1]) // Trend change a bar ago { Vol[i] = Volume[i] + Volume[i-1]; Bars = 1; if(Change[i]) { WaveVol[i] = Vol[i]; } } else if (bars == 1) { if(change[i] == 0) { Vol[i] = Vol[i-1] + Volume[i]; } if(Change[i]) { WaveVol[i] = Vol[i-1] + Volume[i]; bars = 0; } } } // Interpretation window "Bar Vol = "+NumToStr(Vol); "Wave total volume = "+NumToStr(WaveVol); //--------------------------------------------------------------------------------- WaveVol = WaveVol/Param("Wave Volume dived by :", 10000,0,100000000,1); WaveVol = round(WaveVol); // Round wave volume to make easier to read //--------------------------------------------------------------------------------- // Plot Wave vol on chart //--------------------------------------------------------------------------------- FirstVisibleBar = Status("FirstVisibleBar"); LastVisibleBar = Status("LastVisibleBar"); for(b = FirstVisibleBar; b <= LastVisibleBar AND b < BarCount; b++) { if (Trough1[b]) PlotText(" "+NumToStr(WaveVol[b],1.0),b,Low[b]*0.98,colorBlack); else if (Peak1[b]) PlotText(" "+NumToStr(WaveVol[b],1.0),b,High[b]*1.001,colorBlack); } //--------------------------------------------------------------------------------- _SECTION_BEGIN("Price"); //price Plot( C, "Price", ParamColor( "Color", colorDefault ), ParamStyle( "Style", styleCandle, maskPrice ) ); _SECTION_END();
TrentRothallParticipantWhy would you sink money into that? Bumpy ride
TrentRothallParticipantNice, that looks better.
I’ve been thinking it would be good to have a chart that plots cash vs positions, maybe as a histogram. A simple way to view exposure levels during the test period. Similar to how you can plot the equity in a chart pane. Will have to look into it more
TrentRothallParticipantThat is a great site by the looks Howard! Thanks for pointing it out. Do you have a part in running it? Are you trading long term discretionary positions or short term?
I have recently been brainstorming about using ‘hot sectors’ as a position score value to try and trade small cap ASX stocks. A momentum type model with short holding periods. So it’s timely that you have pointed it out.
TrentRothallParticipantI am currently trading my mean reversion system on the All Ordinaries. The returns are good but trade frequency is still pretty low. So created a watchlist of every ASX listed stock including delisted. There are a lot of tiny stocks in there with low liquidity but i figure my turnover/volume filters will keep me out of them.
This boosted returns a fair bit while not affecting the DD. The concerning this is though is the trade frequency only rose slightly, so i’m not sure if i’m testing right.
It seems most of the ‘extra’ gains were between 2005 – 2013.
A backtest ran on the All ords gives
CAR – 29.66%
MDD – 21.42%Compared to total ASX
CAR – 49.24%
MDD – -21.5%2013 – current (All Ords)
CAR – 23.38%
MDD – -15.60%2013 – current (Total ASX)
CAR – 26.93%
MDD – -13%More investigation needed though i think…
TrentRothallParticipantSadly my equity curve isn’t looking like that… That is my adjusted system that I am now trading. I only adjusted the exit when the index filter is down but it helps a lot with drawdowns and actually helped the overall return so that was a bonus…
TrentRothallParticipantCheers actually stumbled across this site earlier. Some good info
TrentRothallParticipantCheers Glen
TrentRothallParticipantHas anyone traded using or studied Wyckoff principles either discretionary or systematically? If so does anyone have any code?
Or VPA analysis?
TrentRothallParticipantYes i did notice that too Julian. I started playing around with that earlier. Will suit certain scenarios more than others i think.
I can’t take much credit Glen most of those are from the webinar or the net. I just adapted the DD graph from the original, i like that one though.
TrentRothallParticipantThis is a extension of the custom portfolio equity chart.
This code plots the underwater equity of the buy and hold ticker created in the CBT code.
The below code needs to be in your system code file
Code:// CBT EQUITY CHART
//=====================================================================
IndexTicker = “$XAOA.au”;
StaticVarSetText(“IndexTicker”, IndexTicker);SetOption(“UseCustomBacktestProc”, True);
SetCustomBacktestProc(“”);//====================================================================
if ( Status( “action” ) == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();IndexBuyHold = 0;
IndexBuyHold[0] = bo.InitialEquity;SetForeign(IndexTicker);
IndexDailyChange = C/Ref(C, -1);
RestorePriceArrays();for(i = 1; i < BarCount; i++) { IndexBuyHold[i] = IndexBuyHold[i-1] * IndexDailyChange[i]; } StaticVarSet("~HCBTIndexBuyandHold", IndexBuyHold); }
The below code is saved in the report charts folder
Code://=================================================================================
// Custom Underwater Equity chart
// Uses custom ticker created in cbt code
//=================================================================================EQ = C;
MaxEQ = Highest( EQ );
DD = 100 * ( Eq – MaxEQ ) / MaxEq;
MaxDD = Lowest( DD );IndexTicker = StaticVarGet(“~HCBTIndexBuyandHold”); //Call index ticker from cbt code in system
MaxBHEq = Highest(IndexTicker);
BHDD = 100*(IndexTicker – MaxBHEq)/MaxBHEq;
MaxBHdd = Lowest(BHdd);Title = StrFormat(“Buy and hold Drawdown = %.2g%%, Max. drawdown %.2g%%”, BHDD, LastValue( MaxBHDD ) );
SetGradientFill( GetChartBkColor(), colorBlue, 0 );
Plot( DD, “Drawdown “, colorBlue, styleGradient | styleLine );
Plot( MaxDD, “Max DD”, colorRed, styleNoLabel );
Plot( BHdd, “Index DrawDown”, colorBlack);
SetChartOptions( 2, 0, chartGridPercent );
if( Name() != “~~~EQUITY” AND Name() != “~~~OSEQUITY” ) Title = “Warning: wrong ticker! This chart should be used on ~~~EQUITY or ~~~OSEQUITY only”;
TrentRothallParticipantInteresting interview, wonder what the ramifications will be, if any?
TrentRothallParticipantCan you export a historical tradelist as a CSV fom IB?
I’ve seen this guy on twitter, seems the good day traders are doing well with this high vola. Gets the trigger finger itchy…
TrentRothallParticipantThis is another from the webinar.
It adds the trades per year to the backtest report down the bottom. I’ve added trades per day too.
Saves some excel work.
Code:SetOption(“UseCustomBacktestProc”, True);
SetCustomBacktestProc(“”);if( Status(“action”) == actionPortfolio)
{
bo = GetBacktesterObject();
bo.Backtest();st = bo.GetPerformanceStats(0);
dt = DateTime();TestStartDate = DateTimeConvert(2, Status(“rangefromdate”));
TestEndDate = LastValue(dt);
YearsInTest = DateTimeDiff(TestEndDate, TestStartDate)/31557600;NumTrades = st.getvalue(“AllQty”);
TradesPerYear = NumTrades/YearsInTest;
PerWeek = TradesPerYear/52;
PerDay = PerWeek/5;bo.AddCustomMetric(“Years in test”, YearsInTest, Null, Null, 1);
bo.AddCustomMetric(“Trades per Year”, TradesPerYear,Null, Null,0);
bo.AddCustomMetric(“Ave Trades Per Day”, PerDay, Null, Null, 2);}
TrentRothallParticipantThis code adds a indicator value to the backtest trade list. I’ve used it for checking trades and seeing what works and what doesn’t. Good for MR systems.
Code://=================================================================================
// CBT
//=================================================================================
//ASSIGNS THE VALUE OF ThE ATR ON THE setup bar IN THE TRADE LIST// assign indicator values to ticker-specific variables
StaticVarSet( Name() + “ATR”, Ref(ATR1, -1) );SetOption(“UseCustomBacktestProc”, True);
SetCustomBacktestProc(“”);if ( Status( “action” ) == actionPortfolio )
{
bo = GetBacktesterObject();
// run default backtest procedure without generating the trade list
bo.Backtest( True );// iterate through closed trades
for ( trade = bo.GetFirstTrade( ); trade; trade = bo.GetNextTrade( ) )
{
// read ATR values and display as custom metric
symbolATR = StaticVarGet( trade.Symbol + “ATR” );
trade.AddCustomMetric( “Entry ATR”, Lookup( symbolATR, trade.EntryDateTime ) );
}// iterate through open positions
for ( trade = bo.GetFirstOpenPos( ); trade; trade = bo.GetNextOpenPos( ) )
{
// read ATR values and display as custom metric
symboLATR = StaticVarGet( trade.Symbol + “ATR” );
trade.AddCustomMetric( “Entry ATR”, Lookup( symbolATR, trade.EntryDateTime ) );
}// generate trade list
bo.ListTrades( );
} -
AuthorPosts