NexusFi: Find Your Edge


Home Menu

 





TS8 strategy; Ninja translators warmly invited.


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one cclsys with 7 posts (2 thanks)
    2. looks_two max-td with 2 posts (0 thanks)
    3. looks_3 bomberone1 with 1 posts (0 thanks)
    4. looks_4 bibulous with 1 posts (0 thanks)
    1. trending_up 5,855 views
    2. thumb_up 2 thanks given
    3. group 6 followers
    1. forum 11 posts
    2. attach_file 10 attachments




View Poll Results: What do you think of these strategies?
Excellent 0 0%
Excellent
0 0%
Average 0 0%
Average
0 0%
Unrealistically basic 1 50.00%
Unrealistically basic
1 50.00%
Total Waste of Time, way too complex or whatever 1 50.00%
Total Waste of Time, way too complex or whatever
1 50.00%
Multiple Choice Poll. Voters: 2. You may not vote on this poll

 
Search this Thread

TS8 strategy; Ninja translators warmly invited.

(login for full post details)
  #1 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

A year or so ago, when I was in the process of developing my first simple daytrading strategy - although not so simple in terms of features and options to test - Tradestation suddenly in the middle of the day and without warning or explanation (have yet to find out ) cancelled all accounts for Canadians in certain Provinces.

Then I moved to Ninja where for weeks I couldn't even figure out how to change plot colors, and still can't handle strategies. I think Ninja is better, Zenfire is much better, but I can't yet code in it and I am/was never a good programmer anyway.

But this strategy has many features that personally I would love to have as a template to test other ideas.

Multiple units (only 2); times of day to trade or not; daily profit target and max loss; recovery option: changing the profit targets and stop trails when down to get the losses back and, I think, knowing to the tick net of commissions how much is needed.

The stops and Pt's can be optimized in terms of both Risk-Reward ratio and as a function of ATR. It tested very well in Simulation over 6 months - which took hours and hours to do with tick data in TS, including a very slow summer and a very busy early fall last year with no noticeable difference. However the fills were probably overly generous.

The results are not so important (at least to me) however; rather if anyone feels inspired to translate this into Ninja then, selfishly speaking, I will have a strategy template with which to test other ideas and approaches.

And so will everyone else on Big Mike's forum.

(It is called Pic-Kelt because it is a pun on Picts and Celts, and uses Keltners/ATR, and also my systems tend to be named around something musical, my long-term one being called Vivaldi Seasonal Trends, so this being short-term I called it 'Picolo'.)

Attachments:

Code in Word Doc and zipped ELD file - I think they are the same but am not sure.
mht TS performance report. (Clearly the fills were overly generous but I did eyeball the charts and most of the time the price went through the targets, so it still should be pretty good - unless it was over-optimized which I tried to avoid doing, letting the ATR do all the work in adjusting stops and profit targets and never playing around with any other parameters like period lengths etc.

Strategy #2:

This is very simple: It is a sort of always-in-the-market counter-trend swing trader for daily, weekly or 60 min charts. Used to work quite well. Extremely simple. Sell when the market goes up, buy when it goes down. Good for hedging with options since purchase happens when market going against the hedge and prices often favorable.

Again, this is for anyone and everyone but if anyone would like to translate into Ninja, I for one would be grateful.

PS I found the report which was done on a 1 minute chart versus the preferred 150 tick chart which gave better results but which took too long to test on my equipment (with rural dialup data feed!).

Obviously it simply cannot be that good, but also it cannot be that bad to get such results, despite any shenanigans with overly generous fills etc. The profit factor of 1.18 is not all that great, but still.

Attached Thumbnails
Click image for larger version

Name:	BM-PicKeltGraph.png
Views:	267
Size:	94.9 KB
ID:	4281  
Attached Files
Register to download File Type: doc Strategy VWAP Envelope Signal.doc (21.0 KB, 110 views)
Register to download File Type: zip Pic Kelt 1 min selected report MM opt only.zip (157.1 KB, 88 views)
Register to download File Type: doc Strategy Pic-Kelt.doc (46.5 KB, 87 views)
Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following user says Thank You to cclsys for this post:

Can you help answer these questions
from other members on NexusFi?
IQFeed MBO data experience
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
ZigZag displaying ticks
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ISO Equity Curve Indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
GFIs1 1 DAX trade per day journal
28 thanks
Supertradersams Thread Journal on NQ/MNQ
28 thanks
Tao te Trade: way of the WLD
15 thanks
Diary of a simple price action trader
13 thanks
Deaddogs Stock Trading
11 thanks

(login for full post details)
  #2 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 926

hey cclsys,
i miss a button in your poll :

>> i dont believe in auto-strats + backtest of such things !

for me that whould be my poll-choise.


max-td
Reply With Quote
(login for full post details)
  #3 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


I have found

a) the position-sizing function I think Pic-Kelt references - and the bands strategy; perhaps slight changes in the code need to be made since these are TS2000 version which I can still open up.

