Trade ZenFire From Your iPhone

Posted by TraderWerks | Indicators | Tuesday 9 February 2010 2:29 am

beat-zenfire

MOBILE IS EVERYWHERE

Now, I don’t Trade on the iPhone. I think the term ‘fat finger error’ would take on a whole new meaning if I traded from an iPhone.

There a few programs for trading on the iPhone. iSwim from thinkOrSwim, E*Trade Mobile Pro and of course the Interactive Brokers app.

Having access to my trading platform on something I can carry with me is great. For me, there is some comfort in being able to check my position when I am done trading for the to make sure I am flat. Or if there is a problem with my internet connection, I can still flatten all my positions.

ZENFIRE ON THE IPHONE

ZenFire has a Webtrader in beta, which is expected RSN ( Real Soon Now ). I have no idea when, so don’t quote me on it.

You can try it at beta.zen-fire.com You can select an iPhone interface or the iPhone interface upon login.

They changed to a new darker look, which I do not care for that mch. I much prefer the old color scheme shown here.

TRADERWERKS ON THE IPHONE
This site runs on both the iPhone/iPod Touch and Google’s Android. Just point your browser to http://blog.traderwerks.com just like your normal web browser would and the magic happens auto-magically.

Taking The Ninja Trader 7 Beta Out For A Spin

Posted by TraderWerks | Indicators | Tuesday 24 November 2009 11:34 pm

7up

If you haven’t noticed, NinjaTrader has a new version coming out in NinjaTrader 7 ( NT7). It has a lot of improvements over NinjaTrader 6.5 (NT6.5) as well as some changes that you need to make in your code.

FIRST IMPRESSION
My first impression was “Hey, this looks just like NinjaTrader 6.5″. It is true, it does. Not like switching from Windows XP to Vista. ( Although I am not sure, I still use XP, but I heard they look different )

The application still looks like NinjaTrader 6.5 but under the hood, there has been a lot of work.

SECOND IMPRESSION

My second impression, is much better. After using it , I think NT7 delivers. Now, it is not ready for prime time , but it is close. I use it for all my backtesting now. I get funny debugging messages sometimes, but I assume they will go away when it ships.

NT7 is still in beta , so I won’t discuss the features that I really , really like. You can check that out on the website. I had one little GUI pet peeve that I HATED in NT 6.5, and they took care of that in NT  7.0, is I think they have been trying to take care of a lot of bugs at once.

