Ask! - page 141

 
arshadFX:
please post the rules i am not high skilled programmer i am learner of MQL4 i will try to make an EA

ok thanks.

Rules for this EA:

EA must enter 2 orders when TD indicator gives signals, and the 2 orders will be managed with stop, profit and trailing stop.

I need the following inputs:

Starting hour

Ending hour

stop

trailing

profit

slippage

MM

risk

Magic number

 

..........

 

Double Orders Issue

Quick question to everyone,

I have searched the site for posts on double order issues and I'm not getting an answer to this issue:

Every so often I get a double order placed (the same order twice) by my EA. Since not every order is duplicated, I am assuming it is a communications issue with the server. Does anyone know of any code out there that can help reduce or eliminate this issue?

Thanks

 

HI kiromano

It seems like that when you reconnect with sever your EA opens position again without checking existing position ........ this artical may help to solve your problem.

Order Accounting - Creation of a Normal Program - MQL4 Tutorial

 

Thanks ArshadFX

Great article Arshad..

Thanks for the reply. Looks like I have some homework to do. I will let you know how it goes...

 

Can someone help please with this

I have an EA and I want to access 2 lines from an indicator within the EA the lines in the indicator are.

expression 1

if(iMA(NULL,0,Period(),1,MODE_SMA,PRICE_HIGH,i) > zigzag1 && iMA(NULL,0,Period(),1,MODE_SMA,PRICE_HIGH,i) != 0 && iMA(NULL,0,Period(),1,MODE_SMA,PRICE_HIGH,i) != EMPTY_VALUE) ExtMapBuffer2=iMA(NULL,0,Period(),1,MODE_SMA,PRICE_HIGH,i); else ExtMapBuffer2 = 0.0;;

expression 2

if(iMA(NULL,0,Period(),1,MODE_SMA,PRICE_LOW,i) < zigzag1 && iMA(NULL,0,Period(),1,MODE_SMA,PRICE_LOW,i) != 0 && iMA(NULL,0,Period(),1,MODE_SMA,PRICE_LOW,i) != EMPTY_VALUE) ExtMapBuffer1=iMA(NULL,0,Period(),1,MODE_SMA,PRICE_LOW,i); else ExtMapBuffer1 = 0.0;

I want to say in the EA

when expression 1 is true Buy & close sell if open

when expression 2 is true sell & close Buy if open

How can I do this?

 
increase:
How can I do this?
increase:
How can I do this?

Is it something like

double Buy1_1 = iCustom(NULL, 0, "Trend", 96, Current + 0);

double Buy1_2 = 0;

double Sell1_1 = iCustom(NULL, 0, "Trend", 97, Current + 0);

double Sell1_2 = 0;

double CloseBuy1_1 = iCustom(NULL, 0, "Trend", 96, Current + 0);

double CloseBuy1_2 = 0;

double CloseSell1_1 = iCustom(NULL, 0, "Trend", 97, Current + 0);

double CloseSell1_2 = 0;

 

Problem in NormalizeDouble

I need 5 digit after decimal from price quote, it will display when using DoubleToStr function. I want to store a vlue get from object and use it for further calcullation i.e "price2"

could anyone please help me to solve this problem

Files:
objget.mq4  2 kb
 

??

moved to another thread.

 

Help with my EA please

Please can you help me with my EA? It is based on the Inside Bar strategy, and, while it is very profitable in backtesting from June 08 this is a completely random phenomenon as it is not following the program whatsoever. The trade entry logic is based on this post here Between 40-100 pips per Day. But, instead, it places a new trade any old where as soon as the old one is closed and ignores the trading requirements. I'm sure my problem is really simple but my skills are not great.

I think that the problem is with these lines of code here:

if(Open[3]>Close[3] && High[2]=Low[3] && Open[2] High[2] || ask-2*Point> High[1])

{

Candle="Long";

}

if(Open[3]<Close[3] && High[2]=Low[3] && Open[2]>Close[2] && bid+2*Point < Low[2] || bid+2*Point < Low[1])

{

Candle="Short";

}

Please can somebody help as I have invested hours trying to fix this and am running out of ideas!

Thanks in advance

Files: