![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Charting Support for NinjaTrader Advanced Charting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2008
Posts: 67
Thanks: 0
Thanked 0 times in 0 posts
|
From the sample code in help it appeared that adding a "@" to the beginning of a draw tag might do it but it doesn't work. The line I draw on one chart doesn't appear on the others. Any ideas?
Eg. DrawHorizontalLine("@TopRange", true, RangeHigh, Color.Red, DashStyle.Solid, 2); ^ |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks for the note. Unfortunately this is not possible to do at this time. The strategy or indicator would need to be run on each chart in this instance. Let me know if I can be of further assistance.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Brett,
I am having a similar problem as this gentleman. I am just trying to draw a line on a chart in the market replay connection. The code is as follows private void drawTrendLine(){ string label = "trendLine" + drawCounter.ToString(); int startx = getstartX(); int endx = getendX(); double startY = getStartY(); double endY = getEnd(); Print("Drawing Trend Line: startx =" + startx + " endx = " + endx + " starty = " + startY + " endy = " + endY);//This prints correct values DrawLine(label, startx, startY, endx, endY, Color.Black); drawCounter = drawCounter+1; } //end drawTrendLine method Is there any reason this method should not work? Can you not draw objects in market replay or not draw them with a strategy? If either of those things are possible could you point me to a code example. I don't want to use plots because I am not using a DataSeries Object. I just want to draw the line using my own calculated values. |
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
Code:
double endY = getEnd(); Code:
double endY = getEndY(); |
|
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Furthermore, what exactly does not work in the code. Do you get Print() to output if you add in Print to make sure it is working as expected? -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Oct 2011
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
Hey Brett,
Thank you for taking the time to reply. The problem is the the drawing object just does not show up on the chart. Actually you are correct about that function name. That was a typo, but those functions are really just placeholders to show the code they are not the actual functions being called. The functions being called for startx, starty, endx, endy all work and return correct values in the output window so I know that the input passed into the DrawLine(label, startx, startY, endx, endY, Color.Black); is valid input. What I am thinking now, but haven't tried it yet, is that I have to maybe use a Plot to draw on the chart? That I have to add an indicator of some kind for example using the Add( Indicator Object); in the Strategy and then have the Indicator do the drawing? Is that a correct understanding? I just don't know if you can call DrawLine() from directly within a Strategy. This is really the source of my question. Thank you. |
|
|
|
|
|
#7 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
You can call DrawLine from a strategy no problem.
You would need to print out your inputs and make sure everything is getting called correctly. More then likely the problem is there. If you run out of ideas however you can always send code into support at ninjatrader dot com and I can take a quick look at it. However at this stage first step is to debug with Koganams idea's and also to start adding Prints for all the inputs and the making sure the DrawLine is being called from inside OnBarUpdate(). -Brett
Brett
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Global Draw Objects | Mindset | Suggestions And Feedback | 1 | 02-18-2011 08:28 AM |
| Draw object not being removed.. | gg80108 | Indicator Development | 1 | 08-12-2010 07:21 AM |
| Global draw lines | astrolobe | Version 7 Beta General Questions & Bug Reports | 4 | 06-10-2010 03:53 PM |
| global draw object getting changed in lower timeframe chart | mmtrader | Version 7 Beta General Questions & Bug Reports | 3 | 04-20-2010 08:27 AM |
| request - global draw object from code | ATI user | Version 7 Beta General Questions & Bug Reports | 1 | 01-11-2010 12:56 PM |