double mcd1 = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,1 ); double mcdL= iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,LowestCandle); double mcdH = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,HighestCandle);
The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.
William Roeder:
The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.
William Roeder:
The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.
what i should doing then.. i wana to get the MACD value of lowest price and highest price.. plz help
William Roeder:
Pass the indexes of the lowest/highest candles.
how i can do that??
can u writed for me
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
void OnTick() { double HighestCandle=High[iHighest(NULL,0,MODE_HIGH,144,9)]; double LowestCandle =Low[iLowest(NULL,0,MODE_LOW,144,9)]; double mcd1 = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,1 ); double mcdL= iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,LowestCandle); double mcdH = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,HighestCandle); if(mcd1<mcdL && Open[1]> LowestCandle && Close[1] < LowestCandle ) Comment("SELL"); else if(mcd1>mcdH &&Open[1]< HighestCandle && Close[1]> HighestCandle ) Comment ("BUY"); }can some one tell me where is the probleme here
why it sdont work ??