MQL4 Learning - page 81

 

help stopping ea

I have an ea which is running

then takes profit and closes all open and pending orders

what I need is a way to stop the ea from continuing after it takes the profit.

In otherwords I want to stop the ea when it's job is done.

Is there a code for this?

I appreciate your help if possible

Thank You

 

bool jobdone = False

int start()

{

if (jobdone) return(0);

//----

//rest of EA code

//just set jobdone=True when you're finished

//----

return(0);

}

 

Thank You

Thank You I appreciate the help.

 

Need Help with a last bar & current bar display

Hello

New to the forum.

I have looked everywhere on this and another large FOREX forum for a mq4 file that has last bar and current bar displayed . What I need is a display in the upper corner Also it needs to be used in Day and intraday time frames .

To jazz it up Add - currency pair -spread- clock with alert.. Font enlargment , color etc

Why do I need it. I like to look at prices that are easy to glace at in this type of layout. Thanks for any help with this display.

that reads :

LAST CURRENT

(last High price ) (current High Price )

(last bar close price) ( current quote price)

(last Low price ) (current Low price)

 

Sorry display would look like

-------LAST ----------------------------------CURRENT

--(last High price ) ------------------------------(current High Price )

--(last bar close price) ------------------------( current quote price)

--(last Low price ) -------------------------------(current Low price)

 

need help with this indicator..........................

if you move this post atleast put it in a place where someone can help......

New to the forum.

I have looked everywhere on this and another large FOREX forum for a mq4 file that has last bar and current bar displayed . What I need is a display in the upper corner Also it needs to be used in Day and intraday time frames .

To jazz it up Add - currency pair -spread- clock with alert.. Font enlargment , color etc

Why do I need it. I like to look at prices that are easy to glace at in this type of layout. Thanks for any help with this display.

that reads :

LAST........................................................ CURRENT

(last High price ) .................................(current High Price )

(last bar close price) .........................( current quote price)

(last Low price )................................ (current Low price)

 

Close greater than 3 prev high indicator

Hi - Could anyone design me a C>H past 3 bars (long) and C<L past 3 bars (short). Appear as a pivot dot over the relevant bar. Many thanks.

 
laidback1:
Hi - Could anyone design me a C>H past 3 bars (long) and C<L past 3 bars (short). Appear as a pivot dot over the relevant bar. Many thanks.

Please what time frame and pair do you use this system for?

Thanks

 

Wrong parameters count error

int init(){}

int deinit(){}

int BarsCount=0;

bool openlong()

{//Write open LONG TRADE conditions here.

}

bool openshort()

{//Write open SHORT TRADE conditions here.

}

bool closelong()

{//Write close LONG TRADE conditions here.

}

bool closeshort()

{//Write close SHORT TRADE conditions here.

}

bool xopenlong()

{// Actual order execution here for OPEN LONG TRADE.

}

bool xopenshort()

{//Actual order execution here for OPEN SHORT TRADE.

}

bool xcloselong()

{//Actual order execution for CLOSE LONG TRADE.

}

bool xcloseshort()

{//Actual order execution for CLOSE SHORT TRADE.

}

int start()

{

if (Bars > BarsCount)

{

BarsCount=Bars;

{//All indicators go in here...

}

if (openlong(true)) xopenlong();

if (openshort(true)) xopenshort();

if (closelong(true)) xcloselong();

if (closeshort(true)) xcloseshort();

}

}

Can anyone please point out the error ? It says wrong parameters count error.

Files:
capture_11.png  19 kb
 

You don't have parameters in functions, so replace

if (openlong(true)) xopenlong();

if (openshort(true)) xopenshort();

if (closelong(true)) xcloselong();

if (closeshort(true)) xcloseshort();[/CODE]

to

[CODE]if (openlong()) xopenlong();

if (openshort()) xopenshort();

if (closelong()) xcloselong();

if (closeshort()) xcloseshort();
Reason: