Bill Williams and his strategies... - page 26

 
//+------------------------------------------------------------------+
//| Алигаторний.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern int jaw_period=13, teeth_period=8,jaw_shift=8,tteeth_period=5, teeth_shift=5,lips_period=3,lips_shift=3;
extern double volume=0.1, stoploss=20,takeprofit=50;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+

int start()
{
double blu,red,grin;
double Fractalu,Fractall;
int tiket;
//----
blu= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORJAW, 0) ;
red= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORTEETH, 0) ;
grin= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORLIPS, 0) ;
//----



Fractalu= iFractals( 0, 0, MODE_UPPER, 3) ;
Fractall=iFractals( 0, 0,MODE_LOWER, 3);



if (Fractalu>0&&Fractalu>blu&&Fractalu>red&&Fractalu>grin&&grin>red>blu&&OrdersTotal() <1)
{ tiket= OrderSend(Symbol(), OP_BUY, volume, Ask, Point*3, Bid- stoploss*Point, Ask+ takeprofit*Point, "Поза66", 1234567890, 0, Red);Alert("buy",GetLastError());
} 

if (Fractall>0&&Fractalu<blu&&Fractalu<red&&Fractalu<grin&&grin<red<blu&&OrdersTotal() <1) 
{ tiket= OrderSend(Symbol(), OP_SELL, volume, Bid, Point*3, Ask+ stoploss*Point, Bid- takeprofit*Point, "Поза66", 1234567890, 0, Blue);Alert("sell",GetLastError());
}




return(0);
}

At least it shows something. In iFractals on zero bar it is unlikely to work with fractals, and in OrderSend there are errors with Ask and Bid. Use Print("err "+GetLastError()) to check possible errors. And in general, why reinvent the wheel, if there is a ready Expert Advisor - Roman. 09.03.2011 16:56

 

Thank you very much! I will use Print("err "+GetLastError()) !

Why reinvent the wheel.

Well I'm learning mql4 as I go along, and I understand something better in the book, and I'll have a look at Roman's adviser.

 
Fractalu= iFractals( 0, 0, MODE_UPPER, 3) ;
Fractall=iFractals( 0, 0,MODE_LOWER, 3); When I put three at the end, the alarms with errors to the log started to fill, so the condition was met, that was the main brake! Error 4062!
 
Where the fuck does he need a stringer?
 
I don't know much about thongs, what they're for or how to use them...
 
Dimka-novitsek:
Where the fuck does he need a stringer?

Don't mock yourself and the branch - his thong is here on the page - in the EXPERTS.rar folder
 

he needed a string here - OrderSend(Symbol(), OP_BUY, volume, Ask, Point*3, Bid- stoploss*Point, Ask+ takeprofit*Point, "Pose66", 1234567890, 0, Red);Alert("buy",GetLastError());

The name of the symbol is the first parameter, you have 0.

 
Roman.:

Don't mock yourself and the thread - the string is here on the page - in the folder EXPERTS.rar

+1 Dimka-novitsek, let's think together how to improve.
 
ZZZEROXXX:

+1 Dimka-novitsek, let's think together how to improve.

I wrote in a private message.
 
ZZZEROXXX:

he needed a string here - OrderSend(Symbol(), OP_BUY, volume, Ask, Point*3, Bid- stoploss*Point, Ask+ takeprofit*Point, "Pose66", 1234567890, 0, Red);Alert("buy",GetLastError());

The name of the symbol is the first parameter, you have 0.


Thank you!!!

By the way, sorry, personal mail is not it?

I'll look at it, but what's there to improve, I wrote it in 20 minutes.

My brother's here, now he can play the game.