EA opening continuous trades.

 

Hello everyone. I am building an EA based on RSI. I have followed a YouTube video on how to do it, and I did it exactly as the video, but I'm still getting errors. I will share the line of code, can anyone possible tell me what I'm doing wrong?

Thanks in advance.

 

If you are following a video course, then maybe you should ask the author for help or support.

If you require help here, then please provide all relevant source code, not a screenshot, and explain your issue in detail. Also provide the error log and identify the lines with the errors.

Also, a standard message ...

  • Usually people who can't code don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.


 
Fernando Carreiro #:

If you are following a video course, then maybe you should ask the author for help or support.

If you require help here, then please provide all relevant source code, not a screenshot, and explain your issue in detail. Also provide the error log and identify the lines with the errors.

Also, a standard message ...

  • Usually people who can't code don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.


I've already asked, but the video is a tad bit old. thanks for the response.

#include <trade/trade.mqh>

CTrade Activate;
int rsiHandle;
ulong IDneutral;

int OnInit(){
   int rsiHandle = iRSI(_Symbol,PERIOD_H1,39,0);
     
   return 0;
  }

void OnDeinit(const int reason){
   
  }

void OnTick(){

   double rsi[];
   CopyBuffer(rsiHandle,0,1,1,rsi);
   
   if(rsi[0] > 70){
   
      }if(IDneutral <= 0){
         Activate.Sell(0.01,_Symbol);
         IDneutral = Activate.ResultOrder();
      }
      

 
   
      else if(rsi[0] < 30){
      
         if(IDneutral <= 0){
            Activate.Buy(0.01,_Symbol);
            IDneutral = Activate.ResultOrder();
            }

   }
   
  }
 
I am trying to build an EA that takes trades based on those parameters. I get all the way to there, and I run the EA, but it takes continuous trades non stop. Wanted to see if someone sees what I'm doing wrong.