Multi 10:4 Trader EA

Post Reply
Geges
Trader
Posts: 60
Joined: Thu Dec 15, 2011 5:33 pm

Re: Multi 10:4 Trader EA

Post by Geges »

I have v2.01a running on four brokers.

Cowboy IBFX-US
ILQ-US
FINFX
PELLUCID

All four have similiar pending and open positions. The only difference is the risk/lot.

The attached FINFX just closed a basket of 4 trades. Most of the open positions are GREEN! :mrgreen:

Thank You Mr. Long

Geges
You do not have the required permissions to view the files attached to this post.
bshoe24
Trader
Posts: 84
Joined: Sat Feb 11, 2012 5:53 pm

Re: Multi 10:4 Trader EA

Post by bshoe24 »

Yes i have the zero divide too. I've seen it on Cowboy IBFX and Globalprime though UniversalFX doesn't give me the error. UniversalFX seems to be the 1 of 3 i have tested that won't give it to me after multiple restarts and two different configurations (default and all trailing off w/ MPTM). I've verified i loaded plenty of history with the scripts in the forum. I also am seeing dramatically more cpu usage in this version. I was actually able to have 16 separate demo tests at once on the same machine before (display off) while now i can only run 2. Something for sure changed for the worse as far as cpu consumption. Thanks Mr Long for your efforts regardless.
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

I noticed that the buttons are all created regardless of whether showDisplay is true or false, and in the start() function there are a bunch of guiIsClicked() calls, again not checking showDisplay.

I enclosed all the areas with guiAdd() in them in the init() function within if (showDisplay) {... } and the same with the guiIsClicked() calls in the start() function, and CPU usage is once more low when showDisplay is set to false. Hence its reasonable to assume that the mt4gui library is causing the extra processing.
bshoe24
Trader
Posts: 84
Joined: Sat Feb 11, 2012 5:53 pm

Re: Multi 10:4 Trader EA

Post by bshoe24 »

Cool Slipshod. It would be great to have those changes find themselves into the next version. I prefer to have all the fancy display stuff 100% off to maximize my computer resources for all the testing i do.
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

slipshod wrote:I noticed that the buttons are all created regardless of whether showDisplay is true or false, and in the start() function there are a bunch of guiIsClicked() calls, again not checking showDisplay.

I enclosed all the areas with guiAdd() in them in the init() function within if (showDisplay) {... } and the same with the guiIsClicked() calls in the start() function, and CPU usage is once more low when showDisplay is set to false. Hence its reasonable to assume that the mt4gui library is causing the extra processing.
Hi slipshod,

Can you send me your changes.

Thanks
Andy
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

No problem Andy. In init() around line 450:-

Code: Select all

        if (showDisplay)
        {
        	btnRefresh       = guiAdd(hwnd, "button", 715, footerY2+80, 155, 20, "Grid Refresh");
        	btnCloseAll      = guiAdd(hwnd, "button", 890, footerY2+80, 155, 20, "Close All Open Trades");
        	btnPendingDelete = guiAdd(hwnd, "button", 1065, footerY2+80, 155, 20, "Delete Pending");
        }
then around line 600:-

Code: Select all

        if (showDisplay)
        {
        	guiSetBgColor(hwnd, btnRefresh, btnColor);
        	guiSetTextColor(hwnd, btnRefresh, btnTextColor);
        	guiSetText(hwnd, btnRefresh, "Refresh Grid", 14, "Arial");

        	guiSetBgColor(hwnd, btnCloseAll, btnColor);
        	guiSetTextColor(hwnd, btnCloseAll, btnTextColor);
        	guiSetText(hwnd, btnCloseAll, "Close All Open", 14, "Arial");

        	guiSetBgColor(hwnd, btnPendingDelete, btnColor);
        	guiSetTextColor(hwnd, btnPendingDelete, btnTextColor);
        	guiSetText(hwnd, btnPendingDelete, "Delete Pending", 14, "Arial");


        	for (k = 0; (k < BUTTON_MAX) && (k < ArraySize(Pairs)); k++) {
        		buttonOpenChart[k] = guiAdd(hwnd, "button", kOffsetX, kOffsetY, 30, 15, "Chart");
        		guiSetBgColor(hwnd, buttonOpenChart[k], btnColor);
        		guiSetTextColor(hwnd, buttonOpenChart[k], btnTextColor);
        		guiSetText(hwnd, buttonOpenChart[k], "Chart", 10, "Arial");

        		buttonCloseTrade[k] = guiAdd(hwnd, "button", 1113, kOffsetY, 30, 15, "Close");
        		guiSetBgColor(hwnd, buttonCloseTrade[k], btnColor);
        		guiSetTextColor(hwnd, buttonCloseTrade[k], btnTextColor);
        		guiSetText(hwnd, buttonCloseTrade[k], "Close", 10, "Arial");

        		kOffsetY += 18;

        	}
        }
