if(TimeHour(TimeCurrent()) < TimeHour(00:01) Should be: if(TimeHour(TimeCurrent()) < TimeHour(00:01))
ThomasB:
Still getting the error.
if(TimeHour(TimeCurrent()) < TimeHour(00:01) Should be: if(TimeHour(TimeCurrent()) < TimeHour(00:01))
//+------------------------------------------------------------------+ //| 34 Moving Scalper.mq4 | //| Copyright © 2007, Jacob Kucinic | //| Embstj@yahoo.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2007, Jacob Kucinic" #property link "Embstj@yahoo.com" int MyOrderType = 0; extern double Lots = 0.1; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double MAHigh, MAClose, MALow; double StopHigh, StopLow; int Total, MyOrderType, Ticket; if(Bars<100) { Print("bars less than 100"); return(0); } MAHigh = iMA(Symbol(),0,34,0,MODE_SMA,PRICE_HIGH,0); MAClose = iMA(Symbol(),0,34,0,MODE_SMA,PRICE_CLOSE,0); MALow = iMA(Symbol(),0,34,0,MODE_SMA,PRICE_LOW,0); //---- ObjectCreate("Fibonacci Low", OBJ_FIBO, 0, 0, MALow, 0, MAClose); ObjectCreate("Fibonacci High", OBJ_FIBO, 0, 0, MAHigh, 0, MAClose); ObjectSetFiboDescription("Fibonacci High", 7, "Fib7"); ObjectSetFiboDescription("Fibonacci Low", 7, "Fibo7"); ObjectSetFiboDescription("Fibonacci High", 1, "Fib1"); ObjectSetFiboDescription("Fibonacci High", 2, "Fib2"); ObjectSetFiboDescription("Fibonacci High", 3, "Fib3"); ObjectSetFiboDescription("Fibonacci High", 4, "Fib4"); ObjectSetFiboDescription("Fibonacci High", 5, "Fib5"); ObjectSetFiboDescription("Fibonacci High", 6, "Fib6"); ObjectSetFiboDescription("Fibonacci High", 8, "Fib8"); ObjectSet("Fib1", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib2", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib3", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib4", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib5", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib6", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fib8", OBJPROP_TIMEFRAMES, -1); ObjectSetFiboDescription("Fibonacci Low", 1, "Fibo1"); ObjectSetFiboDescription("Fibonacci Low", 2, "Fibo2"); ObjectSetFiboDescription("Fibonacci Low", 3, "Fibo3"); ObjectSetFiboDescription("Fibonacci Low", 4, "Fibo4"); ObjectSetFiboDescription("Fibonacci Low", 5, "Fibo5"); ObjectSetFiboDescription("Fibonacci Low", 6, "Fibo6"); ObjectSetFiboDescription("Fibonacci Low", 8, "Fibo8"); ObjectSet("Fibo1", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo2", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo3", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo4", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo5", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo6", OBJPROP_TIMEFRAMES, -1); ObjectSet("Fibo8", OBJPROP_TIMEFRAMES, -1); Total = OrdersTotal(); //------ if (TimeHour(TimeCurrent()) < TimeHour(00:01)) { MyOrderType = 1; } //------ if(MyOrderType == 1) { if(Total < 1) { MyOrderType = 2; } } //----- if(MyOrderType == 2) { if(Bid < MAHigh) { if(Bid > MALow) { MyOrderType =3; } } } //----- if(MyOrderType == 3) { if(Bid > MAHigh) { MyOrderType =4; } } //---Buy Order if(MyOrderType == 4) { Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,MAClose,ObjectGet("Fib7",OBJPROP_FIBOLEVELS),16384,0,Green); if(Ticket>0) { if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)) { Print("BUY order opened : ",OrderOpenPrice()); } } else Print("Error opening BUY order : ",GetLastError()); return(0); } //------Sell Check if(MyOrderType == 3) { if(Bid < MAClose) { MyOrderType=5; } } //------Sell Order if(MyOrderType == 5) { Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,MAClose,ObjectGet("Fibo7",OBJPROP_FIBOLEVELS),16385,0,Green); if(Ticket>0) { if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)) { Print("BUY order opened : ",OrderOpenPrice()); } } else Print("Error opening BUY order : ",GetLastError()); return(0); } //---- //---- return(0); } //+------------------------------------------------------------------+0 errors, 0 warnings
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
I have been writing a EA. I believe I've gotten everything needed. However, I keep getting a error code "Unbalanced Left Parenthesis." I can't find it. Maybe someone on here can find my error.