Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

I could use a hand with some code please.

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

    I could use a hand with some code please.

    HI,
    I could use a hand with some code please.
    I need to know how to click on either the high or low of a bar, (let's say the low of a bar for this example), we'll call this low "point A", and capture the price, then click on a the high or low of a second bar, (for this example a high), which we'll call "point B", and capture this price as well as well as the bar count from "point A" to "point B".
    The 2 prices I would store in variables, the bar count would also go to a variable.
    I would also with the same 2 clicks like to draw a Gann Fan on the chart using the speed of the range clicked on using a calculation involving the price and time value stored in the variables.

    I am not sure where the click would have to be? Either on the bar either above or below the mid point?
    Or above the high and below the low? Or perhaps something else?

    Not sure if any of the native Gann Fan methods when called actually draw a Gann fan that looks the same as the one in the drawing tools and automatically has the same adjustable properties and parameters show in the indi properties window? But would like to know.

    P.S. I have just done a C# coding course and have successfully coded two indicators so far.
    I have found coding windows programs in Visual Studio much easier than coding indicators in NT7.
    Mainly because all the learning was coding windows programs in Visual Studio, so I am reasonably familiar with that stuff. But Not so familiar with what's what in Ninja Script.

    I'd really appreciate some guidance.

    Cheers,
    Ken.

    #2
    Hi Ken, in NinjaScript currently directly there would be no supported methods for acquiring this info unfortunately. However something close to what you're envisioning as tool has been shared here in our forums - I think it will provide a valuable base to work and 'play' in this area - http://ninjatrader.com/support/forum...d=4&linkid=435

    The Gann Fan call itself from NinjaScript would be of course available and it would let you modify the creating object via the UI as well afterwards.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      use dDrawABC as template

      There is an indicator named dDrawABC available in the forum. This indicator can be used as a starting point, just replace the calculations and lines by the Gann Fan.

      Comment


        #4
        Thanks Bertrand & Mithnadril, I have already looked at dDrawABC and am again looking at it.
        I just think it looks overly complex? There's much in the code I don't yet understand.
        Could it be coded much simpler, in your opinion? Do you consider much of the code unnecessary?

        I found using the indicator that it snaps to bar & price independent of what the snap mode the chart is set to, but I can't see the coding for that?
        This is important to me, as I'd like mine to snap like that most of the time, but there are times when I want it to snap to price only. For example in the case of a double top say 10 bars apart, I may want to snap it in between the 2 tops above the centre bar, being 5 bars from either top, but at the same price of the 2 tops.

        Any comments?

        Ken.
        Last edited by KennyK; 07-31-2014, 05:25 PM.

        Comment


          #5
          Hi Ken, would not have any other code examples in this area, you're mainly working outside of documented approaches in NinjaScript here on this item - thus it will be more involved and demanding.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          3 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Working...
          X