The beginning of the start function:-

Code: Select all

        if (showDisplay)
        {
        	if (guiIsClicked(hwnd, btnRefresh)) {
        		refreshGrid();
        	}

        	if (guiIsClicked(hwnd, btnCloseAll)) {
        		if (MessageBox("Do you really want to Close ALL TRADES?    ",
        		               "Close All", MB_YESNO | MB_ICONQUESTION) != IDYES)
        			return(1);
        		CloseAll(maxSlippage(), MagicNumber);
        	}

        	if (guiIsClicked(hwnd, btnPendingDelete)) {
        		if (MessageBox("Do you really want to Delete All Pending?    ",
        		               "Delete All", MB_YESNO | MB_ICONQUESTION) != IDYES)
        			return(1);
        		canTrade = false;
        		DeletePendingTrades();
        		canTrade = true;
        	}
        
        	for (k = 0; k < BUTTON_MAX; k++) {
        		if (guiIsClicked(hwnd, buttonOpenChart[k]))
        			ChartWindow(Pairs[k], PERIOD_H4);
        	}

        	for (k = 0; k < BUTTON_MAX; k++) {
        		if(RunningTrades(Pairs[k]) ==0)
        			guiEnable( hwnd, buttonCloseTrade[k],false);
        		if (guiIsClicked(hwnd, buttonCloseTrade[k])) {
        			if (MessageBox(Pairs[k]+", Close this trade?    ",
			               "Close Trade", MB_YESNO | MB_ICONQUESTION) != IDYES)
				return(1);
		        	CloseTrades(Pairs[k], maxSlippage(), MagicNumber);
		        }

	        }

		UpdateGrid();
        }
And lastly...

Code: Select all

void refreshGrid() {
	if (  showDisplay ) {
                //CreateGrid();
		UpdateGrid();
	}
}
Apologies for the formatting - the forum doesn't seem to like tab-indented code :\
fahedksa
Trader
Posts: 274
Joined: Fri Jun 08, 2012 10:20 am
Location: Jordan & Egypt

Re: Multi 10:4 Trader EA

Post by fahedksa »

Today when i load latest version 2.1a Empty4 keep crashing and close.specally when i change time frame
CJ Thread ( PDF & Charts )
https://goo.gl/PXbfKC
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

fahedksa wrote:Today when i load latest version 2.1a Empty4 keep crashing and close.specally when i change time frame

Have you installed the latest dll file?
fahedksa
Trader
Posts: 274
Joined: Fri Jun 08, 2012 10:20 am
Location: Jordan & Egypt

Re: Multi 10:4 Trader EA

Post by fahedksa »

MrLong wrote:
fahedksa wrote:Today when i load latest version 2.1a Empty4 keep crashing and close.specally when i change time frame

Have you installed the latest dll file?
Hi Mr.Long
Fistful i am big fan for yours EA .
Yes as posted in page 1 , My broker FXDD ,Meta update 482 ,Windows server 2008.
When i used v2 it was ok but now after i copy the new files and DLL its keep crash even if return using V2.
Any ideas?
CJ Thread ( PDF & Charts )
https://goo.gl/PXbfKC
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

slipshod wrote:No problem Andy. In init() around line 450:-

Code: Select all

        if (showDisplay)
        {
        	btnRefresh       = guiAdd(hwnd, "button", 715, footerY2+80, 155, 20, "Grid Refresh");
        	btnCloseAll      = guiAdd(hwnd, "button", 890, footerY2+80, 155, 20, "Close All Open Trades");
        	btnPendingDelete = guiAdd(hwnd, "button", 1065, footerY2+80, 155, 20, "Delete Pending");
        }
