stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Multi 10:4 Trader EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1619
Page 86 of 160
Author:  Geges [ Wed Apr 17, 2013 2:06 am ]
Post subject:  Re: Multi 10:4 Trader EA

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
Author:  bshoe24 [ Wed Apr 17, 2013 3:21 am ]
Post subject:  Re: Multi 10:4 Trader EA

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.
Author:  slipshod [ Wed Apr 17, 2013 4:13 am ]
Post subject:  Re: Multi 10:4 Trader EA

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.
Author:  bshoe24 [ Wed Apr 17, 2013 5:28 am ]
Post subject:  Re: Multi 10:4 Trader EA

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.
Author:  MrLong [ Wed Apr 17, 2013 6:24 am ]
Post subject:  Re: Multi 10:4 Trader EA

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
Author:  slipshod [ Wed Apr 17, 2013 6:33 am ]
Post subject:  Re: Multi 10:4 Trader EA

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 :\
Author:  fahedksa [ Wed Apr 17, 2013 6:46 am ]
Post subject:  Re: Multi 10:4 Trader EA

Today when i load latest version 2.1a Empty4 keep crashing and close.specally when i change time frame
Author:  MrLong [ Wed Apr 17, 2013 6:52 am ]
Post subject:  Re: Multi 10:4 Trader EA

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?
Author:  fahedksa [ Wed Apr 17, 2013 6:56 am ]
Post subject:  Re: Multi 10:4 Trader EA

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?
Author:  MrLong [ Wed Apr 17, 2013 6:58 am ]
Post subject:  Re: Multi 10:4 Trader EA

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
All times are UTC Page 86 of 160