b) A highly original strategy which I could not properly develop because of problems with data. It is based mainly on COT data and I made an indicator/oscillator from the COT. This required too much optimization but since the charts wouldn't update reliably I dropped it.

The idea behind the attempt was a good one: use non-correlated inputs, in my case shooting for
a) seasonals
b) COT
c) Volume
d) simple trendfollowing or fib retracements in trend.

This idea was not followed through on, but perhaps someone will find it sparks something for them.

Attachments:

the COT pack should have strategies, indicator and MM function.
the MM pack has a couple of MM functions some might find useful. Can choose between equity per contract, fixed nr. of contracts, ATR-based position-sizing. Work with long or short term systems. It also can compound based on gains in Net (closed) Equity and the included Equity Indicator can also include compounding in terms of adjusting percentage returns to reflect proper drawdown coloring. Simple, but helpful when testing system results.

Picture of Weekly DX chart trading one of the COT systems. They were developed in 2005 and never touched since then. I forgot to put in the Paintbar but it's easy to make. The paintbars reference the COT oscillator in the panel below. That is all they reference, but they do a pretty good job of calling the long term trend. Unfortunately they require too much optimization although I didn't touch them since 2005 so clearly they are not that bad.

The retracement trades are based on a Fib indicator I wrote which is not on the screen. It also shows long-term trend but works great short term as well. I can post some of those codes if anyone wants them, but I think just as good stuff is all over the place now - though I couldn't find any at the time.

Hope some people find this stuff of interest. If not, so be it!

Attached Thumbnails
Click image for larger version

Name:	BM-COT pic DX Weekly.png
Views:	310
Size:	56.5 KB
ID:	4285  
Attached Files
Register to download File Type: zip Big Mike COT&MM.zip (37.7 KB, 80 views)
Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following user says Thank You to cclsys for this post:
(login for full post details)
  #4 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


max-td View Post
hey cclsys,
i miss a button in your poll :

>> i dont believe in auto-strats + backtest of such things !

for me that whould be my poll-choise.


Fair enough! I think that is covered in Nr 4.

I also don't 'believe' in auto-strategies. However, the best way to test ideas, be they simple patterns or nested multiple conditions, is with strategies. They can output hard stats, win-loss ratios, you can quickly play with risk-reward variations and so forth. I think that is what they can be helpful for in short term trading.

Note also that the attached picture was put together fairly quickly in 2005, has not been touched, and this is the first time I have opened it up in a while and it is not so terrible for something that was just testing one element of what was going to be a more complex, interrelated system.

