NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Suggestions and Feedback > Suggestions And Feedback

Suggestions And Feedback New feature suggestions and feedback.

Reply
 
Thread Tools Display Modes
Old 04-29-2012, 12:21 PM   #1
GaryAlbers
Senior Member
 
Join Date: Nov 2007
Location: Arlington Heights, IL
Posts: 108
Thanks: 0
Thanked 4 times in 4 posts
Default DrawLine draws to incorrect Y coor when instrument scaled on LEFT.

I have a chart with 2 instruments, 6E scaled on LEFT in the top window.
I have a strategy that does a DrawLine.
The DrawLine places the line endpoints at the wrong price when the 6E is scaled on the LEFT. See attached picture #1
When I switched the scaling for 6E to RIGHT, the line endpoints are correct.
See attached picture #2.

The chart is a LineOnClose type which clearly shows the price at the time of the
DrawLine.

Here is the DrawLine cmd I used:
DrawLine(CurrentBar.ToString()+"L"+lineCount, true, barsAgo, Close[barsAgo], 0, Close[0], lineColor, DashStyle.Solid, 1);

Seems like a bug.

Gary
GaryAlbers is offline  
Reply With Quote
Old 04-30-2012, 02:59 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,556
Thanks: 111
Thanked 306 times in 293 posts
Default

Hello,

Thanks for the post and patience while I reviewed this.

It looks like you have one of your chart data series set to transparent, can you please change it to a color and line on close and then resend the screenshot so I can see where the other data series is.

Furthermore is this a multi time frame/instrument script? If so are you doing BarsInProgress filtering for your draw Object?

If both these check out I will run a test script on my side and try to reproduce it with your code segment.

Thanks.

-Brett
NinjaTrader_Brett is offline  
Reply With Quote
Old 05-13-2012, 06:41 PM   #3
GaryAlbers
Senior Member
 
Join Date: Nov 2007
Location: Arlington Heights, IL
Posts: 108
Thanks: 0
Thanked 4 times in 4 posts
Default

Yes, there are two data series on the chart. The 2nd data series in the bottom panel is very scrunched up at the bottom of the chart previously attached. It is a thin red line because both data series are set to line-on-close.

At the time I was running this strategy, it was after hours and I was connected to the Kinetick End-Of-Day data feed (so that the strategy would be enabled).
The strategy itself does not add the 2nd data series. The strategy uses indicators that do use two data series. I had code in my strategy to determine if it was even being called for the 2nd data series OnBarUpdate and it is not (BarsInProgress never equals 1).
Therefore, I conclude that this is NOT a BarsInProgress filtering issue.

I am familiar with the code required to deal with multiple data series because the underlying indicators have that logic in them.
On each OnBarUpdate call, the strategy calls [indicator].Update().

The only variable that seems to affect the problem is where the data series (that is being drawn on) has it's scaling.

When I switch data series 1 to be scaled on the left (same for 'Overlay'), the lines drawn are not correct vertically. When I switch it to be scaled on the right, they draw correctly.

-Gary
GaryAlbers is offline  
Reply With Quote
Old 05-14-2012, 06:20 AM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,556
Thanks: 111
Thanked 306 times in 293 posts
Default

In this case I would need to take a look at the code that is generating the drawing object. Can you please post a simplified example for me to reproduce this on my side and check into it further.

-Brett
NinjaTrader_Brett is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EMA in Panel2 scaled 0 -100 andrew56 Indicator Development 4 12-13-2011 12:44 PM
Mirus-Accounts Cash Value incorrect when left overnight mjc4118 Version 7 Beta General Questions & Bug Reports 6 07-13-2010 01:17 PM
draws tools pchofard Suggestions And Feedback 3 09-18-2009 11:39 AM
Positions P/L incorrect with two strategies trading the same instrument cunparis Automated Trading 14 02-05-2009 02:05 PM
Scaled in position adjustment targets trymph Miscellaneous Support 1 09-12-2005 07:46 AM


All times are GMT -6. The time now is 12:11 PM.