Hey need help with a Simple code for EA

 
Hey guys i'm new to coding and I was not able to find this anywhere. Anyways I need a code for EA that places a buy when/if price moves 50 pips up and sell when/if price move 50 pips down , also make it changeable in expert properties. Make it work for pairs that have 1 digit dec place , 2 digit , 3 digit 4 digit and 5 digit . Basically make it be able to trade forex commodities stocks and indexes. Also with a trailing stop , that has trail start , step and stop in expert properties. Hard for me but easy for you gurus out there :) I'd appreciate it!!
 
Hi you can find someone over here.
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
Hi everyone, I really like to use ADX for trading and I am very confortable with this Indicator. I am currently using the PZ ADX Trader EA but I would like to add few more options as MA for the trend and ATR trailing stop to close position. Spécification is ready to be sent. If the EA really fit the requirements, I would be happy to order the...
 
Marco vd Heijden:
Hi you can find someone over here.

I paid someone to do this same thing exact and the bot was **** I shouldve know better before paying but its okay. I know a little code now , all I need is help with this part to create the rest of EA myself :)

 
Is there a time window for these 50 pips to trigger, I really wanna help you but my brain is melting from coding for like 12 hours straight
 
Colin Lundrigan:
Is there a time window for these 50 pips to trigger, I really wanna help you but my brain is melting from coding for like 12 hours straight
Yes between 2:00-22:00 GMT . please make it adjustable too thanks !!
 
Chevon Ormsby:

I paid someone to do this same thing exact and the bot was **** I shouldve know better before paying but its okay. I know a little code now , all I need is help with this part to create the rest of EA myself :)

Post your code using the code button(Alt+S) and explain what section(s) you are asking for  help with.

 
Keith Watford:

Post your code using the code button(Alt+S) and explain what section(s) you are asking for  help with.

<Deleted>

 
Chevon Ormsby:

<Deleted>

Keith Watford:

Post your code using the code button(Alt+S) and explain what section(s) you are asking for  help with.

.

 
Keith Watford:

.

/+------------------------------------------------------------------+
  
   extern double lots;
        extern double Trail_start;
        extern double Trail_step;
        extern double Trail_stop;
  

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  
  
  
  
//---
    double level1 = Ask+50*Digits ;
    double level2 = Bid-50*Digits ;

    if
    ( level1 )
                  {
   OrderSend(Symbol(),OP_BUYSTOP,0.01,Ask,3,0,0,"BUY",0,0,Green);
                  }
                  
    if
    ( level2 )
                  {
   OrderSend(Symbol(),OP_SELLSTOP,0.01,Bid,3,0,0,"SELL",0,0,Red);
                  }

//---   
  }
//+------------------------------------------------------------------+
 
Chevon Ormsby:

Ok basically I want the bot to place a buy each time price moves 50 points up and a sell each time price moves 50 points/pips down. For example , price is at 1.10100 if price drop to 1.10150 open sell and if price rise 1.10150 open buy . I trade every instrument forex stocks comm and index. in forex you usually have pairs wth 5-3 digits. in indexes you have pairs with 2 and 1 digits. I want the bot to be able to trade all of these instruments. so make it able to trade pairs with 3 digits such as usd/jpy , us30 which has 1 digit . Make the bot tradeable with 1,2,3,4,and 5 digit(/decimal places) pairs. Lastly , I know how to code the trailing stop to the external properties window bt it is not working . Im guessing there has to be a code as well in the On Tick () section. I want the trailing stop to have trial start step and stop. THnaks

 
    double level1 = Ask+50*Digits ;
    double level2 = Bid-50*Digits ;

Think about what the result of these will be.

if
    ( level1 )

level1 is not a bool.


If you want to trade non-forex, consider using Points instead of Pips.

In future please post in the correct section

I will move this topic to the MQL4 and Metatrader 4 section.

Reason: