I'm new at coding but I'm trying to learn. After a few hours still can't figure what I'm doing wrong, my brain won't work it out. Can you help please?
I'm trying to only place buy orders if the price is above EMA200 and only place sell if below EMA200... with some WPR in there too.
The thought being if price is above EMA on D1 and H1, then current chart which EA is attached will determine WRP entry points.
Many thanks!
Code: Select all
sig_high=iWPR(NULL,0,TrigWPR,1);
sig_low=iWPR(NULL,0,TrigWPR,1);
sig_iMA1=iMA(PERIOD_D1,0,200,0,MODE_EMA,PRICE_MEDIAN,0);
sig_iMA2=iMA(PERIOD_H1,0,200,0,MODE_EMA,PRICE_MEDIAN,0);
if (sig_iMA1>Close[1] && sig_iMA2>Close[1] /*&& sig_buy<TrigBuyStoch*/ && sig_high<TrigBuyWPR) {
BuyValue=1;
}
if (sig_iMA1<Close[1] && sig_iMA2<Close[1] /*&& sig_sell>TrigSellStoch*/ && sig_low>TrigSellWPR) {
SellValue=1;
}
