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

how to initiate a trade from a chart object

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

    how to initiate a trade from a chart object

    Hi,

    I'm trying to code a strategy/indicator, that is initiating trades based on chart objects, that get drawn by hand or any other indicator.

    How I gonna do that?

    (it's seems to be possible, there is something out there, that claims to do right that)
    "Markers System"

    #2
    Hello td_910,

    Thank you for your note.

    This would be possible by looping through drawing objects applied to a chart and if a specified drawing object is present you could take some action, ie EnterShort();

    I have attached 2 indicators both starting with the name Loop, which demonstrate how you can loop through drawing objects and identify a specific type, ie ArrowLine.

    A link to our helpguide covering order methods can be found at the following link,


    Also see DrawObjects,


    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,

      Thanks for that. Is that also possible in NT7?
      I always thought, that an indicator/strategy is only able to access it's "own" drawing objects?

      Comment


        #4
        Hello td_910,

        The loop I provided would pick up on manually drawn objects not just those drawn by the indicator.

        This should be possible in NT7 using the loop at the following link,


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          yes, right it does pick up all draw objects, but only the ones drawn by the indi the loop is in and the manually drawn ones

          what it doesn't pick up is all other drawing objects drawn by other indis on the same chart

          I used that in my code
          if (FirstTickOfBar) foreach (IDrawObject draw in DrawObjects)
          {
          if (draw.DrawType == DrawType.Text) Print(draw.Tag);
          }

          Comment


            #6
            Hello td_910,

            This was an improvement in NT8, where the draw loop could pick up on objects drawn by other indicators. This is not the case in NT7.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              that sounds great, I just have a couple 100k line of code in NT7
              is there some "converter" to migrate that to NT8 ;-)

              Comment


                #8
                Hello td_910,

                There is not an official indicator/strategy converter which takes scripts from NT7 and converts them to NT8 however on the forum there is a post which provides script for conversion.



                I’d like to mention its best to do a manual conversion for accuracy as not all scripts are simple enough to be converted directly.

                Also below I’ve provided a link to code breaking changes which you should consider when converting your scripts:



                Converting customer code is out of the scope of NinjaScript support however if you’d like I could have someone from our business development team pass over a list of third party developers that you could contact about debugging your code.

                Please let us know if you need further assistance.
                Alan P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                4 responses
                31 views
                0 likes
                Last Post bmartz
                by bmartz
                 
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                11 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X