MQL4 - automated forex trading   /  

Forum

I made a Code but it doesn't work. Any help me out?

Back to topics list To post a new topic, please log in or register

avatar
4
dubbelD 2010.02.09 21:08 

It's the first time ever I wrote a Code lol, I failed big time. It doesn't even start. It's supposed to only open long for now.


I tried to do some kind of Fibonacci MM in it.... Oh I feel like such a noob now haaha at least I try tho


//+------------------------------------------------------------------+

//| TIMO.mq4 |

//| Copyright © 2010, MetaQuotes Software Corp. |

//| http://www.metaquotes.net |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2010, MetaQuotes Software Corp."

#property link "http://www.metaquotes.net"





if(iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, 0, 14, 26, 9, PRICE_CLOSE, MODE_MAIN, 1))

if (OPENTRADE=0)

{

if (LossesInARow=0)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}

{

if (LossesInARow=1)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}

{

if (LossesInARow=2)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.2,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}

{

if (LossesInARow=3)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.3,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}

{

if (LossesInARow=4)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.5,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}

{

if (LossesInARow=5)

}

{

ticket=OrderSend(Symbol(),OP_BUY,0.8,Ask,3,Ask-15*Point,Ask+15*Point,"Test",0,0,Green);;

OPENTRADE=1;

TP=Ask+15*Point;

SL=Ask-15*Point;

}


if Point=SL

{

LossesInARow=+1

WinsInARow=0

OPENTRADE=0

SL=0

TP=0

}


if Point=TP

{

LossesInARow=-1

WinsInARow=+1

OPENTRADE=0

TP=0

SL=0

}


if WinsInARow=2

{

LossesInARow=0

}

article

Theoretical Basis of Building Cluster Indicators for FOREX

Cluster indicators are sets of indicators that divide currency pairs into separate currencies. Indicators allow to trace the relative currency fluctuation, determine the potential of formating new currency trends, receive trade signals and follow medium-term and long-term positons.


avatar
182
n8937g 2010.02.09 21:26 

For starters you have not defined any variables...and your syntax and use of functions are not good. No Init nor Start.... Think your logic through on paper first too...You have a long way to go.


avatar
364
Ruptor 2010.02.09 21:30 

I would suggest you copy the sample MACD code and alter it for your entry condiitions. At least you would have something you know works to start with and if it don't work after you modify it you will know where to look for the fault.



avatar
1193
cloudbreaker 2010.02.10 01:45 
Back to topics list  

To add comments, please log in or register