I have a Win7 machine that has been running NT7 continuously on a Mirus feed and a few strategies just to see when it ‘falls down and can’t get up’. So far it is much better than 6.5. ( This was a virgin install with nothing on it but NT7, source control and anti virus. Stable as a rock …. so far.

BRINGING YOUR SOURCE OVER FROM 6.5

There are some code breaking changes, and some that are only slightly code breaking. ( I will talk about that in the next section )

There is a document, appropritaely called NinjaScript Code Breaking Changes for NinjaTrader 7 that discusses most of the changes. They are all pretty minor, and won’t cause any major problems. I have a pretty large codebase of indicators and strategies and I brought them all over very quickly.

MAKING 6.5 & 7 INDICATORS COMPATIBLE

If you want to run your indicators in 6.5 and 7 simultaneously, you can use C# pre-processor directives. Note that the .zip archives will still be incompatible if you distribute using zip archives. Take a look at this document Best Practices for Distributing NinjaScript Objects

What a pre-processor directive does is perform actions before the code is compiled. If you want to have code that is only compiled in NT7, you would put it in between #if and #endif statements.  If you want to maintain one codebase  you could use NT7 to generate your NT7 and NT6.5 compatible indicators but , you can NOT use NT6.5 to generate NT7 indicators. That would be bad.

In this example, we compile an indicator with code for NT7 & NT6.5

#if NT7
    Print("NT7 Code);
#else
    Print("Not NT7");
#endif

Hat tip to r2kTrader

Photo by kevindooley

Market If Touched / Limit If Touched Orders In Ninja Trader

Posted by TraderWerks | Indicators, Market Analyzer, Site Information, Strategy | Wednesday 27 May 2009 9:35 pm

nudie_juice

MIT/LIT ORDERS MIA IN NINJATRADER

With any trading platform, there will always be ONE feature that you need that is not implemented. For me that is Limit If Touched orders with a negative offset in NinjaTrader. I was on a long trip recently and I finally had time to implement MIT/LIT for a strategy I was writing.

Long flights are great for getting work done. I will dread the day they allow cell phones in all planes.

On, on to the orders. Market if touched are a very similar to stop limit orders. They are both types of orders that occur only if the price reaches a certain level. With a Market If Touched order, once a price reaches a certain level, a market order is executed.

In Ninjatrader, there are some limitations to stop limit orders in strategies which are annoying, such as setting a negative stop price. I guess there is some reason for that, but it is beyond me. Maybe in NinjaTrader 7 they will have it for strategies.

If you have used StopLimit orders before and have seen an error about an improperly placed  order, then you know that I am talking about.

For these situations, we can use a Market If Touched or Limit If Touched order to accomplish the same thing , without the annoying errors and stopping of your strategy.

MIT / MARKET IF TOUCHED

A buy market-if-touched order is an order to buy at the best available price, if the market price goes down to the “if touched” level. As soon as this trigger price is touched the order becomes a market buy order.

A sell market-if-touched order is an order to sell at the best available price, if the market price goes up to the “if touched” level. As soon as this trigger price is touched the order becomes a market sell order.

LIT / LIMIT IF TOUCHED

Just like MIT order except that a limit order instead of a market order. This is the closest one to a stop limit order.

IMPLEMENTING IN CODE

You can only do this if you are writing code, I do not believe the strategy wizard can do this. I am not sure, I rarely use strategy wizard for anything.

This may be considered advanced programming, but it is not that hard. It just looks harder than it is. It is considered ‘advanced’ programming by the people on the Ninja Trader support forum, so they will not be that helpful.

Now for either of these orders , you have to monitor the prices, in-between bar updates. For that, we use OnMarketData. This recieves the price every time the price changes. This also increases the work your computer has to do , so be careful.

protected override void OnMarketData(MarketDataEventArgs e)

The variable e has a MarketDataType attached, and this is what you want to trigger you trade from. There are different things you can trigger from.

  • MarketDataType.Ask
  • MarketDataType.Bid
  • MarketDataType.DailyHigh
  • MarketDataType.DailyLow
  • MarketDataType.DailyVolume
  • MarketDataType.Last
  • MarketDataType.LastClose

Mind you, not every data provider furnishes those. So when we see the price we want e.Price , if it is above our buy stop, we can then enter an order.

if (e.MarketDataType == MarketDataType.Ask)

{

if ( e.Price >= touch_price )

    {

        EnterLimit ( ) ;

    }

}

 

Now, this is just a start, and there are a lot of things you can do with this. Such as shorting when the bid reaches a certain price and so on.

MIT definition from Wikipedia

Book Review : Mean Markets And Lizard Brains

Posted by TraderWerks | Indicators | Tuesday 12 May 2009 7:18 am

mean_market_lizard_brain
I usually read books to help me find trading and indicator ideas. This book doesn’t really address either of those points. This is more about the psychology of trading and ‘beahvorial finance’.  It is more of a ‘Intro To Behavioral Finance” you might say.

 I have talked about behavioral finance before here .

This book caught my eye because [1] It had a picture of a lizard on it , and [2] Taleb recommended it, and I am a big fan of his even if I think he is a bit too pompous on TV.

SHORT REVIEW

Good book if you liked Taleb’s Black Swan book. It is an easy read and makes you think about how our ‘Lizard Brain’ causes us to make crappy trading decisions.  Recommended.

Keep reading for the full review.

INTRO BEHAVIORAL FINANCE

The author , Terry Burnham, worked on behavioral finance for 10 years at Harvard including teaching, which puts him in the egg head category.

The book is divided into four sections. The first part , The New Science of Irrationality, and the last part, Profiting from the New Science of Irrationality are the most interesting to me.

EDUTAINMENT

The book tries to Edutainment ( hat tip to Boogie Down Productions) , which is entertaining and educational. It does not excel at either , but also does not fail.

Edutainment (also educational entertainment or entertainment-education) is a form of entertainment designed to educate as well as to amuse.

There are a lot of stories in the book, and I think this guy would have been a pretty fun professor in class. 

 If you have been around for a while, you probably have heard a lot of these stories, but he does put them into context.  Things like German Hyperinflation, the chances of making it to the NBA and ‘This is Spinal Tap’ quotes.

LIZARD BRAIN

The book centers around our ‘lizard’ brains. Which is non ‘pre frontal cortex part of our brain. The ‘pre-fontal cortex is what we use for rational thought, trading decisions, etc.

The rest of our brain, the lizard part , is responsible for everything else. Fight or flight, loss aversion, fear of being eaten and things like that are all handled by our lizard brains.

The final part of the book gives rules on how we can invest without out using our lizard brains.

GOOD PARTS

  1. Excellent intro to behavioral finance
  2. Good attempt at making a subject more relatable
  3. The author was bearish on the market in 2005

NOT SO GOOD PARTS

  1. The book is dated. Has a lot of references to the housing crisis.
  2. Tries to be ‘edutainment’, does neither well
  3. The author was bearish on the market in the book

It is surprising hard to write a post about this book without overusing the term Lizard brain. My apologies.

Free Indicator Of The Month : Timeline For The S&P E-Mini (ES)

Posted by TraderWerks | Free Indicators, Indicators | Monday 20 April 2009 6:26 am

tw-timelineTIMELINES
This is a favorite ‘indicator’ of mine. I often forget my rules on time parameters. Such as trading over lunch and not trading around 2:00 p.m..

Timelines are indicators the draw lines across the bottom of a screen to give you a visual indication of the time during the trading day.

They can display many things, such as when different markets open and close or specific periods during the trading day.

DIFFERENT STROKES FOR DIFFERENT FOLKS

Different traders use timelines for different reasons. Currency traders will want to know things such as the time of the European open or the asian close.

Index traders usually look for periods during the day such as the open, lunch, and pre-market.

At the end of the day, timelines help you trade better by knowing what time you are in in the trading day.

TIMELINE FOR THE ES

This is my version of a timeline for the ES. The only parameter is the time-zone. By default, it is set to CST ( Chicago time ) and has settings for PST and EST.

This indicator is a little different in that it gives you a 5 minute warning before a change. When I am watching a trade, I want to know BEFORE the change. It gives me more time to prepare to enter/exit a trade.

If you click on the graphic , you will see a light green bar before the open. That is a color change that appears 5 minutes before the color changes to red. That little bit of warning helps me, I hope it helps you too.

The 5 minute bars are different sizes because I am using tick charts and they can have a different number of bars in a 5 minute period.

TIME TABLE

TW Timelines only has two colors, Red and Green. The light Green and light Red mark the transition times between two time periods.

The times for the indicator to go red are:

Opening : 8:30 A.M. Central Time
Lunch Break : 11:00 A.M. Central
Bond Market Close : 2:00 P.M. Central

These times are my preferences. The Bond pit closes at 2:00 P.M. Chicago time, and that may influence the stock market. Some people pay attention to that, others do not. If you have any ideas for other timelines, drop me a line at blog @ traderwerks.com

DOWNLOAD TIMELINE INDICATOR

I have put a banner ad up on the site for you to download this indicator when you sign up for the mailing list. I do not send much on the mailing list, but I put any updates to my free indicators there so it is a good thing to be receiving when I update indicators.

If the offer has expired, is because the free download has been cancelled, changed, folded , spindled or mutilated ( Just kidding ) . I do rotate the free indicators, so if the offer is gone, AND you are on the mailing list, email me and I will see about getting you a copy.

Three Bar Reversal ( 3BR ) Strategy With Free Source

Posted by TraderWerks | Free Software, Indicators | Sunday 5 April 2009 12:04 pm

barrev

3 Bar Reversal Pattern ( Strategy Wizard )

        This strategy is from an article  by Thomas Bulkowski ”Are Three-Bar Patterns Reliable For Stocks?” . It was in the  January,2000 issue of Stocks&Commodities magazine. As an aside, I want to mention, that there are a lot of things called “Three Bar Reversals’, but I am just looking at this particular one.

        This strategy was done in strategy wizard using NinjaTrader so those who are not into C# programming, can fool around with it. You can import this strategy with File->Utilities->Import NinjaScript. Ninja expects a zip file when you import so don’t unzip the file after you download it, just import it as is.

THREE BAR REVERSAL

        I coded this up in NinjaTrader ( Sorry Tradestation people ) for use on daily charts and then I tested it on one stock. I chose AAPL for two reasons (1) I love Apple computers (2) It comes first alphabetically. I also like to trade AAPL stock, it is one of my favorites trading stocks.

        It is a stop and reverse system, which means it is always in the market. When it gets a buy signal, it goes long, when it gets a sell it closes the long position and goes short. Some people like this style of trading system, some people do not.

Rules :

- Day two of the three-day pattern has the lowest low / highest high of the three days.

- Day three  must have a close above the prior day’s high/low.

- No DoJi’s

If you want the full details , you can order a reprint from the net.


I discovered this gem of a pattern while prospecting for ideas in a recent issue of STOCKS & COMMODITIES.In the interview with Kevin Haggerty was the following pattern description: One example [to determine a change in direction ]is a three-bar pattern,which is the same one that futures traders use.The stock establishes a low price as a swing point.Once the stock closes above the high of the low day,to me,that is a change of direction for an undetermined period. Using this description as a guide,I decided to formalize the shape and behavior of the pattern.

-Thomas Bulkowski




SIXTEEN MONTH TEST ON AAPL (Apple Computer )

        So I tested this system from Jan 1, 2008 to today, April 4, 2009. No particular reason why I picked that date, I just wanted to start on a Jan 1. It ran for 16 months in backtesting, and the results are in the image about. You can click it for a larger image.

        Now admittedly, AAPL is a very volatile stock, that I do like to trade, so this probably does not represent your average stock. However, it has been a very volatile period and a lot of equities have been trading like AAPl stock.

        The strategy returned $84 a share over the 16 monhts, and had a win/loss ratio of 53%. Just a little better than flipping a coin but the profit came from the win /loss ratio. The wins were 50% greater than the losing trades. Average trade was over a week, which is a doable rate for the retail trader who cannot watch the market all day. The profit percentage was 4.41% percent a month.

aapl-11_12_2008-4_5_2009-daily

WHAT CAN BE DONE TO IMPROVE THIS STRATEGY

        I think there is a lot to be said for this strategy. However, it is an ‘always in the market’ kind of strategy that can get caught in a downdraft. So here are some suggestions ( If you try any of these, let me know and I will update this post )

  1. If used on a portfolio, use a portfolio normalization scheme for position sizes.
  2. Stop Loss at support and resistance levels.
  3. Profit Stop.
  4. Test performance on ETF’s

WHERE CAN I DOWNLOAD THIS

        You can download this here,3 Bar Reversal Strategy . Enjoy

None of this is investment advice. This is just a strategy I coded for entertainment purposes only. Nothing more. Whatever you do with this is up to you. There is no warranty expressed, adumbrated, implied, insinuated, inferred, implicated, aspersed, or otherwise in existence.

Free Indicator Of The Month – TS Volatility

Posted by TraderWerks | Free Indicators, Indicators | Wednesday 18 March 2009 12:23 am

TRADESTATION VOLATILITY

tradestation_velocity_indicatorWhen you convert an automated trading strategy from one system to another, there are a lot of things that will be  ’missing’. Such as a trading strategy from Tradestaion to NinjaTrader, you may not have some of the built in indicators that you had with the previous platform.

I have converted trading strategies from different platforms to NinjaTrader and ran into this problem. I ended  up creating NinjaTrader versions of a bunch of Tradestation indicators. Case in point,  this one is called Volatility in TradeStation.

Tradestation volatility is an indicator that measures the current volatility of the market. There are other measures of volatility , such as standard deviation.  It is different from things like standard deviation, in that it uses the high , low and close of a bar to calculate the volatility and not just the closing price like a standard deviation based indicator does.

You can click on the image to see a  huge image from Tradestation and compare it with the same indicator from the same timeframe on the image below.

TRADESTATION VOLATILITY INDICATOR FOR NINJATRADER

ninjatrader_velocity_indicator Note, that this is is a clone of the TradeStation indicator.  I got it as close as possible . This version of of the Volatility indicator matches the current TS version.

The original version in Tradestation, from the book ( See Reference Below ),  is now called VolatilityClassic. Like Coke Classic I guess.  I do think the current version is better than the original, in my humble opinion.

As you can see from the two images, they are very, very, similar.  No matter what you do, there will be small differences whenever you take an indicator from one platform to another. Such is life.

HOW TO USE THE INDICATOR

Volatility can be used in a couple of ways, the easiest would be the setting of stops. The more volatile the market, the further away you want your stops. Of course, this increases the risk. Another way is discretionary trading. Volatility sometimes reaches an extreme near the end of a move. A discretionary trader could use that to exit a trade.

DOWNLOAD NINJA TRADER VOLATILITY INDICATOR

I have put a banner ad up on the site for you to download this indicator when you sign up for the mailing list.  I do not send much on the mailing list, but I put any updates to my free indicators there so it is a good thing to be receiving when I update indicators.

If  the offer has expired, is because the free download has been cancelled, changed, folded , spindled or mutilated ( Just kidding ) .  I do rotate the free indicators, so if the offer is gone, AND you are on the mailing list, email me and I will see about getting you a copy.

Reference
Kaufman, P.J. The New Commodity Trading Systems and Methods.
John Wiley & Sons. New York 1980. Pages 99-101

Free Indicator Of The Month…Or Week

Posted by TraderWerks | Free Indicators, Indicators | Saturday 14 March 2009 7:22 pm

Photo Curtesy Photo Courtesy kalandrakas   http://www.flickr.com/photos/eelssej_/

FREE INDICATOR OF THE MONTH

I have decided to release some of the indicators for NinjaTrader I have written when translating Easy Language strategies to Ninja Trader. So I will post them for download for a month, or until I replace it with another indicator. So I guess technically , it should be “Free Indicator Of The Moderately Indeteminate Time Frame With A Median Time Of One Month”. While technically correct, that would be too long for the title of a post. As well as boring.

TRADESTATION

A lot of people are moving from TradeStation to NinjaTrader. There could be a lot of people moving the other way, but I would have no idea, since they would not be contacting me.

I try to avoid writing EL ( Easy language ) code anyway, I prefer C# to EL. That is just me, I know a lot of people who love TradeStation. Now if I could just get an application that was written in C++ on Linux…….

COMING UP

I am releasing the TS Volatility Indicator (a Tradestation indicator converter to NinjaTrader ) first. I will release the VolumeRatio ( also a Tradestation indicator converter to NinjaTrader ) and my Opening Range indicator in the next few weeks. So get on the list and get them mail to you when they are released.

Photo Courtesy kalandrakas

ACD Revisited And Waiting For Godot

Posted by TraderWerks | Indicators, Site Information | Saturday 7 March 2009 10:50 pm

godotWAITING FOR NT 7
If you knew me, you would know I am a big ACD fan. We had a bunch of ACD indicators written for Ninja Trader, but had not released them. ( We released two as stand alone then pulled them back ). When we were looking at releasing them, NinjaTrader 7 was going to be shipped ’shortly’. We did release Pivot Moving Average, Sushi Roll and Opening Range indicators.

We wanted to wait for Ninja Trader 7 which was supposed to be released at the end of 2008, but has been pushed back. I am sure this is NOT a waiting for Godot type of delay, Ninja Trader 7 will be released, but this is the way software developemnt goes sometimes. Unless you are Microsoft, then it is the standard. So we are going to start releasing all of the ACD indicators we have for Ninja Trader over the next few weeks for Ninja Trader 6.5. Hopefully, there will not be a lot of changes between NinjaTrader 6.5 and NinjaTrader 7.0.

THE LOGICAL TRADER
For those of you who don’t know, ACD is the method outlined in the bok, ‘The Logical Trader’, by Marc Fisher. I don’t think anyone uses ‘pure’ ACD anymore, but there is a lot of good stuff to take away from the book.

GODOT
NinjaTrader 7 AS OF THIS POST is supposedly scheduled for a second quarter 09 beta. ‘Nuff said. For those of you who do not like plays, Waiting for Godot is a play by Samuel Beckett, in which two characters wait for someone named Godot. Godot never shows up.

The photo has nothing to do with ACD, NinjaTrader, or Godot. I just like auto show girls. You can click on the image to make it bigger.

Volume Ratio For Ninja Trader

Posted by TraderWerks | Indicators | Wednesday 25 February 2009 2:19 am

twvolumeratio We just wrote Volume Ratio for Ninja Trader. This is a TradeStation indicator that was written for NinjaTrader. So take a look and enjoy. If you want this indicator before we post it for download, please drop us an email.

If you notice the data, yes, it is fake data. This indicator does not run on historical data, so you need to run it live, or use replay data.

You could also use simulated data like I did when I developed this, but it is probably not much use unless you like imaginary trading.

Next Page »