CanOz
Home runs feel good, but base hits pay bills!
- Joined
- 11 July 2006
- Posts
- 11,543
- Reactions
- 519
Nasdaq Stock. I seem to be getting better results with the Russell 3000 but still nowhere near as with my usual 10c to $2 range on the ASX. I guess I need to understand the pricing of stocks over there as I may be picking up some 'wrong uns' if selecting an unfavorable Amibroker index watchlist.
Have any of you guys encountered any such issues? And do you test your strategies across different markets to test the robustness of the system?
Perhaps it may have something to do with volatility. I know with the Flipper i always got better results on the small caps because they had farther to run...but honestly i can't fathom off the top of my head why the NQ would be much different....
Let us know when you figure it out, curious as to why it could be...
By adding some filters, either volume of volatility you may be able to narrow it down.
Good luck...
Nasdaq Stock. I seem to be getting better results with the Russell 3000 but still nowhere near as with my usual 10c to $2 range on the ASX. I guess I need to understand the pricing of stocks over there as I may be picking up some 'wrong uns' if selecting an unfavorable Amibroker index watchlist.
Have any of you guys encountered any such issues? And do you test your strategies across different markets to test the robustness of the system?
Many thanks for your thoughts Howardbandy (and RNR).
I just stepped up the index to the Russell 2000 and low and behold - the returns improved. I wasn't aware that corporate behaviour was so questionable at the low end - but shouldn't really be surprised. I will now spend my time reading through this thread for more tips and ideas.
Not sure what you mean Tech/a. This is what I selected.
View attachment 56566
I'd love to be able to combine indices in a scan. It appears as though you can only select one a a time.
So my question here is what is the purpose of the 'filter' code' in Amibroker? Can't conditions just be included in the buy argument without the use of a filter? Should I be using a filter here?
2. When I run my exploration, I want to see only stocks which opened on that day higher that the previous day's high. ie only execute those trades and include them in the report? (so not filter on the scan itself, but the following day) So how do I achieve this? How do I filter tomorrows entries by ones which opened higher, as I'd only execute these trades.
PriceFilter = C >=0.10 AND C<=2.00;
IndexFilter = your code for this condition;
VolumeFilter = LLV(V,10) >= 250000;
PriceAtEntry = O > Ref(C,-1);
EntryTest = PriceFilter*IndexFilter*VolumeFilter*PriceAtEntry;
Buy = Ref(EntryTest,-1);
Hi. I have a couple of basic questions relating to filters which I can't get my head around. As always, any input is appreciated.
1. All of my criteria to generate a buy signal are written like as in the following example:
Opclos= O > ref(c, -1);
Buy = Opclos
So my question here is what is the purpose of the 'filter' code' in Amibroker? Can't conditions just be included in the buy argument without the use of a filter? Should I be using a filter here?
2. When I run my exploration, I want to see only stocks which opened on that day higher that the previous day's high. ie only execute those trades and include them in the report? (so not filter on the scan itself, but the following day) So how do I achieve this? How do I filter tomorrows entries by ones which opened higher, as I'd only execute these trades.
Do I use ref +1 and include it in the filter?
Hope this makes sense. Thanks
SetOption("maxopenpositions", 5);
SetPositionSize(20, spsPercentOfEquity);
//MonteCarlo
PS=Optimize("Postion Score",1,1,100,1);
PositionScore = Random()*PS;
//Consecutive winners/losers
SetCustomBacktestProc( "" );
function updateStats( winnersOrLosers, profit, longOrShortOrBoth, seriesLength )
{
signum = 1;
if ( winnersOrLosers == "Losers" )
signum = -1;
if ( signum * profit > 0 )
seriesLength++;
else
{
VarSet( longOrShortOrBoth + seriesLength, VarGet( longOrShortOrBoth + seriesLength ) + 1 );
seriesLength = 0;
}
return seriesLength;
}
procedure calcStats( bo, type )
{
metricName = type + "MaxConsecutive";
// Retrive the max number of consecutive winning trades
stat = bo.GetPerformanceStats( 0 ); // Get Stats object for all trades
maxConsecutive = stat.GetValue( metricName );
stat = bo.GetPerformanceStats( 1 ); // Get Stats object for long trades
maxConsecutive = Max( maxConsecutive , stat.GetValue( metricName ) );
stat = bo.GetPerformanceStats( 2 ); // Get Stats object for short trades
maxConsecutive = Max( maxConsecutive , stat.GetValue( metricName ) );
for ( i = 1; i <= maxConsecutive ; i++ ) // Remember that "Dynamic variables are always global"
{
VarSet( "consecutive" + i, 0 );
VarSet( "consecutiveLong" + i, 0 );
VarSet( "consecutiveShort" + i, 0 );
}
consecutiveCounter = consecutiveLongCounter = consecutiveShortCounter = 0;
for ( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() )// Loop through all closed trades
{
consecutiveCounter = updateStats( type, trade.getProfit(), "consecutive", consecutiveCounter );
if ( trade.isLong )
consecutiveLongCounter = updateStats( type, trade.getProfit(), "consecutiveLong", consecutiveLongCounter );
else
consecutiveShortCounter = updateStats( type, trade.getProfit(), "consecutiveShort", consecutiveShortCounter );
}
for ( i = 1; i <= maxConsecutive; i++ )
bo.AddCustomMetric( "Consecutive " + type + " #" + i, VarGet( "consecutive" + i ), VarGet( "consecutiveLong" + i ), VarGet( "consecutiveShort" + i ), 0 ); // Add to results display
}
if ( Status( "action" ) == actionPortfolio )
{
bo = GetBacktesterObject(); // Get backtester object
bo.Backtest(); // Run backtests
calcStats( bo, "Winners" );
calcStats( bo, "Losers" );
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?