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

How to filter unnecessary macd cross?

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

    How to filter unnecessary macd cross?

    Dear Team,

    I'm using jurbolbbmacd https://ninjatraderecosystem.com/use.../jurbolbbmacd/ as an important indicator.
    One issue bothers me is that,while the trend is obviously up,and the market is obviously bullish,the jurbolddmacd still will cross below is uper line or lower line,as you can check in the image,this will cause wrong short.

    Actually I used supertrend as main indicator before,but the issue is that once the market is not very bullish,supertrend will cause a lot of wrong long.

    Any idea that how I can filter the unnecessary macd crosses?

    Thank you very much!
    Attached Files

    #2
    Hello williamzz,

    Thanks for your post.

    In order to filter signals, you will need to be able to logically define what a specific signal is that should be filtered. After you have logically defined it, code must then be written based off of that logic to filter out the signal.

    For example, you could check other market conditions that tell you if the market is bullish or bearish and if those conditions are true, and you do want to filter signals, you could then ignore the signal by also checking if the other conditions are allowing this signal.

    If you are new to NinjaScript, I recommend using the Strategy Builder to generate syntax based off of logical conditions. From the Builder, you could also set bools for your other conditions. For example, if Close[0] > Open[0], then you can set a "bullish" bool to true and then you could check if "bullish" is true and your cross has occurred, and the signals will be filtered so they only occur when your bools are true and the cross is seen.

    I have included some Strategy Builder resources below.

    Strategy Builder 301 - https://www.youtube.com/watch?v=_KQF2Sv27oE

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

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

    Please let us know if we can be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Williamzz,

      how did you go with this.. i might be able to help you. the attached is the condition when the MACD is above the 0 lines it will only take longs and when below take shorts. there is also another way of doing this which is using a moving average to filter is the same way. which is attached also.

      see how you go mate

      regards

      Simon Thompson
      Click image for larger version

Name:	2019-10-12_165700.png
Views:	205
Size:	159.9 KB
ID:	1074186Click image for larger version

Name:	2019-10-12_170126.png
Views:	183
Size:	158.9 KB
ID:	1074187

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by terkk, Today, 01:16 PM
      3 responses
      21 views
      0 likes
      Last Post Zigfried  
      Started by TraderElegante, Today, 12:14 PM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by dgee949, Today, 11:44 AM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_JustinD  
      Started by NinjaTrader_Kate, Today, 12:01 PM
      0 responses
      20 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by efeuvejota01, Today, 11:42 AM
      4 responses
      37 views
      0 likes
      Last Post efeuvejota01  
      Working...
      X