Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RSI and MACD strategy help

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

    RSI and MACD strategy help

    Hi,

    Sorry if this has been posted before but I have been searching for 2 weeks and cannot find anything that exactly answers what I am after.

    I am trying to build a strategy that will trade after a setup of more than one indicator. I would progressively like to add indicators to the setup to try and minimize false setups.

    Basically I am trying to build a custom strategy that will trade on the following conditions;

    If
    RSI has been below 30
    and then
    Price > EMA
    then BUY

    Do I need to look back a certain number of bars? Can I limit this to only trade if this setup has occurred within a certain number of bars?

    Thanks
    JC

    #2
    Hello JC,

    Thank you for your post.

    You can use the following code to loop through the last 12 bars for the RSI below 30 and then enter if price is below the EMA:
    Code:
    // loop through the last 12 bars to find the RSI below 30
    			for(int i = 12; i > 0; i--)
    			{
    				if(RSI(12, 1)[i] < 30)
    				{
    					if(Close[0] > EMA(12)[0])
    					{
    						EnterLong();
    						break;
    					}
    				}
    			}

    Comment


      #3
      Thank you Patrick,

      I'll give it a go. It's only the first block so I'll more than likely be back in touch

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      6 responses
      32 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X