Orders Execution
0
Views
0
Downloads
0
Favorites
WoodyPipper
//+------------------------------------------------------------------+
//| 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);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---