Coding help - page 457

 

Is it possible to modify equity indicator to add a moving average on equity (see picture) and eventually add an alert for crosses.

Thanks so much

equity_v7.mq4

Files:
equity_v7.mq4  27 kb
equity.jpg  36 kb
 
lambic:
Is it possible to modify equity indicator to add a moving average on equity (see picture) and eventually add an alert for crosses.

Thanks so much

equity_v7.mq4

lambic

Try it out (average added) : equity_v7.01.mq4

Set the EquityAveragePeriod to > 0 to see the average of the equity

Files:
 

Could you do me an indicator which highlights:

up bars that close on their high, and have a lower wick at least half as long as the body.

Down bars that close on their low, and have an upper wick at least half as long as the body.

(so if the wick is 4 times as long as the body that's fine. Half as long as the body is the minimum though)

Ideally with a sound alert that I can turn on/off.

I don't know what's available in terms of 'highlighting' the bar. I don't want an eye-sore. Maybe a way to highlight the outside of the bar somehow so that it slightly stands out?

thanks

 

Hello, my dear peoples. Who can add alert (sound and popup) for this indicator?

Many thanks.bs_living_now_ver_t1.mq4

Files:
 
Files:
 

It creates signals on past bars (it reminds a bit of super signal). Maybe better not to use it in signaling / alerting mode, but much better for estimation

 

Hello guys can someone explane me how this system works?

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

//| Developed by Forex TSD - forex forum |

//| Idea from John Taylor v.2.0 |

//| |

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

#include

#define MySuperMagic 111020051110

//----

extern int StartHour=8;

extern int EndHour =20;

extern double Lots =0.1;

//----

double LastBarChecked;

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

//| |

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

int init()

{

//----

LastBarChecked=Time[0];

//----

return(0);

}

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

//| expert deinitialization function |

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

int deinit()

{

return(0);

}

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

//| expert start function |

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

int start()

{

string cm="Volume ";

if (Period()==1) cm=cm + "1M";

if (Period()==5) cm=cm + "5M";

if (Period()==15) cm=cm + "15M";

if (Period()==30) cm=cm + "30M";

if (Period()==60) cm=cm + "1H";

if (Period()==240) cm=cm + "4H";

if (Period()==1440) cm=cm + "1D";

if (Period()==10080) cm=cm + "1W";

if (Period()==43200) cm=cm + "1M";

cm=cm + " - ";

cm=cm + TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS);

int EAMagic=MySuperMagic + Period();

//------------------------------------------------------------------------------------------------

bool doShort=false;

bool doLong =false;

bool hourValid=(Hour()>=StartHour) && (Hour()<=EndHour);

if((Volume[1] < Volume[2]) && hourValid)

{

doLong=true;

Comment("Up trend");

}

if((Volume[1] > Volume[2]) && hourValid)

{

doShort=true;

Comment("Down trend");

}

if(Volume[1]==Volume[2] )

{

Comment("No trend...");

}

if(LastBarChecked!=Time[0])

{

int cnt=0;

while(cnt<OrdersTotal())

{

if(OrderSelect (cnt, SELECT_BY_POS)==false) continue;

if(OrderSymbol()==Symbol() && OrderMagicNumber()==EAMagic)

{

int ticket=OrderTicket();

double oLots=OrderLots();

double priceClose;

if (OrderType()==OP_BUY)

{

priceClose=Bid;

if(doLong)

{

LastBarChecked=Time[0];

return(0);

}

}

else

{

priceClose=Ask;

if(doShort)

{

LastBarChecked=Time[0];

return(0);

}

}

if(!OrderClose(ticket,oLots,priceClose,7,Red))

{

Alert("Error closing trade: " + ErrorDescription(GetLastError()));

return(0);

}

}

else

{

cnt ++;

}

}

if (hourValid)

{

if(Volume[1] < Volume[2])

{

OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,cm,EAMagic,0,White);

}

if(Volume[1] > Volume[2] )

{

OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,cm,EAMagic,0,Red);

}

}

LastBarChecked=Time[0];

}

return(0);

}

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

 
AchiJameson:
Hello guys can someone explane me how this system works?

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

//| Developed by Forex TSD - forex forum |

//| Idea from John Taylor v.2.0 |

//| |

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

#include

#define MySuperMagic 111020051110

//----

extern int StartHour=8;

extern int EndHour =20;

extern double Lots =0.1;

//----

double LastBarChecked;

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

//| |

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

int init()

{

//----

LastBarChecked=Time[0];

//----

return(0);

}

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

//| expert deinitialization function |

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

int deinit()

{

return(0);

}

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

//| expert start function |

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

int start()

{

string cm="Volume ";

if (Period()==1) cm=cm + "1M";

if (Period()==5) cm=cm + "5M";

if (Period()==15) cm=cm + "15M";

if (Period()==30) cm=cm + "30M";

if (Period()==60) cm=cm + "1H";

if (Period()==240) cm=cm + "4H";

if (Period()==1440) cm=cm + "1D";

if (Period()==10080) cm=cm + "1W";

if (Period()==43200) cm=cm + "1M";

cm=cm + " - ";

cm=cm + TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS);

int EAMagic=MySuperMagic + Period();

//------------------------------------------------------------------------------------------------

bool doShort=false;

bool doLong =false;

bool hourValid=(Hour()>=StartHour) && (Hour()<=EndHour);

if((Volume[1] < Volume[2]) && hourValid)

{

doLong=true;

Comment("Up trend");

}

if((Volume[1] > Volume[2]) && hourValid)

{

doShort=true;

Comment("Down trend");

}

if(Volume[1]==Volume[2] )

{

Comment("No trend...");

}

if(LastBarChecked!=Time[0])

{

int cnt=0;

while(cnt<OrdersTotal())

{

if(OrderSelect (cnt, SELECT_BY_POS)==false) continue;

if(OrderSymbol()==Symbol() && OrderMagicNumber()==EAMagic)

{

int ticket=OrderTicket();

double oLots=OrderLots();

double priceClose;

if (OrderType()==OP_BUY)

{

priceClose=Bid;

if(doLong)

{

LastBarChecked=Time[0];

return(0);

}

}

else

{

priceClose=Ask;

if(doShort)

{

LastBarChecked=Time[0];

return(0);

}

}

if(!OrderClose(ticket,oLots,priceClose,7,Red))

{

Alert("Error closing trade: " + ErrorDescription(GetLastError()));

return(0);

}

}

else

{

cnt ++;

}

}

if (hourValid)

{

if(Volume[1] < Volume[2])

{

OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,cm,EAMagic,0,White);

}

if(Volume[1] > Volume[2] )

{

OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,cm,EAMagic,0,Red);

}

}

LastBarChecked=Time[0];

}

return(0);

}

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

Roughly : it opens a buy if it is between 8am and 8 pm and idf the previous volume is greater then the volume bforre it. In vice versa

 

How can volume be traded as a direction in metatrader?

Those are ticks. That is completely random trading EA

 
mladen:
Roughly : it opens a buy if it is between 8am and 8 pm and idf the previous volume is greater then the volume bforre it. In vice versa

Ok thank u very much... is that difficult to add ma filter and a non profit trailingstop?

i know all people ask you for help its sometimes irritating pls help just when u have the time and if u want..

Thanks in Advance Achi

Reason: