//+------------------------------------------------------------------+ //| WoodyPipper.mq4 | //| @2009 Desynced Tech | //| http://desynced.no-ip.org/fx | //+------------------------------------------------------------------+ #property copyright "@2009 Desynced Tech" #property link "http://desynced.no-ip.org/fx" datetime lastOrder = 0; int ticket; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double s1 = iCustom(NULL, 0, "sonic_stoik",0,0); double s2 = iCustom(NULL, 0, "sonic_stoik",1,0); double s3 = iCustom(NULL, 0, "sonic_stoik",2,0); double s4 = iCustom(NULL, 0, "sonic_stoik",3,0); if ( s1 != 0 ) Print ( s1 , " " , s2 , " " , s3 , " " , s4 , " " ); return(0); double y1 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",0,0); double y2 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",1,0); double y3 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",2,0); double y4 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",3,0); double y5 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",5,0); double y6 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",5,1); double y7 = iCustom(NULL, 0, "cci_woodies_lnx_v1_1",5,2); /* Comment("value laguerre " , y1 , " ", y2, " " , y3, " " , y4 , " " , y5); string valores = ""; bool found = false; int safe =0; int unsafe = 0; for(int i=0;i<10;i++) { double x0 = iCustom(NULL, 0, "laguerre",0,i); double x1 = iCustom(NULL, 0, "laguerre",0,i-1); if ( x0 > 0.15 && x1 < 0.15 ) { found = true; continue; } if ( found ) { if ( x0 < 0.15 ) safe++; else unsafe++; continue; } // valores = StringConcatenate( valores , " , " , laguerre ) ; } //if ( found ) Print( safe , " " , unsafe ); // if ( found && iCustom(NULL, 0, "laguerre",0,0) <0.16 && iCustom(NULL, 0, "laguerre",0,0)> 0.15 && OrdersTotal() == 0 && (TimeCurrent() - lastOrder ) > (60*60*3 ) ) { */ if ( y6 < 0 && y5 > 0 && y1 != 0 && OrdersTotal() == 0 && (TimeCurrent() - lastOrder ) > (60*60*3 ) ) { Print( "buy " , y7 , " " , y6 , " ", y5 , " " , y1 ); ticket = OrderSend(Symbol(),OP_BUY, 0.1, Ask, 3, 0, Ask+65*Point,"", 1977, 0, Red); lastOrder = TimeCurrent(); } else if ( y6 > 0 && y5 < 0 && OrdersTotal() == 0 && (TimeCurrent() - lastOrder ) > (60*60*3 )) { Print( "sell " , y7 , " " , y6 , " ", y5 , " " , y1 ); ticket = OrderSend(Symbol(),OP_SELL, 0.1, Bid, 3, 0, Bid-65*Point,"", 1977, 0, Red); if ( ticket > 0 ) { lastOrder = TimeCurrent(); } } /* for(int i=0;i<10;i++) { double x0 = iCustom(NULL, 0, "laguerre",0,i); double x1 = iCustom(NULL, 0, "laguerre",0,i-1); if ( x0 < 0.15 && x1 < 0.15 ) { found = true; continue; } if ( found ) { if ( x0 < 0.15 ) safe++; else unsafe++; continue; } // valores = StringConcatenate( valores , " , " , laguerre ) ; } */ return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Laguerre
Sonic_StoIK
cci_woodies_lnx_v1_1
Order Management characteristics:
Checks for the total of open orders
It automatically opens orders when conditions are reached
Other Features: