- What is this error !! TestGenerator: unmatched data error
- Error with Tester
- TestGenerator: unmatched data error
RaptorUK, i need help.
RaptorUK, i need help.
why this doesnt open any trades.....
no error on coding, but still didnt open trades...
//+------------------------------------------------------------------+ //| test 1.mq4 | //| Copyright 2012, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright 2012, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" //---- input parameters extern int Slippage = 1; extern int TicketLongOrder = 111; extern int TicketShortOrder = 222; extern double EquityPercent = 2; extern int TotalOrder = 5; // Global variables int BuyTicket; int SellTicket; double UsePoint; int UseSlippage ; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { Comment("Account Information ", "\nACCOUNT INFORMATION ", "\nAccount Balance: ", AccountBalance(), "\nAccount Equity: ", AccountEquity(), "\nAccount FreeMargin: ", AccountFreeMargin(), "\nAccount Leverage: ", AccountLeverage(), "\nAccount Margin: ", AccountMargin(), "\nAccount Profit: ", AccountProfit(), "\nTrade Order: ", OrderComment(), "\nAccount OrderLots: ", OrderLots(), "\nAccount OrderOpenPrice: ", OrderOpenPrice(), "\nAccount OrderOpenTime: ", OrderOpenTime(), "\nAccount OrderOpenTime: ", OrderOpenTime(), "\nAccount OrdersTotal: ", OrdersTotal(), "\nAccount OrderSymbol: ", OrderSymbol(), "\nAccount OrderTakeProfit: ", OrderTakeProfit(), "\nAccount OrderType: ", OrderType() ); return(0) ; //special function start requires and integer value return to the main metatrader program. } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double istochastic01 = iStochastic(NULL, PERIOD_H4, 5, 3, 3, MODE_EMA, 0, MODE_MAIN, 0); double istochastic02 = iStochastic(NULL, PERIOD_H4, 5, 3, 3, MODE_EMA, 0, MODE_SIGNAL, 1); double istochastic03 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_EMA, 0, MODE_MAIN, 0); double istochastic04 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_EMA, 0, MODE_SIGNAL, 1); double istochastic05 = iStochastic(NULL, PERIOD_M15, 5, 3, 3, MODE_EMA, 0, MODE_MAIN, 0); double istochastic06 = iStochastic(NULL, PERIOD_M15, 5, 3, 3, MODE_EMA, 0, MODE_SIGNAL, 1); double istochastic07 = iStochastic(NULL, PERIOD_M5, 5, 3, 3, MODE_EMA, 0, MODE_MAIN, 0); double istochastic08 = iStochastic(NULL, PERIOD_M5, 5, 3, 3, MODE_EMA, 0, MODE_SIGNAL, 1); double LotSize, StopLoss, TakeProfit; string lsComm; LotSize = AccountEquity()*(EquityPercent / 10000); for (int i=5; i<OrdersTotal(); i++) { //---- if (AccountFreeMargin() < AccountBalance()*10/100) { return(0); if ( (istochastic01 <= istochastic02) && (istochastic03 <= istochastic04) && (istochastic05 <= istochastic06) ) { OrderSend(Symbol(),OP_SELL,LotSize,Bid,Slippage,StopLoss,TakeProfit,NULL,0,0); return(0); } if ( (istochastic01 >= istochastic02) && (istochastic03 >= istochastic04) && (istochastic05 >= istochastic06) ) { OrderSend(Symbol(),OP_BUY,LotSize,Ask,Slippage,StopLoss,TakeProfit,NULL,0,0); return(0); } if ( (istochastic07 <= istochastic08) ) { // close sell trades OrderClose(TicketShortOrder,LotSize,(),Slippage,()); return(0); } if ( (istochastic07 >= istochastic08) ) { // close long trades OrderClose(TicketLongOrder,LotSize,(),Slippage,()); return(0); } } return(0); } return (0); } //+------------------------------------------------------------------+
why this doesnt open any trades.....
If you really want to write code you need to learn . . . what is the point people helping if you aren't going to learn when you are helped ?
Where is the closing brace } ? what is he point of it being where it is ?
if (AccountFreeMargin() < AccountBalance()*10/100) { return(0);
understand why I am asking and figure out your answer . . . and then give your answer. You ask a question, I give an answer . . . you could return the same courtesy ;-)
If you really want to write code you need to learn . . . what is the point people helping if you aren't going to learn when you are helped ?
Where is the closing brace } ? what is he point of it being where it is ?
understand why I am asking and figure out your answer . . . and then give your answer. You ask a question, I give an answer . . . you could return the same courtesy ;-)
thanks, RaptorUK
i just start to reading Andrew R.Young EA Programming book.
so i will learn until i did something perfect ea.
thanks, RaptorUK
i just start to reading Andrew R.Young EA Programming book.
so i will learn until i did something perfect ea.
And your answer is . . . ?
im learning....
since my head got operation before, so my learning is abit slow..
im learning....
since my head got operation before, so my learning is abit slow..

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use