TEND1= iADX(NULL,PERIOD_M15,14,PRICE_CLOSE, MODE_PLUSDI,1); TEND2= iADX(NULL,PERIOD_M15,14,PRICE_CLOSE, MODE_PLUSDI,2);
trader201: What is wrong |
|

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
What is wrong in that code? How it is done correctly?
when I do the testing, using "Print (" error ", GetLastError ());" it say "error 4054". But when I give opening that message, the txt says "Error 131".
I'm doing this:
void OnTick()
{
double TEND1, TEND2;
TEND1= iADX(NULL,14,PERIOD_M15,PRICE_CLOSE, MODE_PLUSDI,1);
TEND2= iADX(NULL,14,PERIOD_M15,PRICE_CLOSE, MODE_PLUSDI,2);
//---
if (OrdersTotal()==0 && TEND1>TEND2)
{
int ticket=OrderSend(Symbol(),OP_BUY,0.01, Ask, 10, Ask-500*Point, Ask+500*Point, NULL, 0, 0, clrNONE);
}
Print("error", GetLastError());
}