Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 08-12-2017, 09:17 PM   #1
mvdn73
Junior Member
 
Join Date: Sep 2008
Location: Madison, WI
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default Draw.Text conflict with right side margin

I have an indicator that adds numbers either above or below the price bar during specific conditions. I have an issue with the chart randomly adding a significant amount of right side margin. My chart margin is only set to 10. This happens quite frequently. Once in this state it generally does not go away unless I touch the right side margin parameter value, turn on/off the indicator, or restore/maximize the chart window. The problem also goes away if I change the scale justification of the indicator to Left. But I don't want a left scale on my chart.

I have narrowed this down to what appears to be an issue with the Draw.Text method. Please see a test indicator example below that replicates the issue. You might have to refresh multiple times (F5) before you see it. The attached screenshot demonstrates the problem. It does not occur if the Draw.Text is not applied on the last 50 or so bars.

Any help would be appreciated. Thanks.

#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion

//This namespace holds Indicators in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Indicators
{
public class TEXTTEST : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "TEXTTEST";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
}
}

protected override void OnBarUpdate()
{
Draw.Text(this,"" + CurrentBar, "1", 0, Open[0]);
}
}
}
Attached Images
File Type: jpg chartcapture.JPG (69.5 KB, 10 views)
mvdn73 is offline  
Reply With Quote
Old 08-13-2017, 10:41 AM   #2
mvdn73
Junior Member
 
Join Date: Sep 2008
Location: Madison, WI
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default Also occurs with Draw.Ray

I discovered this also happens using Draw.Ray. See attached example.
Attached Images
File Type: jpg rayexmple.JPG (85.8 KB, 9 views)
mvdn73 is offline  
Reply With Quote
Old 08-13-2017, 12:58 PM   #3
NinjaTrader_AlanP
NinjaTrader Customer Service
 
NinjaTrader_AlanP's Avatar
 
Join Date: Apr 2016
Location: Denver, CO
Posts: 1,174
Thanks: 83
Thanked 231 times in 223 posts
Default

Hello mvdn73,

What version of NT8 are you running under Help>About?

I look forward to your reply.
NinjaTrader_AlanP is offline  
Reply With Quote
Old 08-13-2017, 02:14 PM   #4
mvdn73
Junior Member
 
Join Date: Sep 2008
Location: Madison, WI
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

8.0.8.0 64-bit (Standard).
mvdn73 is offline  
Reply With Quote
Old 08-13-2017, 03:36 PM   #5
NinjaTrader_AlanP
NinjaTrader Customer Service
 
NinjaTrader_AlanP's Avatar
 
Join Date: Apr 2016
Location: Denver, CO
Posts: 1,174
Thanks: 83
Thanked 231 times in 223 posts
Default

Hello mvdn73,

I was able to replicate and have forwarded this to development in the form of a bug report.

Thank you for reporting this.
NinjaTrader_AlanP is offline  
Reply With Quote
Old 08-13-2017, 07:14 PM   #6
mvdn73
Junior Member
 
Join Date: Sep 2008
Location: Madison, WI
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks, is it possibly for me to track priority and/or progress of a bug?
mvdn73 is offline  
Reply With Quote
Old 08-14-2017, 01:01 PM   #7
NinjaTrader_AlanP
NinjaTrader Customer Service
 
NinjaTrader_AlanP's Avatar
 
Join Date: Apr 2016
Location: Denver, CO
Posts: 1,174
Thanks: 83
Thanked 231 times in 223 posts
Default

Hello mvdn73,

Yes, I will follow up with you when it has been assigned a tracking number.

Thank you for your patience.
NinjaTrader_AlanP is offline  
Reply With Quote
Old 08-15-2017, 01:03 PM   #8
NinjaTrader_AlanP
NinjaTrader Customer Service
 
NinjaTrader_AlanP's Avatar
 
Join Date: Apr 2016
Location: Denver, CO
Posts: 1,174
Thanks: 83
Thanked 231 times in 223 posts
Default

Hello,

The issue has been assigned an ID 12032.

When the issue is resolved you will see this listed in the release notes of the helpguide.

Please let us know if you need further assistance.
NinjaTrader_AlanP 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
Right side margin blaporte Platform Technical Support 4 02-08-2017 07:35 PM
Right side margin not correct shilli1 Version 8 Beta 2 09-11-2015 03:41 AM
daily - right side margin tonynt Platform Technical Support 7 02-28-2013 07:30 AM
draw text on right side of visible chart area onnb1 Indicator Development 4 08-20-2012 12:54 PM
Right Side Margin tquinn General Development 1 01-07-2007 03:35 AM


All times are GMT -6. The time now is 05:32 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content. Visit the CFTC resources for education regarding the industry and signs of fraud.