| Market Internals Discussion forum on market internals, pit noise/action, and price action to determine the overall strength/weakness of the markets. |
![]() | | Tweet | |
| | #33 | ||
![]() | Re: Ninja Traders...lets Build a Better Mousetrap I certainly want to convert this to onmarketdata or however they are going to be handling tick back fills in NT7. The volumeprofile indicator that comes with ninja uses the sorteddictionary and is tick by tick if you want a proper example. With all the graphics override though its hard to understand if you just want to see how sorteddictionary works. As far as the speed, I guess you could do it faster if you knew alot about hashing. There is no way though I could do it faster though, I'm sure my sorting algorithm would be terribly slow and totally wrong. Having that done behind the scenes is just awesome if your not a real programmer. Especially when you consider adding new elements that need to go between 2 that already exists..you don't have to mess with moving the array all over the place. Next I'm going to try to make a version of market profile with this and to learn to override plot. One thing I dont get is why they didnt make a big custom function library for plot overrides. Draw lines, draw rectangles, get X Y coordinates, last bar painted, first bar painted...there is only a few things you would want to do but have to dig through all this convoluted code in the indicators right now. | ||
| |
|
| | #34 | ||
![]() | Re: Ninja Traders...lets Build a Better Mousetrap Really though, I guess Ninja doesn't have documents for the stuff they are doing as far plot overrides? If you put this in an empty indicator, then put the output window next to the chart and play with it you can get a feel for what these methods are doing. public override void Plot(Graphics graphics, Rectangle bounds, double min, double max) { Print("ChartControl.BarSp ace" + " : " + ChartControl.BarSpace); Print("ChartControl.Canva sRight" + " : " + ChartControl.CanvasRight) ; Print("ChartControl.Canva sLeft" + " : " + ChartControl.CanvasLeft); Print("ChartControl.BarMa rginRight" + " : " + ChartControl.BarMarginRig ht); Print("ChartControl.BarMa rginLeft" + " : " + ChartControl.BarMarginLef t); Print("ChartControl.BarsP ainted" + " : " + ChartControl.BarsPainted) ; Print("ChartControl.BarWi dth" + " : " + ChartControl.BarWidth); Print("bounds.X" + " : " + bounds.X); Print("bounds.Y" + " : " + bounds.X); Print("bounds.Height" + " : " + bounds.Height); Print("bounds.Width" + " : " + bounds.Width); Print("-----------------"); System.Drawing.SolidBrush myBrush; myBrush = new System.Drawing.SolidBrush (System.Drawing.Color.Bla ck); graphics.FillRectangle(my Brush, new Rectangle(ChartControl.Ca nvasLeft,ChartControl.Can vasLeft,ChartControl.Canv asRight,bounds.Height )); } | ||
| |
|
| | #35 | ||
![]() | Re: Ninja Traders...lets Build a Better Mousetrap Not meaning to detract from the thread intent. But may I ask why all the effort here when something reasonably priced will easily do all this and more? Self-punishment? ![]() All my best, MK | ||
| |
|
| | #36 | ||
![]() | Re: Ninja Traders...lets Build a Better Mousetrap I'm not sure if you mean finalg's market profile? I'm mostly interested in being able to do whatever I want with my charts, not really interested in market profile per se. Adding on to that last post, once you get a feel for the coordinates of the chart the next logical step would seem to be getting a feel for how things are handled per bar, which seems to be what the getYposition function is for that is added on as an extra function in alot of the indicators that override plot. private int GetYPos(double price, Rectangle bounds, double min, double max) { return (int) ((bounds.Y + bounds.Height) - ((price - min) / ChartControl.MaxMinusMin( max, min)) * bounds.Height); } When you pass in the price variable you can get things moving.. int ypos = GetYPos(Close[0], bounds, min, max); If you then change the above rectange fill by passing in ypos Rectangle(ChartControl.Ca nvasLeft,ypos,...... You then get a blackbox that shades everything out below the current close of the bar. This is also a good little reference for how drawing rectangles works http://www.informit.com/articles/art...25357&seqNum=5 Last edited by darthtrader3.0beta; 12-23-2008 at 09:26 AM. | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Companies That Build Trading Computers? | Tasuki | Tools of the Trade | 68 | 03-23-2009 03:23 PM |
| Free MP for Ninja | darthtrader | Market Profile | 17 | 01-19-2009 04:55 PM |
| Using .eld Indicators in Ninja Trader | coldsigh | Coding Forum | 3 | 10-09-2008 12:44 AM |
| Using Outside Sources to Build Track Record And/or Make Additional Money... | brownsfan019 | Market Analysis | 24 | 04-30-2008 07:12 PM |
| Question with Ninja.... | Soultrader | Brokers and Data Feeds | 9 | 01-25-2007 11:18 AM |