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 md4866, 05-01-2024, 08:15 PM
      2 responses
      18 views
      0 likes
      Last Post md4866
      by md4866
       
      Started by samish18, Today, 12:20 PM
      0 responses
      7 views
      0 likes
      Last Post samish18  
      Started by thread, 04-15-2024, 11:58 PM
      3 responses
      48 views
      0 likes
      Last Post Georg1o
      by Georg1o
       
      Started by leojimenezp, 04-20-2024, 05:49 PM
      4 responses
      50 views
      0 likes
      Last Post leojimenezp  
      Started by nicthe, Today, 09:24 AM
      1 response
      8 views
      0 likes
      Last Post nicthe
      by nicthe
       
      Working...
      X