NexusFi: Find Your Edge


Home Menu

 





DrawObjects/RemoveDrawObjects Realtime Blinking


Discussion in NinjaTrader

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




 
Search this Thread

DrawObjects/RemoveDrawObjects Realtime Blinking

  #1 (permalink)
marretta
Sao Paulo, Brazil
 
Posts: 3 since Aug 2014
Thanks Given: 0
Thanks Received: 0

Hello everyone, first time on this forum. Need some help....Coming from Amibroker I'm trying to rewrite an indicator wich is very simple: start , target and stop values, and a line drawn at the exact point (value) on the chart. (sorry, forum doesn't allow me to post pics in the first 5 posts)


So what I'm trying to do, is to have the indicator to be in "real time mode", and by that I mean , for example, if I have the signal when a doji forms (Close[0]==Open[0]), I want to see a triangle below the bar while the bar is forming and if the bar changes I want to see the triangle desappear . I want to see it blinking...
So if I choose "Calculate on bar close - FALSE), as soon as the bar opens, wich always opens as a doji( first tick has always OPEN==CLOSE), the triangle shows and stays there forever even if the bar changes to a hammer or anyother candle than a doji.
So I checked the RemoveDrawObjects and using that it simply removes all the past signals, wich I want to have in the chart.

I tried to find a solution and the only one I found was to have two indicators to achieve that, one with a +CurrentBar and "calculate on bar close_TRUE" and another without +CurrentBar but "calculate on bar close_FALSE" , but I'm wondering if there is a better and easy way to do it.
Below I'll post the two formulas

Thank you
---------------------------------------------
This is the one that removes all the past signals, and I use Calculate on bar close - FALSE:
---------------------------------------------
#region Variables

//tentando colocar triangulo abaixo do doji
private bool drawTriangleUp = true;
private int TriangleOffset = 5;
private Color TriangleColor = Color.Gray;
#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;
AutoScale = true;
PriceTypeSupported = false;
DisplayInDataBox = false;
PaintPriceMarkers = false;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
{
return;
}
if (Close[0]==Open[0])
{

DrawTriangleUp("TriangleUp",false,0,Low[0]-(TriangleOffset * TickSize),TriangleColor);
//DrawTriangleUp("TriangleUp"+CurrentBar,false,0,Low[0]-(TriangleOffset * TickSize),TriangleColor);
}
else
{

RemoveDrawObject("TriangleUp");
}

}

------------------------------------------------------------------------------------------
and this is the one to have the past signals ploted with Calculate on bar close - TRUE
------------------------------------------------------------------------------------------
#region Variables

//tentando colocar triangulo abaixo do doji
private bool drawTriangleUp = true;
private int TriangleOffset = 5;
private Color TriangleColor = Color.Gray;
#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;
AutoScale = true;
PriceTypeSupported = false;
DisplayInDataBox = false;
PaintPriceMarkers = false;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
{
return;
}
if (Close[0]==Open[0])
{


DrawTriangleUp("TriangleUp"+CurrentBar,false,0,Low[0]-(TriangleOffset * TickSize),TriangleColor);
}
else
{

RemoveDrawObject("TriangleUp");
}

}

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
Self sabotage reframed
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (permalink)
marretta
Sao Paulo, Brazil
 
Posts: 3 since Aug 2014
Thanks Given: 0
Thanks Received: 0


Well, since it's been almost 4 weeks and I got ZERO replies for a simple question, and I can't download any indicator to learn Ninja Trader's Language without having to pay to become Elite Member, I don't see any reason to be in this Forum.

Could You Mr. Big Mike tell me how Do I cancel my registration in your website ? And also delete this posts and my answer to your Amibroker Platform Quiz, if you please.

Thank you.

Reply With Quote




Last Updated on October 17, 2014


© 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