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 Christopher_R, Today, 12:29 AM
      0 responses
      6 views
      0 likes
      Last Post Christopher_R  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      166 responses
      2,235 views
      0 likes
      Last Post sidlercom80  
      Started by thread, Yesterday, 11:58 PM
      0 responses
      3 views
      0 likes
      Last Post thread
      by thread
       
      Started by jclose, Yesterday, 09:37 PM
      0 responses
      7 views
      0 likes
      Last Post jclose
      by jclose
       
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      10 responses
      1,415 views
      0 likes
      Last Post Traderontheroad  
      Working...
      X