My Seasonal system (which I can't afford to trade unfortunately!) is up over 80% this year on weekly signals which is sort of typical. And that is post-development results which I have been tracking since 2007, albeit hypothetical. But I developed the system through testing various ideas via back-testing.

So I don't think back-testing is totally for the birds, even though you have to be careful how you do it. For example my model portfolio trades 27 instruments all with the same trend-following parameter based on a simple moving average and two lines of code. There are other things in there but very, very few in order to reduce the meaningless results you get from tweaking indicators. And that SMA is my only 'indicator-type' input in the system.

Note also that my proffered test results for Pic-Kelt were on 1-minute charts (not so smooth) and over a whole year. That's a long time for a ST system. It started to have a rough go of it at the end in Sep-October, but that was a pretty rough period I believe, and after an extremely narrow July and August, so two extremes there through which the system did quite alright for a mechanical approach.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #5 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 926

yeah - shure - its a helping tool for people who know what they do and who go on working with the results they get from backtests + such things.

i think the problem is that newbies + non-advanced folks run into a grazy loop while working with backtests, cause they cant convert the stuff they see after optimizing into real trading ( = money-making-stuff).

those big + nice equity-curves are more dangerous then helping for learners
- they are just helpful for the indicator + system-salesguys

BTW - i am the one who voted yet in the poll

max-td
Reply With Quote
(login for full post details)
  #6 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

Hey Max, ich habe fur drei jahren in Deutschland geleben aber leider kann ich nicht gut schreiben und nur ein bissien besser sprechen! In Saarland war ich, 90's.... Good people in the big D.

I'm gonna come back at you because I am winding down now from an all-nighter trying to get coding and indicator-review on the BM forum out of the way. Almost done and then back to simplicity. But had a rough period of late and am in review mode. Batting 65% plus but still losing, so time to rethink the approach. I figured I would just keep getting better and things would take care of themselves. Poor risk-reward planning.

Anyway: in terms of right versus wrong backtesting, the reason I became interested in seasonals for long-term testing is not because I believe in them particularly but because of their algorithmic 'rigidity'. When you test for long-term seasonals - at least when I do it - you see what happens if you buy on the 7th week and sell on the 10th, and so on and so on. This means that whatever date you buy on in Year 1 you buy in Year 2,3,4 and so forth. No other conditions. No indicators. No filters. None. Just pure results.

Yes, this is using the past, but if statistically there are certain periods that have the odds in their favor, what's wrong with finding out about them? More importantly, this is a very inflexible approach precisely because although you are curve-fitting to historical data, you are curve fitting in a very rigid way, so only if seasonal tendencies exist can favourable results be found with this type of backtesting. That's why I picked it.

If I could easily do the same thing with moon cycles or sunspot activity I would because it is uncorrelated with price.

So I attach a couple of pictures of my Weekly Soy Seasonal going back to the late 1970's. Only rules, buy and sell on same weeks every year. There is a 2% stop loss. There is no profit target. Obviously you could add filters, use judgment, have trailing stops, atr-derived profit targets, scale in and out and so forth. But this is just bare bones statistics displayed as a system on a chart.

The multi-colored plot underneath is based on the percentage move on average each week. That is then massaged with an RSI algorithm to create cyclic display. If there are regular seasonals, the cycles will repeat fairly regularly. If there are not, they won't, the RSI will flatline alot, wriggle around and so forth. It doesn't. This indicator is not used in the system although I have made it into one and it works over time with a trend filter across a basket of instruments.

In any case, I am just trying to make a case that if you backtest intelligently, you can get some good information. Maybe not an auto-system for daytrading but for example:

in certain markets times of day are clearly important. Or report times. Or certain weeks. These are time periods that are not in themselves correlated to price action in that such periods happen like clockwork whether or not the market is active or in the doldrums, we are at war or peace. So if clear tendencies emerge from such tests over sufficient time, they are of interest.

Similar with COT data which is not on the price charts.

Or smart Volume analysis which also is not on the price chart per se.

In any case, take a look at the Soy chart attached along with the performance print-out. This was modelled two years ago but with the seasonals I refresh them each January, which means they are re-optimized and thus not fashionable system-wise. However, it would be silly to trade seasonals without incorporating the latest data into them (as the indicator in the panel does automatically but my system cannot yet do). So the results from Jan this year are after the last refresh (and the results from the year before are almost the same as what actually happened from Jan 2008-Jan 2009 but that is not on this chart).

Don't think of it as an autotrade. Think of it as data mining. It is interesting data that system coding makes relatively easy to uncover. Same thing can be done with ST systems although I suspect it is much harder in many ways.

Oops! It's almost 1300 EST. Almost bound to be some good moves in the next 30 minutes in nearly all mkts. Not every day, but most days!

Attached Thumbnails
Click image for larger version

Name:	BM SoyEqCurve.png
Views:	203
Size:	20.5 KB
ID:	4294   Click image for larger version

Name:	BM SoyPerf.png
Views:	242
Size:	32.7 KB
ID:	4295   Click image for larger version

Name:	BM SoySeasonpic.png
Views:	254
Size:	82.6 KB
ID:	4296  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #7 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

Well, Ninja froze up when I went back in. Probably from downloading so many of those funny d9UK indies last night which look nice but which I won't use.

At 1.03 the Gold market went through a picture-perfect support level and moved down fast. Marked it with Red arrow on chart but I missed it having to close and reopen etc.

Since I am done for the day, I played with the Jstats and CumVols going for aggressive CT buys (in SIM which is pretty meaningless although fun of course unless you treat it with the respect it deserves which I didn't) and caught a nice move up with PT1 & 2 hit, but not 3.

Anyway, the point is: TOD often is an edge and is not directly correlated with price per se, i.e. the clock keeps ticking no matter what happens price-wise. This was a classic 1pm move.

Or to be precise: 1301 pm!

Attached Thumbnails
Click image for larger version

Name:	BM-1302-Gold.png
Views:	241
Size:	77.5 KB
ID:	4298  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #8 (permalink)
duhhhh
LA
 
Posts: 1 since Feb 2010
Thanks Given: 1
Thanks Received: 0

question about pic-kelt strategy
when I compile this code, I got error from here.
 
Code
PBUpperband = frac(upperband,-1,tickk); PBLowerband = frac(lowerband,1,tickk);
 
Code
Daystart = picperiod(1); LunchStart= picperiod(2); Lunchend = picperiod(3); DayEnd = picperiod(4);
I cant find frac & picperiod function anywhere. can you please paste these functions ?
thanks for your sharing strategy.

Reply With Quote
(login for full post details)
  #9 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

It might take a while to dig up. Please PM me with yr email and I'll send ASAP.

Of old the skilled first made themselves invincible to await the enemy's vincibility.
Invincibility lies in oneself. Vincibility lies in the enemy.
Thus the skilled can make themselves invincible.
They cannot cause the enemy's vincibility.
Thus it is said: 'Victory can be known; it cannot be made.'
Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #10 (permalink)
 bibulous 
Germany
 
Experience: Beginner
Platform: MultiCharts, NinjaTrader
Broker: IB/IQFeed
Trading: NQ, YM
Posts: 81 since Jun 2009
Thanks Given: 114
Thanks Received: 63



duhhhh View Post
question about pic-kelt strategy
I cant find frac & picperiod function anywhere. can you please paste these functions ?

same here

thanks for your sharing strategy.

Thanks indeed!

Reply With Quote





Last Updated on August 13, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts