Ask! - page 27

 

Need help to fix exit on simple MA EA...

I have an EA I did quickly using a template I have found on the net. It seems to work fine executing the BUY/SELL entries. However, it is not executing the exit code. Would someone please check it out and make the necessary corrections?

It is a simple MA cross using a fast EMA3 and couple EMAs serving as upper and lower bands. BUY is when EMA3 cross up and above the upper EMA band and exit when it cross down and below the upper EMA band. SELL is when EMA3 cross down and below the lower EMA band and exit when it cross up and above the lower band.

I would appreciate any help.

solaris

Files:
 

two last numbers of a price

Please, help me.

How to write the next code: two last numbers of the close price of the current bar = 00 or 50?

 

Something similar to

if(MathMod(num1,100) == 0 || MathMod(num1,50) == 0)

I have not tested it, but it should send you in the right direction.

 
iscuba11:
I created this, but have a problem. I have 2 trades active - 1 sell on EURUSD, and 1 sell on USDCHF. The below coding will modify the first sell trade EURUSD, but will not modify the second sell trade USDCHF. I know something is wrong and lacking in the coding. Would you eyeball it and tell me what I did wrong or what is omitted in the below coding. This is very important to me! Thanks much in advance!

Dave,

Try changing your code to following snippet and let me know if that did the trick.

Yannis

int i=0;

for (int cnt=OrdersTotal()-1;cnt>=0;cnt--)

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if (OrderType()>=OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber () == MagicNumber || MagicNumber==0))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Ask+(15 *Point),Bid-(20*Point),Cyan); //Modify stop loss and take profit

return(0);

}

if (OrderType()>=OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber () == MagicNumber || MagicNumber==0))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(15*Point),Ask+(20*Point),Cyan); //Modify stop loss and take profit

return(0);

}

return(0);

}

}

 

Try these links for MT4 instruction (I wish there was more):

https://www.mql5.com/en/forum/general

http://www.metatrader.info/tracker

 

time and a variable

How to write a code for the open price variable for the bar at 7 o'clock?

What to write at the shift position if we don't know the number of bars from

the current bar?

Var = iOpen(NULL, 0,shift)

 
adria:
How to write a code for the open price variable for the bar at 7 o'clock?

What to write at the shift position if we don't know the number of bars from

the current bar?

Var = iOpen(NULL, 0,shift)

U can allways use iBarShift() function to check it.

 

E-mail and SMS Alerts

I am not a programmer... let me say that up front.

How would I program an e-mail alert into an indicator... e-mail to a web based service, specifically yahoo mail?

Also, and even better then the e-mail alert, how would I get an indicator to send an SMS alert when the alert condidtions are met?

Thanks for your assistance

Wayne

 

Anything wrong with these codes? I modified them, then the EA won't make any trades in strategy tester.

if(StochasticGreen>StochasticRed )

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-(LossStop*Point),Ask+(ProfitStop*Point),"kosta",16384,0,Green);

}

// check for short position (SELL) possibility && (TriggerLines1>TriggerLines0)

if(StochasticGreen<StochasticRed )

{

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+(LossStop*Point),Bid-(ProfitStop*Point),"kosta",16384,0,Red);

}

 

Hi,

I need a small modification of 3colorMACD.

That is a signal produced when 3 Signal line values are the same and split the Signal line according to histogram color (red or blue).

Will be grateful for help with the code.

euro

Files:
Reason: