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

Strategy entry rule help

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

    Strategy entry rule help

    Hi everyone, I'm trying to figure out how to fix my entry rule for my strategy. I want my entry to be the first candle above the Ichimoku cloud. However, when I put it in strategy builder it is entering for every bullish candle above the cloud. I used if price close is above the cloud then enter long. How do I create the rule so that it's just the first candle? Thanks in advance for any help.

    #2
    Hello husky77,

    Thank you for your post.

    Could you provide screenshots of your current entry logic and also of the behavior you're seeing when enabling the strategy on a chart?
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Sure. Thank you for the response. Here's the snips:
      Attached Files

      Comment


        #4
        Hello husky77,

        Thank you for your reply.

        You'd want to add a Cross Above condition. Close price on the left, Cross Above in the center with a lookback period of 1, and the desired Ichimoku Cloud line on the right. Adding that condition will only allow an entry if the bar actually crossed that line, not only if the close price is greater than it.

        Here's a screenshot of that setup:

        Click image for larger version

Name:	2022-07-06_14-57-06.png
Views:	149
Size:	58.3 KB
ID:	1207669

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you again for the quick response. That seems to help a bit but there are still trades that are being taken that shouldn't and ones that should that are being missed that should line up with the rules of the strategy. Basically I want the first candle that closes above the cloud and 200 SMA to trigger a trade and vice versa short. Any ideas or suggestions would be greatly appreciated. Here's a snip of what I mean.
          Attached Files

          Comment


            #6
            Hello husky77,

            Thank you for your reply.

            In your original logic, you'd chosen the TenkanSen plot of the Ichimoku Cloud. The actual cloud is formed by coloring between the area between the SenkouSpanA and SenkouSpanB plots, displaced forward by the number of bars indicated by the Cloud Displacement setting.

            If you want to use the cloud itself, you'd need to account for that displacement, so you would need to check whether or not the close has crossed above or below one of those plots depending on the direction of entry, and for the Bars Ago for the indicator value, you would want to use the same number of bars that you are using for the Cloud Displacement setting for the indicator, like so:

            Click image for larger version

Name:	2022-07-07_11-14-23.png
Views:	153
Size:	101.8 KB
ID:	1207796

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Thank you Kate. Now I can't get the plots to show on my chart. That's ok. I think I'm getting the feel of how the logic works. I'll keep trying until I get it right. Thanks for your help.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by alifarahani, Today, 09:40 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by RookieTrader, Today, 09:37 AM
              4 responses
              17 views
              0 likes
              Last Post RookieTrader  
              Started by PaulMohn, Today, 12:36 PM
              0 responses
              2 views
              0 likes
              Last Post PaulMohn  
              Started by love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              38 views
              0 likes
              Last Post love2code2trade  
              Started by junkone, Today, 11:37 AM
              3 responses
              22 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X