Hello dear friends;
If I ask, can a friend write an ea for this indicator at mt5?
If I know I'm writing it, but I do not understand the code.
Re: Simple Expert Advisors (EA's) for MT4
32hi guys,
if there EA or indicator samples like my trend magic please share here
got headache already
thanks
if there EA or indicator samples like my trend magic please share here
got headache already
thanks
Re: Simple Expert Advisors (EA's) for MT4
33Hi ZacakaZacaka wrote:hi guys,
if there EA or indicator samples like my trend magic please share here
got headache already
thanks
As per my poor knowledge trend magic is same to old super trend (cci-atr),use some newest super trend indicator there are so many versions with a lot of options ad flexibility and form your EA or search for some already made ea based on super trend but experts can better guide you.
Indicator is just a tool.
Use it only if it can benefit you. Leave it if you don't know how to use it optimally.
Use it only if it can benefit you. Leave it if you don't know how to use it optimally.
Re: Simple Expert Advisors (EA's) for MT4
34Hi Mntiwana,
thanks... ill try to find sample again....
but super trend indicator is different even their base use cci and atr.
ill look n check again...
btw, if experts here can guide me more better
u r expert too mntiwana
thx again
thanks... ill try to find sample again....
but super trend indicator is different even their base use cci and atr.
ill look n check again...
btw, if experts here can guide me more better
u r expert too mntiwana
thx again
Re: Simple Expert Advisors (EA's) for MT4
35Hi all...
I found RSI Divergence indicator and I would like to use it...
But how to call the arrow buffer? when arrow up and down? coz the arrow not in main chart
1 ea not finished want to try something else lol
at least I tried guys
Thanks
I found RSI Divergence indicator and I would like to use it...
But how to call the arrow buffer? when arrow up and down? coz the arrow not in main chart
1 ea not finished want to try something else lol
at least I tried guys

Thanks
Re: Simple Expert Advisors (EA's) for MT4
36Hi guys,
any example ea for averaging and close partial lots?
but the simple one.... coz I got a few but with a lot of code
u know that im not a good programmer lol
or help me to add averaging system in above ea "simple stepEA"
thanks
any example ea for averaging and close partial lots?
but the simple one.... coz I got a few but with a lot of code
u know that im not a good programmer lol
or help me to add averaging system in above ea "simple stepEA"
thanks
Re: Simple Expert Advisors (EA's) for MT4
37Use calls to buffers 0 and 1 for thatZacaka wrote:Hi all...
I found RSI Divergence indicator and I would like to use it...
But how to call the arrow buffer? when arrow up and down? coz the arrow not in main chart
1 ea not finished want to try something else lol
at least I tried guys
Thanks
Re: Simple Expert Advisors (EA's) for MT4
38Thanks Mladen... Ive already got that from you, mastermladen wrote:Use calls to buffers 0 and 1 for that
Code: Select all
void GoMartingale()
{
int iCount = 0;
double LastOP = 0;
double LastLots = 0;
bool LastIsBuy = FALSE;
int iTotalBuy = 0;
int iTotalSell = 0;
int Spread=0;
Spread= MarketInfo(Symbol(), MODE_SPREAD);
for(iCount=0;iCount<OrdersTotal();iCount++)
{
OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
if(LastOP==0) {LastOP=OrderOpenPrice();}
if(LastOP>OrderOpenPrice()) {LastOP=OrderOpenPrice();}
if(LastLots<OrderLots()) {LastLots=OrderLots();}
LastIsBuy=TRUE;
iTotalBuy++;
if(iTotalBuy==MaxTrade) {return(0);}
}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
if(LastOP==0) {LastOP=OrderOpenPrice();}
if(LastOP<OrderOpenPrice()) {LastOP=OrderOpenPrice();}
if(LastLots<OrderLots()) {LastLots=OrderLots();}
LastIsBuy=FALSE;
iTotalSell++;
if(iTotalBuy==MaxTrade) {return(0);}
}
}
if(LastIsBuy)
{
if(Bid<=LastOP-(Spread*SetPoint)-(PipStep*SetPoint))
{
OrderSend(Symbol(), OP_BUY, Multiply*LastLots, Ask, Slippage, 0, Ask+TakeProfit*SetPoint, EAComment, EAMagicNumber);
ModifyTP();
LastIsBuy=FALSE;
return(0);
}
}
else if(!LastIsBuy)
{
if(Ask>=LastOP+(Spread*SetPoint)+(PipStep*SetPoint))
{
OrderSend(Symbol(), OP_SELL, Multiply*LastLots, Bid, Slippage, 0, Bid-TakeProfit*SetPoint, EAComment, EAMagicNumber);
ModifyTP();
return(0);
}
}
}
void ModifyTP()
{
int iCount=0;
double NewTP=0;
for(iCount=0;iCount<OrdersTotal();iCount++)
{
OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
if(NewTP==0) {NewTP=OrderTakeProfit();}
if(NewTP>OrderTakeProfit()) {NewTP=OrderTakeProfit();}
}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
if(NewTP==0) {NewTP=OrderTakeProfit();}
if(NewTP<OrderTakeProfit()) {NewTP=OrderTakeProfit();}
}
}
for(iCount=0;iCount<OrdersTotal();iCount++)
{
OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
OrderModify(OrderTicket(), OrderLots(), 0, NewTP, 0);
}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber)
{
OrderModify(OrderTicket(), OrderLots(), 0, NewTP, 0);
}
}
}
btw, if open hedging... can the new open position make a new magicnumber after hedging or must be close the ea and re-start ea so they will create with new magicnumber?
Thanks
Re: Simple Expert Advisors (EA's) for MT4
39With martingale in general you close all the orders with the same magic number and then start a new set with whatever magic number - it can be the same. No need for a new magic numberZacaka wrote:
Thanks Mladen... Ive already got that from you, master
Can u help me to add stoploss for that script? If I want only 2 level martingale, then if hit the stoploss it will be all close (same magic number) or open hedging with same lot...Code: Select all
void GoMartingale() { int iCount = 0; double LastOP = 0; double LastLots = 0; bool LastIsBuy = FALSE; int iTotalBuy = 0; int iTotalSell = 0; int Spread=0; Spread= MarketInfo(Symbol(), MODE_SPREAD); for(iCount=0;iCount<OrdersTotal();iCount++) { OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { if(LastOP==0) {LastOP=OrderOpenPrice();} if(LastOP>OrderOpenPrice()) {LastOP=OrderOpenPrice();} if(LastLots<OrderLots()) {LastLots=OrderLots();} LastIsBuy=TRUE; iTotalBuy++; if(iTotalBuy==MaxTrade) {return(0);} } if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { if(LastOP==0) {LastOP=OrderOpenPrice();} if(LastOP<OrderOpenPrice()) {LastOP=OrderOpenPrice();} if(LastLots<OrderLots()) {LastLots=OrderLots();} LastIsBuy=FALSE; iTotalSell++; if(iTotalBuy==MaxTrade) {return(0);} } } if(LastIsBuy) { if(Bid<=LastOP-(Spread*SetPoint)-(PipStep*SetPoint)) { OrderSend(Symbol(), OP_BUY, Multiply*LastLots, Ask, Slippage, 0, Ask+TakeProfit*SetPoint, EAComment, EAMagicNumber); ModifyTP(); LastIsBuy=FALSE; return(0); } } else if(!LastIsBuy) { if(Ask>=LastOP+(Spread*SetPoint)+(PipStep*SetPoint)) { OrderSend(Symbol(), OP_SELL, Multiply*LastLots, Bid, Slippage, 0, Bid-TakeProfit*SetPoint, EAComment, EAMagicNumber); ModifyTP(); return(0); } } } void ModifyTP() { int iCount=0; double NewTP=0; for(iCount=0;iCount<OrdersTotal();iCount++) { OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { if(NewTP==0) {NewTP=OrderTakeProfit();} if(NewTP>OrderTakeProfit()) {NewTP=OrderTakeProfit();} } if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { if(NewTP==0) {NewTP=OrderTakeProfit();} if(NewTP<OrderTakeProfit()) {NewTP=OrderTakeProfit();} } } for(iCount=0;iCount<OrdersTotal();iCount++) { OrderSelect(iCount,SELECT_BY_POS,MODE_TRADES); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { OrderModify(OrderTicket(), OrderLots(), 0, NewTP, 0); } if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderComment()==EAComment && OrderMagicNumber()==EAMagicNumber) { OrderModify(OrderTicket(), OrderLots(), 0, NewTP, 0); } } }
btw, if open hedging... can the new open position make a new magicnumber after hedging or must be close the ea and re-start ea so they will create with new magicnumber?
Thanks
- These users thanked the author mladen for the post:
- ChuChu Rocket
Re: Simple Expert Advisors (EA's) for MT4
40ok.. thx..mladen wrote:With martingale in general you close all the orders with the same magic number and then start a new set with whatever magic number - it can be the same. No need for a new magic number
This what I got this few weeks, open position with averaging
Last target to add stop loss and partial close the position when profit...
If u have time can u help me
tq tq tq