Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TrendMaster for Ninja

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

    TrendMaster for Ninja

    Hello. I would like to code an indi similar to an MT4 indi called TrendMaster. It uses a 50 CCI and and a 5 ATR and basically plots a green line on the price which moves up to the low of the current bar minus ATR when CCI > 0 and rising. If CCI > 0 but falling, the line remains flat and the same colour.
    It plots a red line on the price which moves down to the high of the current bar plus ATR when CCI < 0 and rising. If CCI < 0 but rising, the line remains flat and the same colour.
    I tried to move my first steps with Ninja's coding but failed miserably. I was wondering if some nice sould around here would be so kind to help me, since as I understand it shouldn't be a hard task for skilled coders. Of course if something like that already exists, maybe with a different name, could someone point me to the right direction? Thank you very much in advance,. I'm attaching a pic to show what I mean.
    Attached Files

    #2
    Hello alright it,

    You can code this using some concepts from the reference sample below:
    MultiColored Plots

    Rising()
    Falling()

    Here are a couple concerns with your English description that if clarified may help get this coded:
    the line remains flat and the same colour
    From your description it looks like this indicator is calculated based on 3 values. The "flat" value here is never declared. What is it based from? What is the "same colour"?

    It plots a red line on the price which moves down to the high of the current bar plus ATR when CCI < 0 and rising. If CCI < 0 but rising, the line remains flat and the same colour.
    You want to do two different things when it meets the same condition. Can you clarify this point?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hello alright it,

      You can code this using some concepts from the reference sample below:
      MultiColored Plots

      Rising()
      Falling()

      Here are a couple concerns with your English description that if clarified may help get this coded:


      From your description it looks like this indicator is calculated based on 3 values. The "flat" value here is never declared. What is it based from? What is the "same colour"?



      You want to do two different things when it meets the same condition. Can you clarify this point?
      Hi Ryan. Thanks for replying. I see I made a typo on my previous description. Its should have been "It plots a red line on the price which moves down to the high of the current bar plus ATR when CCI < 0 and FALLING. If CCI < 0 but rising, the line remains flat and the same colour." Now to clarify more, when the 50 CCI is above 0 and rising, the value of the indi moves up and is green. When the 50 CCI is still above zero but falling, the indi shows the same value and remains green. Opposite for short: when the 50CCI is below 0 and falling the line becomes red. When the 50CCI is still below 0 but rising the line stays at the same value and also remains red. I hope this time I was more clear. I'm sorry but English is not my mother language. Will also have a look at your suggestion, hoping you will still take the time to code it for me. Thanks very much again.

      Comment


        #4
        Unfortunately we don't offer custom coding services. If you want this done professionally you can consider one of our NinjaScript consultants.


        There's tutorials available for learning to work with code:


        You can work with the strategy wizard. This is a point and click interface but you can view the code output. It's good for generating conditions.

        Regarding your specific query, it looks like you want to set a value based on 4 conditions. In two of the conditions you don't specify which value to use.


        if CCI > 0 and Rising
        Value = Low - ATR

        if CCI > 0 and Falling
        don't know the value here

        if CCI < 0 and falling
        Value = High + ATR

        if CCI < 0 and rising
        don't know the value here
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Sorry for misunderstanding and making a mess. The answer about the missing condition is in the quote. Thanks for your suggestion. I will try to work it out myself for now and if I can't I will follow your advice. I do want to learn
          Originally posted by NinjaTrader_RyanM View Post
          Unfortunately we don't offer custom coding services. If you want this done professionally you can consider one of our NinjaScript consultants.


          There's tutorials available for learning to work with code:


          You can work with the strategy wizard. This is a point and click interface but you can view the code output. It's good for generating conditions.

          Regarding your specific query, it looks like you want to set a value based on 4 conditions. In two of the conditions you don't specify which value to use.


          if CCI > 0 and Rising
          Value = Low - ATR

          if CCI > 0 and Falling
          don't know the value here THE VALUE AND COLOUR REMAINS THE SAME (FLAT)

          if CCI < 0 and falling
          Value = High + ATR

          if CCI < 0 and rising
          don't know the value here THE VALUE AND COLOUR REMAINS THE SAME (FLAT)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by yertle, Today, 08:38 AM
          6 responses
          24 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          24 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          46 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          23 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X