then around line 600:-

Code: Select all

        if (showDisplay)
        {
        	guiSetBgColor(hwnd, btnRefresh, btnColor);
        	guiSetTextColor(hwnd, btnRefresh, btnTextColor);
        	guiSetText(hwnd, btnRefresh, "Refresh Grid", 14, "Arial");

        	guiSetBgColor(hwnd, btnCloseAll, btnColor);
        	guiSetTextColor(hwnd, btnCloseAll, btnTextColor);
        	guiSetText(hwnd, btnCloseAll, "Close All Open", 14, "Arial");

        	guiSetBgColor(hwnd, btnPendingDelete, btnColor);
        	guiSetTextColor(hwnd, btnPendingDelete, btnTextColor);
        	guiSetText(hwnd, btnPendingDelete, "Delete Pending", 14, "Arial");


        	for (k = 0; (k < BUTTON_MAX) && (k < ArraySize(Pairs)); k++) {
        		buttonOpenChart[k] = guiAdd(hwnd, "button", kOffsetX, kOffsetY, 30, 15, "Chart");
        		guiSetBgColor(hwnd, buttonOpenChart[k], btnColor);
        		guiSetTextColor(hwnd, buttonOpenChart[k], btnTextColor);
        		guiSetText(hwnd, buttonOpenChart[k], "Chart", 10, "Arial");

        		buttonCloseTrade[k] = guiAdd(hwnd, "button", 1113, kOffsetY, 30, 15, "Close");
        		guiSetBgColor(hwnd, buttonCloseTrade[k], btnColor);
        		guiSetTextColor(hwnd, buttonCloseTrade[k], btnTextColor);
        		guiSetText(hwnd, buttonCloseTrade[k], "Close", 10, "Arial");

        		kOffsetY += 18;

        	}
        }
The beginning of the start function:-

Code: Select all

        if (showDisplay)
        {
        	if (guiIsClicked(hwnd, btnRefresh)) {
        		refreshGrid();
        	}

        	if (guiIsClicked(hwnd, btnCloseAll)) {
        		if (MessageBox("Do you really want to Close ALL TRADES?    ",
        		               "Close All", MB_YESNO | MB_ICONQUESTION) != IDYES)
        			return(1);
        		CloseAll(maxSlippage(), MagicNumber);
        	}

        	if (guiIsClicked(hwnd, btnPendingDelete)) {
        		if (MessageBox("Do you really want to Delete All Pending?    ",
        		               "Delete All", MB_YESNO | MB_ICONQUESTION) != IDYES)
        			return(1);
        		canTrade = false;
        		DeletePendingTrades();
        		canTrade = true;
        	}
        
        	for (k = 0; k < BUTTON_MAX; k++) {
        		if (guiIsClicked(hwnd, buttonOpenChart[k]))
        			ChartWindow(Pairs[k], PERIOD_H4);
        	}

        	for (k = 0; k < BUTTON_MAX; k++) {
        		if(RunningTrades(Pairs[k]) ==0)
        			guiEnable( hwnd, buttonCloseTrade[k],false);
        		if (guiIsClicked(hwnd, buttonCloseTrade[k])) {
        			if (MessageBox(Pairs[k]+", Close this trade?    ",
			               "Close Trade", MB_YESNO | MB_ICONQUESTION) != IDYES)
				return(1);
		        	CloseTrades(Pairs[k], maxSlippage(), MagicNumber);
		        }

	        }

		UpdateGrid();
        }
And lastly...

Code: Select all

void refreshGrid() {
	if (  showDisplay ) {
                //CreateGrid();
		UpdateGrid();
	}
}
Apologies for the formatting - the forum doesn't seem to like tab-indented code :\
Thanks slipshod.

Problem here is everyone uses a different broker and we all have different machines, I don't get any problems whatsoever with this EA, so when we come up with problems, it's difficult to diagnose the problem/bug.

If you look in the code I've added the save your shirt setting, you can set it at 5-6%
if your comfortable with that.

We now need to work on the drawdown stuff.

Andy
Post Reply

Return to “Nanningbob 10.x”