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

Looking for a coding example of an Ichimoku based strategy.

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

    Looking for a coding example of an Ichimoku based strategy.

    Hello All,

    My first post on this forum.

    I've been a user of eSignal for years and recently opened a demo acct on NT8 and could not be more impressed with the product.

    Are there any sample coding strategies using the Ichimoku indicators that someone would be kind enough to share?

    Thank you.

    [email protected]
    Last edited by demarcog; 08-27-2020, 12:59 PM.

    #2
    Welcome to the forums demarcog!

    I have converted an IchimokuCloud indicator which can be found publicly on our User App Share.

    This indicator can be used with NinjaScript strategies. I have included a link for this indicator below and have also attached a couple example strategies that demonstrate how you can design strategy logic with this indicator.

    Ichimoku Cloud - https://ninjatraderecosystem.com/use...indicator-nt8/

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    I have also included some general information on NinjaScript strategies to get you acquainted as well.

    NinjaScript Strategy general information

    Simple NinjaScript strategies can be built using the Strategy Builder and more complex and robust strategies can be written by hand.

    Please see the Strategy Builder 301 and NinjaScript Editor 401 courses to get acquainted with NinjaScript strategies. These videos are publicly available.

    Strategy Builder 301 — https://www.youtube.com/watch?v=HCyt90GAs9k

    NinjaScript Editor 401 — https://www.youtube.com/watch?v=BA0W4ECyVdc

    The Managed Approach documentation explains how Strategy Builder and Managed NinjaScript strategies can be written.

    Managed Approach — https://ninjatrader.com/support/help...d_approach.htm

    NinjaScript strategies are then deployed against one account. The strategy processes historical data to identify past trade signals and to develop the strategy position. This is separate from the Account's Position. The calculated orders from historical data and the strategy position are then used by the Start Behavior to configure how the strategy should handle this position when the strategy is first enabled.

    WaitUntilFlat waits until the calculated position is closed so the strategy only starts trading when it sees itself in a flat position.

    ImmediatelySubmit will allow the strategy to submit historically calculated orders immediately when the strategy is enabled. This would be used when we know where the strategy position is when we enable the strategy, and is used particularly for re-enabling strategies so they can resume positions and orders.

    Sync Account is additional option that has the strategy submit an additional order to sync the strategy position to the account position. This should not be confused with syncing the strategy position to the account position.

    It is important to understand the Start Behaviors and their relation to the Strategy and Account Position. Please see below for more details.

    Strategy vs. Account Position — https://ninjatrader.com/support/help..._account_p.htm

    Start Behaviors — https://ninjatrader.com/support/help..._positions.htm

    When writing more robust strategies in the NinjaScript Editor, please refer to our Educational materials and Reference Samples.

    Educational Materials — https://ninjatrader.com/support/help..._resources.htm

    Reference Samples — https://ninjatrader.com/support/help...ce_samples.htm

    Please let us know if you have any additional questions.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Jim,

      Thank you very much for the very helpful response I appreciate and look forward to reading the material.

      glen

      Comment


        #4
        That Version of the Ichimoku Cloud is nicely done with the addition of adjust the chart margins to view the most right side of the cloud plots. And it has a cloud displacement which is helpful as well. I had my coder create displacement a few years ago in our products

        Comment


          #5
          Hi DTSSTS,

          Thank you for the response, I missed the notification sorry about the delay.

          I appreciate the help as I'm totally new to C# and looked at both strategies posted above. It's unclear to me that these are strategies as i did not see any functions to buy/sell and most of the components of Ichimoku are not defined in either of these. So I don't know the difference between a Strategy and Indicator. In eSignal they were essentially the same except a Strategy invoked buy and sell functions. After literally decades of struggling with the highly problematic eSignal who just as an example their Autotrading capability is "not supported" and has been in "beta" for over seven years! I can' tell you after a week I couldn't be more impressed with every aspect of NT and how lucky you all are, as I've wasted years learning the hard way..

          The indicator IichimokuCloud does have all the components such as as Tenkan, Kijun, Chikou etc. I could use that as a starting point for converting it to a strategy but need to come up to speed on Strategy Building.

          TThe rules are not complicated at all and I have it written in javascript and they strategy back tests very well but autrading is not supported by eSignal. I implemented the classic signals such as the Tenkan Kijun cross which can be filtered by whether the Chikou is above or below the cloud or the last close. In addition I would need to put in my preference for stop placement which after much backtesting i prefer as either the Tenkan of Kijun, depending on how strongly the market is moving.

          I was hoping someone would share a Ichimoku based strategy that I could modify but will attempt to run the strategy builder with the indicator IchimokuCloud Indicateor.

          Thanks again for your help.

          [email protected]

          Comment


            #6
            Hello demarcog,

            The examples I attached demonstrate how logic can be designed for IchimokuCloud, they are not intended to be fully working strategies.

            I suggest reviewing the Strategy Builder 301 tutorial and then to reference our Conditions and Actions examples to get more familiar with how you can make additional logical checks and strategy actions.

            Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

            Actions examples — https://ninjatrader.com/support/help...us/actions.htm

            After reviewing that detail and creating simple test strategies, you can reference the examples I attached to create entry conditions based on the IchimokuCloud indicator.

            In the LaggingSpan condition example we check the following:

            Code:
            if ((IchimokuCloud1.ChikouSpan[27] <= IchimokuCloud1.SenkouSpanA[27])
            && (IchimokuCloud1.ChikouSpan[26] > IchimokuCloud1.SenkouSpanA[26]))
            This checks if the ChikouSpan value from 27 bars ago is at or below the SenkouSpanA value from 27 bars ago and then checks if the value from 26 bars ago is above. This creates a crossover condition keeping in mind that cloud is projected 26 bars into the future.

            When designing logic, we recommend using prints to check your logic and to also see how the strategy is reading certain values so you can create new logical conditions.

            Using Prints in the Strategy Builder - https://drive.google.com/file/d/1mTq...w?usp=drivesdk

            We look forward to assisting.
            JimNinjaTrader Customer Service

            Comment


              #7
              Jim,

              Thank you very much I appreciate the help, learning a new platform can be a little intimidating.

              hat is helpful I also wanted to add a signal for a Tenkan/Kinjun cross but only when the Chikou is above the current close.

              The logic of an indicator like Chikou which is the close 26 bars ago compared to the current close is little confusing as indicators aren't usually displaced in time Visually it appears that the Chikou is above or blow the current close but it is displace 26 bars on the screen.

              The last part is to add stops which as you mentioned the videos are very helpful.

              Thanks again for the help and pointing me in the right direction I appreciate it and have my work cut out for me.

              Glen

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by inanazsocial, Today, 01:15 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by rocketman7, Today, 02:12 AM
              0 responses
              5 views
              0 likes
              Last Post rocketman7  
              Started by dustydbayer, Today, 01:59 AM
              0 responses
              1 view
              0 likes
              Last Post dustydbayer  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              5 responses
              22 views
              0 likes
              Last Post trilliantrader  
              Started by Davidtowleii, Today, 12:15 AM
              0 responses
              3 views
              0 likes
              Last Post Davidtowleii  
              Working...
              X