• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automatic Trend Line Detection and Alert

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

  • 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

    http://www.screencast.com/users/Mike...c-256322c25188

    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:


  • Mike12345
    replied
    Thanks

    Bertrand
    Thank you verymuch for your fast respond
    I imported and work fine

    Thank you again

    Mike

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Please try this one shared here.

    Leave a comment:


  • Mike12345
    replied
    Nt7

    any one be able to import auto trendline file into NT7 Beta??
    Thanks
    Mike

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by kevinfloresz, Today, 09:46 AM
1 response
15 views
0 likes
Last Post bltdavid  
Started by walter739, Today, 11:56 AM
0 responses
1 view
0 likes
Last Post walter739  
Started by digibob, 12-13-2019, 10:01 PM
4 responses
14 views
0 likes
Last Post bltdavid  
Started by TraderJim618, Today, 11:24 AM
0 responses
1 view
0 likes
Last Post TraderJim618  
Started by NT-Roland, Today, 10:03 AM
1 response
7 views
0 likes
Last Post Lancer
by Lancer
 
Working...
X