NexusFi: Find Your Edge


Home Menu

 





New Indicator


Discussion in NinjaTrader

Updated
    1. trending_up 992 views
    2. thumb_up 0 thanks given
    3. group 0 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

New Indicator

  #1 (permalink)
 MarianoRA 
Alicante.Spain
 
Experience: Intermediate
Platform: Ninja Trader
Trading: FDAX, NQ
Posts: 2 since Feb 2012
Thanks Given: 3
Thanks Received: 0

Good afternoon, I will see an indicator that works perfectly and does almost what I ask but it does the other way around, I want to explain.

It is an indicator that draws 2 lines, a line is at the opening price and one at the current price, moving up or down depending on the same price movement.

The question is very basic, I got that I do but right price and what I want is that these colored lines are placed LEFT price and these lines can change their parameters so that they are brought up to 20 candles behind price, 30, 50, etc etc, that's changed the parameters of the indicator. And this is what it takes me hours and I can not do it. Please ask for help sure is a little silly. In short is that exit right instead of the left of the price.

Besides these 2 lines go on the left of the price I would also like clicking on these lines to modify the parameters indicator open and now does not work properly.

I have added the code indicator.

namespace NinjaTrader.Indicator
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
[Description("Enter the description of your new custom indicator here")]
public class BbFranLine : Indicator
{
#region Variables
// Wizard generated variables
private double disTicks = 5; // Default setting for DistClose
private int barrAtras = -41; // Default setting for BarrAtras
private int barrDel = -70; // Default setting for BarrAtras
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = false;
Overlay = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
RemoveDrawObjects();
double cierre=Close[0];
double apertura=Open[0];
DrawLine("Inf", true,barrAtras,cierre ,barrDel,cierre,Color.Violet,DashStyle.Solid,7);
DrawLine("Sup", true,barrAtras,apertura ,barrDel,apertura,Color.Black,DashStyle.Solid,7);
}

#region Properties
[Description("")]
[GridCategory("Parameters")]
public double DisTicks
{
get { return disTicks; }
set { disTicks = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int BarrAtras
{
get { return barrAtras; }
set { barrAtras = Math.Max(-100, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int BarrDel
{
get { return barrDel; }
set { barrDel = Math.Max(-100, value); }
}
#endregion
}
}


Thanks in advance.

MarianoRA

Follow me on Twitter Started this thread Reply With Quote




Last Updated on October 28, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts