• 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

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.

        https://ninjatrader.com/support/help...ToDrawOnAChart

        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 dtl-saw, Yesterday, 08:44 PM
          0 responses
          12 views
          0 likes
          Last Post dtl-saw
          by dtl-saw
           
          Started by ballboy11, Yesterday, 04:29 PM
          0 responses
          10 views
          0 likes
          Last Post ballboy11  
          Started by zacharydw00, Yesterday, 02:29 PM
          2 responses
          30 views
          0 likes
          Last Post zacharydw00  
          Started by timcjpfx, Yesterday, 06:22 AM
          4 responses
          27 views
          0 likes
          Last Post timcjpfx  
          Started by welson, Yesterday, 08:26 AM
          2 responses
          18 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Working...
          X