Download MetaTrader 5

Been Looking for Expert Advisor That Open Buy/Sell at Price Close Over or below MA

To add comments, please log in or register
Mohammad Rizal Bin Rahmat
426
Mohammad Rizal Bin Rahmat  
Hi,

I've tried hard enough to find a basic Expert Advisor base on this conditions. If anyone have any, can i have it thank you. Thank you. I have this code from my custom indicator. Anyone have any similar will do. as i'm still learning to code my own, i will try to amend it here and there. Thank you. (hope what i did isn't wrong)

OPEN BUY
Open<MA
Low<MA
High>MA
Close>MA

(iOpen(_Symbol,_Period,0)<iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,0) && iOpen(_Symbol,_Period,0))<iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,0) && iOpen(_Symbol,_Period,0)<iMA(_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE,0) &&
         iHigh(_Symbol,_Period,0)>iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,0) && iHigh(_Symbol,_Period,0)>iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,0) && iHigh(_Symbol,_Period,0)>iMA(_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE,0) &&
         iLow(_Symbol,_Period,0)<iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,0) && iLow(_Symbol,_Period,0)<iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,0) && iLow(_Symbol,_Period,0)<iMA(_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE,0) &&
         iClose(_Symbol,_Period,0)>iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,0) && iClose(_Symbol,_Period,0)>iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,0) && iClose(_Symbol,_Period,0)>iMA(_Symbol,_Period,20,0,MODE_SMA,PRICE_CLOSE,0))


BUY TAKE PROFIT
PRICE>=Upper Bollinger Band

(iBands(NULL,NULL,20,2.0,0,PRICE_CLOSE,MODE_UPPER,0)<=Bid) 



BUY STOP LOSS
Low<MA
Close<MA

   ((iLow(_Symbol,_Period,1)<iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_LOW,1) && iLow(_Symbol,_Period,1)<iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_LOW,1) &&
         iClose(_Symbol,_Period,1)<iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_LOW,1) && iClose(_Symbol,_Period,1)<iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_LOW,1)) 



OPEN SELL
Open>MA
High>MA
Low<MA
Close<MA

(iOpen(pair[k],Trend_Timeframe[j],1)<MA5High && iOpen(pair[k],Trend_Timeframe[j],1)<MA10High && iOpen(pair[k],Trend_Timeframe[j],1)<MA20 &&
         iHigh(pair[k],Trend_Timeframe[j],1)>MA5High && iHigh(pair[k],Trend_Timeframe[j],1)>MA10High && iHigh(pair[k],Trend_Timeframe[j],1)>MA20 &&
         iLow(pair[k],Trend_Timeframe[j],1)<MA5High && iLow(pair[k],Trend_Timeframe[j],1)<MA10High && iLow(pair[k],Trend_Timeframe[j],1)<MA20 &&
         iClose(pair[k],Trend_Timeframe[j],1)>MA5High && iClose(pair[k],Trend_Timeframe[j],1)>MA10High && iClose(pair[k],Trend_Timeframe[j],1)>MA20)


SELL TAKE PROFIT
PRICE<=Lowe Bollinger Band

     (iBands(NULL,NULL,20,2.0,0,PRICE_CLOSE,MODE_LOWER,0)>=Ask) 


SELL STOP LOSS
High>MA
Close>MA

     (iHigh(_Symbol,_Period,1)>iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,1) && iHigh(_Symbol,_Period,1)>iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,1) &&
         iClose(_Symbol,_Period,1)>iMA(_Symbol,_Period,5,0,MODE_LWMA,PRICE_HIGH,1) && iClose(_Symbol,_Period,1)>iMA(_Symbol,_Period,10,0,MODE_LWMA,PRICE_HIGH,1))
To add comments, please log in or register