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

Complex correction - help with code

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

    Complex correction - help with code

    Hi
    I am playing with a strategy that trades complex corrections ie ABCD corrections...Please see attached screen shot. (Pls Ignore the triangles)
    In the screenshot let's assume I want to get long as I have decided we are in an uptrend. So I want to buy a complex correction.
    This means I want to buy at some signal that happens near D.
    This is a Unirenko chart so I am using basic Unirenko 2 bar reversal patterns as triggers.
    I have coded the 2 bar reversal trigger..that is no problem.

    Can someone help out with giving me an idea of how to code the logic to an indicator that will plot an object under the 2 bar reversal at 'D'...but not at 'B'.

    Many thanks for any tips..it has probably been done many times before.

    thanks
    Attached Files

    #2
    Hello lindsayf,

    Thanks for your post.

    If you have access to the source code for the tool that draws these letters, it can help to give you an exact answer. Otherwise, I would suggest recreating from your observations. D is generated after B so if you have calculated B and then C, and then D is calculated again, then you have a situation specific to D.

    If you implement the logic that created these letters you could consider creating an integer variable that tracks where the drawing's construction is at. For example, once the trend is calculated for A set variable to 1, when the variable is 1 and the trend is calculated for B, set the variable to 2, and so on. when the trend can then calculate a D and the variable is 4, draw your unique drawing for D. This will show an object specifically for D occurrences.

    We look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi
      Thanks for your reply.
      That drawing ( ABCD etc) is done manually - I dont have any code or indicator for that.
      That indicator is what I want to create or find.
      So - I was hoping for more specific advice as to how to develop that code - could it be done in the Strategy Builder? If so, how?
      I don't have the coding skills to do it from first principles - but perhaps it has been done in another indicator somewhere?

      thanks
      Lindsay

      Comment


        #4
        Hello Lindsay,

        Creating conditions that create this behavior will require a logical definition of what you are trying to accomplish.

        If those are drawings you have done, you can get started modelling logic that describes the criteria you use for creating those drawings. Once you have an exact definition of the criteria used to create these drawings, you will have a good starting point to start writing conditions that describe the same to place your drawing object.

        The Strategy Builder does have the capability to make logical checks and place drawings on the chart. Mathematical operations are limited in the Strategy Builder, however, so it may be difficult to count X number of bars since you have drawn a B to see if the conditions for B occur again, which may mean that a D would be placed. In the Builder, you could consider making several bools, I.E. "OneBarSinceB," "TwoBarsSinceB," etc. to see if the conditions for B become true after X number of bars, but it would be much more cumbersome to design logic this way than to implement what you need in code.

        Below is some information on drawing in the Strategy Builder.



        If you are interested in services in having this code written for you, you could consider enlisting the services of a NinjaScript Consultant from our EcoSystem. If that is something that interests you, please let me know and I will be happy to have a colleague follow up with more information.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          many thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elirion, Today, 01:36 AM
          2 responses
          12 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by DJ888, 04-16-2024, 06:09 PM
          5 responses
          14 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by samish18, Yesterday, 08:31 AM
          4 responses
          14 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by funk10101, Yesterday, 09:43 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          5 responses
          551 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X