Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automatic Trend Line Detection and Alert

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mike12345
    replied
    Thanks Bertrand
    I will do so

    Thanks for help
    Mike

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Mike, you can send the code you use to support at ninjatrader dot com to my Attn, so I can take a look - thanks.

    Leave a comment:


  • Mike12345
    replied
    Thanks Bertrand
    I have CalculateOnBarClose is set to false, and I wait a 2 or 3 tick and after that one TL is moving and the current one is locked.
    is any way to load the code or send it for you.
    I run NT 7/17

    Thanks for helping
    Mike

    Leave a comment:


  • NinjaTrader_Austin
    replied
    Mike, if you are using CalculateOnBarClose = true, you will have to wait until the most current bar is completed (or for a new bar to start, it is the same event) before the current trend line will be unlocked.

    If CalculateOnBarClose is set to false, you will just have to wait for the next tick to come in before the trend line will be unlocked.

    Leave a comment:


  • Mike12345
    replied
    Thanks Bertrand

    I view the code again but I didn't find anything related to unlock, Do I missing anything.
    Thanks
    Mike

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Mike,

    In your code you will need to set the lock property for the object to false.

    Please see the example here: http://www.ninjatrader.com/support/h...drawobject.htm

    Leave a comment:


  • Mike12345
    replied
    This a little video explain what happend

    Thanks

    Leave a comment:


  • Mike12345
    replied
    Thanks Bertrand

    Yes I add on # 51.

    I attach a copy of the code, I may missing something, thanks for help me.
    if you don't mind would you please check it.

    Thanks
    Mike
    Sorry it deosn't let me attach the full code here but if I get you email I will email it to you






    ///<summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    ///</summary>
    protectedoverridevoid Initialize()
    {
    DisplayInDataBox =
    false;
    CalculateOnBarClose =
    true;
    Overlay =
    true;
    PriceTypeSupported =
    false;


    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Loops through the DrawObjects collection
    foreach (IDrawObject draw in DrawObjects)
    {
    // Unlocks all draw objects for manual manipulation on the chart
    draw.Locked = false;
    }






    // Calculate up trend line
    int upTrendStartBarsAgo = 0;
    int upTrendEndBarsAgo = 0;
    int upTrendOccurence = 1;

    while (Low[upTrendEndBarsAgo] <= Low[upTrendStartBarsAgo])

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Sorry don't follow you, if I apply this on the code I referenced on # 51 I see one current ray drawn and it's unlocked i.e. freely movable then after this snippet is added.

    Leave a comment:


  • Mike12345
    replied
    Thanks Bertrand

    I did that and I have been able to move the past TL not the current one??

    Thanks Again

    Mike

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Sorry Mike, to unlock the drawn objects, you can set locked to false programmatically with this snippet here in the OnBarUpdate() code portion - http://www.ninjatrader.com/support/h...drawobject.htm

    Leave a comment:


  • Mike12345
    replied
    Thanks Bertrand

    I try this and it is not working on calculate on bar close false or true.
    just I want be able to move the TL in Auto Trendline indicator by the mouse.

    Thanks
    Mike

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Try adding this below to Initialize() -

    Code:
     
    AllowRemovalOfDrawObjects = true;

    Leave a comment:


  • Mike12345
    replied
    lock off

    Hi Bertrand

    Regarding this code, What I have to do to unlock the trend line just in case. I try to move it and give me a red lock sign, I try to save it as unlock but it is going back next tick to be locked.


    Thanks
    Mike

    Leave a comment:


  • designer
    replied
    Mike, I believe some people can and are indeed able to import auto trendline file into NT7 Beta....at least that is my understanding...

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by algospoke, 04-17-2024, 06:40 PM
6 responses
48 views
0 likes
Last Post algospoke  
Started by arvidvanstaey, Today, 02:19 PM
4 responses
11 views
0 likes
Last Post arvidvanstaey  
Started by samish18, 04-17-2024, 08:57 AM
16 responses
61 views
0 likes
Last Post samish18  
Started by jordanq2, Today, 03:10 PM
2 responses
9 views
0 likes
Last Post jordanq2  
Started by traderqz, Today, 12:06 AM
10 responses
19 views
0 likes
Last Post traderqz  
Working...
X