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

Multi 10:4 Trader EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1619
Page 74 of 160
Author:  theforexedge [ Sun Apr 07, 2013 1:04 pm ]
Post subject:  Re: Multi 10:4 Trader EA

Andy

I think last week was a double hit as the announcement by the Bank of Japan was major for the Yen, and then hit with the NFP hit on Friday.

You mentioned that the EA has broken even, so i think its not done too bad considering..

One idea based of FFCal that might be worth trying, is the strategy I follow when I'm trading in my Live account:

- My aim is to avoid Speaks - Bernanke, Central Banks etc. I will only enter Intraday trades 1-2 days before major 'Speaks' as these could involve interest rate changes, or massive QE / Stimulus - this is a fundamental of Bob's 10.4 (FFCal has this option)

- Prior to Speaks & High Impact News I close All Trades in Profit to lock in those pips, as I don't want to turn a profit into a loss

- Recently I've stopped trading at least a day prior to major speaks

- Currency Cross pairs that could be affected and that are near to Open Price i close, as too many times i've watched a 20 pip drawdown become 200pip drawdown.

- I usually wait 30 minutes after news before trading, as depending on the news (good / bad) you can get back in at better prices.

Of course none of this is new or revolutionary, but maybe we could add this option to the EA in the future and see how it fairs in forward testing..

I generally agree that most High Impact news is just noise and it's used to mark price up / down by the Institutional money to get better prices..of course opening a trade just before or during news should be avoided, but maybe having - do not trade NFP day as a first step?

Thanks anyway for coding a great EA..

Jason
Author:  snailbeard [ Sun Apr 07, 2013 3:08 pm ]
Post subject:  Re: Multi 10:4 Trader EA

Perhaps instead of adding more and more controls to the current user interface, which is already quite busy, the additional reasons to enable/disable trading could be abstracted, so that users could pass parameters by either file or global variables.
e.g.
"AUDJPY[buy:off;sell:on;r:news]"
"AUDNZD[buy:off;sell:off;r:time]"
"GBPUSD[buy:off;sell:off;r:stophunt]"
"GBPJPY[buy:off;sell:off;r:holiday]"
"USDCHF[buy:off;sell:off;r:SR]"

The main EA could read these parameters
a) on start-up,
b) before submitting a pending order
c) and every minute if there are pending orders or open trades.
(change time frame to force an immediate check)

For example
user A wants disable sell but not buy on several pairs for reason 1
user B wants to disable sells and buys on a number of pairs for reason 2

does the EA need to know why the user wants to set these choices - not necessarily - only if the EA has to log why trading was disabled.

This would allow different users to experiment with different scripts, indicators or EAs for enabling and disabling trading.

Someone might have a script that disables all pairs on Mondays,
someone else might have a script which enables trading only between 5 and 6 am then 10 and 11 am etc

Someone might have a script/EA to enable Asian crosses in one time pair and Euro crosses in another time pair.

So all manner of controls can be met externally without adding more and more complexity to main EA.
This would allow the main EA to stabilise and focus on its core functionality.
Timelords, news trackers and fox hunters could experiment separately and independently without changes to the main EA.

The lessons of these separate controls could eventually be brought together into a sister EA which switches pair trading on and off in the main EA when conditions are not favourable for particular pairs.
Author:  fx800 [ Sun Apr 07, 2013 7:04 pm ]
Post subject:  Re: Multi 10:4 Trader EA

Hi MrLong.

I think someone has posted previously, it would be nice to have "PAIRS TO TRADE" rather "PAIRS TO IGNORE".

May be at the next update ?


Thanks in advance.

peter
Author:  MrLong [ Mon Apr 08, 2013 8:20 am ]
Post subject:  Re: Multi 10:4 Trader EA

snailbeard wrote:Perhaps instead of adding more and more controls to the current user interface, which is already quite busy, the additional reasons to enable/disable trading could be abstracted, so that users could pass parameters by either file or global variables.
e.g.
"AUDJPY[buy:off;sell:on;r:news]"
"AUDNZD[buy:off;sell:off;r:time]"
"GBPUSD[buy:off;sell:off;r:stophunt]"
"GBPJPY[buy:off;sell:off;r:holiday]"
"USDCHF[buy:off;sell:off;r:SR]"

The main EA could read these parameters
a) on start-up,
b) before submitting a pending order
c) and every minute if there are pending orders or open trades.
(change time frame to force an immediate check)

For example
user A wants disable sell but not buy on several pairs for reason 1
user B wants to disable sells and buys on a number of pairs for reason 2

does the EA need to know why the user wants to set these choices - not necessarily - only if the EA has to log why trading was disabled.

This would allow different users to experiment with different scripts, indicators or EAs for enabling and disabling trading.

Someone might have a script that disables all pairs on Mondays,
someone else might have a script which enables trading only between 5 and 6 am then 10 and 11 am etc

Someone might have a script/EA to enable Asian crosses in one time pair and Euro crosses in another time pair.

So all manner of controls can be met externally without adding more and more complexity to main EA.
This would allow the main EA to stabilise and focus on its core functionality.
Timelords, news trackers and fox hunters could experiment separately and independently without changes to the main EA.

The lessons of these separate controls could eventually be brought together into a sister EA which switches pair trading on and off in the main EA when conditions are not favourable for particular pairs.
Good Morning(GMT),

Some good ideas there to look at.

Thanks
Brian
Author:  simplex [ Mon Apr 08, 2013 10:14 am ]
Post subject:  Re: Multi 10:4 Trader EA

candletiger wrote:
veeyem wrote: 2013.04.04 10:09:51 Multi_10_4_EAv1.09 USDSGDm,H4: object name passed to ObjectSetText function cannot be an uninitialized or empty string
Andy,
I think I spotted the problem:

Code: Select all

void UpdateGrid() {
	string sLine = "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ";		// const on local scope
	string sSig = "signal";																	// "
	string sObj = "";
	string sTxt = "";
	for (int y = 0; y < PairIndex + 1; y++) {
		if ( OrderSelect ( GetTicket( Pairs[y]), SELECT_BY_TICKET) == true )
			sObj = "line" + 1 + y;
			double dMarketInfoBid = MarketInfo (Pairs[y], MODE_BID );
			if (  OrderSymbol() == Pairs[y] && 	OrderType() == OP_BUYSTOP && 	dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) && 	dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )        // select the master Trades
				ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BullishColor);
			else if ( 	OrderSymbol() == Pairs[y] && 	OrderType() == OP_SELLSTOP && dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) && 	dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )  // select the master Trades
				ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BearishColor);
				else
					ObjectSetText ( sObj, "", fontSize + 8, displayfont, gridBackColor); // added to remove the line when conditions are not met.// added mr Long

sObj is empty:

Code: Select all

string sObj = "";
sObj only gets a value if true

Code: Select all

if ( OrderSelect ( GetTicket( Pairs[y]), SELECT_BY_TICKET) == true )
			sObj = "line" + 1 + y;
If result is false, still ObjectSetText() is used.
{}missing after first if()?

/ct
candletiger,

Great work! I think you are right. IMO brackets should be set like this:

Code: Select all

if ( OrderSelect ( GetTicket( Pairs[y]), SELECT_BY_TICKET) == true ) {		// brackets!
	sObj = "line" + 0 + y;
	double dMarketInfoBid = MarketInfo (Pairs[y], MODE_BID );
	if (  OrderSymbol() == Pairs[y] 
			&& OrderType() == OP_BUYSTOP 
			&& dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
			&& dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )        // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BullishColor);
	else if ( OrderSymbol() == Pairs[y] 
				 && OrderType() == OP_SELLSTOP 
				 && dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
				 && dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )  // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BearishColor);
	else
		ObjectSetText ( sObj, "", fontSize + 8, displayfont, gridBackColor); // added to remove the line when conditions are not met.// added mr Long
}
Works fine for me.

- simplex
Author:  linuspoon [ Mon Apr 08, 2013 10:23 am ]
Post subject:  Re: Multi 10:4 Trader EA

simplex wrote:candletiger,

Great work! I think you are right. IMO brackets should be set like this:

Code: Select all

if ( OrderSelect ( GetTicket( Pairs[y]), SELECT_BY_TICKET) == true ) {		// brackets!
	//sObj = "line" + 0 + y;
	sObj = oName ( "line", 0, y );
	double dMarketInfoBid = MarketInfo (Pairs[y], MODE_BID );
	if (  OrderSymbol() == Pairs[y] 
			&& OrderType() == OP_BUYSTOP 
			&& dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
			&& dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )        // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BullishColor);
	else if ( OrderSymbol() == Pairs[y] 
				 && OrderType() == OP_SELLSTOP 
				 && dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
				 && dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )  // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BearishColor);
	else
		ObjectSetText ( sObj, "", fontSize + 8, displayfont, gridBackColor); // added to remove the line when conditions are not met.// added mr Long
}
Works fine for me.

- simplex
Hi simplex,

Your code has a new function oName which is not defined in the EA. Can you also provide the code for this function? Thanks.

Linus
Author:  simplex [ Mon Apr 08, 2013 10:32 am ]
Post subject:  Re: Multi 10:4 Trader EA

linuspoon wrote:
simplex wrote:candletiger,

Great work! I think you are right. IMO brackets should be set like this:

Code: Select all

if ( OrderSelect ( GetTicket( Pairs[y]), SELECT_BY_TICKET) == true ) {		// brackets!
	//sObj = "line" + 0 + y;
	sObj = oName ( "line", 0, y );
	double dMarketInfoBid = MarketInfo (Pairs[y], MODE_BID );
	if (  OrderSymbol() == Pairs[y] 
			&& OrderType() == OP_BUYSTOP 
			&& dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
			&& dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )        // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BullishColor);
	else if ( OrderSymbol() == Pairs[y] 
				 && OrderType() == OP_SELLSTOP 
				 && dMarketInfoBid > OrderOpenPrice() - 10 / PFactor(Pairs[y]) 
				 && dMarketInfoBid < OrderOpenPrice() + 10 / PFactor(Pairs[y]) )  // select the master Trades
		ObjectSetText ( sObj, sLine, fontSize + 8, displayfont, BearishColor);
	else
		ObjectSetText ( sObj, "", fontSize + 8, displayfont, gridBackColor); // added to remove the line when conditions are not met.// added mr Long
}
Works fine for me.

- simplex
Hi simplex,

Your code has a new function oName which is not defined in the EA. Can you also provide the code for this function? Thanks.

Linus
Hi Linus,

Sorry for that! Just forgot to delete this line. It is part of some modification I am still working on. At least for the moment please go back to MrLong's original code here:

Code: Select all

	sObj = "line" + 0 + y;
I edited my original post to correct that.
- simplex
Author:  simplex [ Mon Apr 08, 2013 7:32 pm ]
Post subject:  Re: Multi 10:4 Trader EA

Hi Andy,

I have some trouble understanding the following code (line 2863 ff in v2.00):

Code: Select all

if(  RunningTrades(Pairs[y]) > 1 && !useAverageBE )
	ObjectSetText("be" + y,"("+FormatPrice(Pairs[y], calculateBE(Pairs[y]), 2)+")", fontSize, displayfont, Gold);
else if(  RunningTrades(Pairs[y]) > 1 && useAverageBE )
	ObjectSetText("be" + y,"("+FormatPrice(Pairs[y], calculateBE(Pairs[y]), 2)+")", fontSize, displayfont, BearishColor); 
else
	ObjectSetText("be" + y, "", fontSize + 2, "Wingdings", Black);
  • What is the logic behind the colours? No BullishColor used?
    Under which condition should BE be displayed? I never noticed this column in forward test.
simplex
Author:  MrLong [ Mon Apr 08, 2013 9:37 pm ]
Post subject:  Re: Multi 10:4 Trader EA

simplex wrote:Hi Andy,

I have some trouble understanding the following code (line 2863 ff in v2.00):

Code: Select all

if(  RunningTrades(Pairs[y]) > 1 && !useAverageBE )
	ObjectSetText("be" + y,"("+FormatPrice(Pairs[y], calculateBE(Pairs[y]), 2)+")", fontSize, displayfont, Gold);
else if(  RunningTrades(Pairs[y]) > 1 && useAverageBE )
	ObjectSetText("be" + y,"("+FormatPrice(Pairs[y], calculateBE(Pairs[y]), 2)+")", fontSize, displayfont, BearishColor); 
else
	ObjectSetText("be" + y, "", fontSize + 2, "Wingdings", Black);
  • What is the logic behind the colours? No BullishColor used?
    Under which condition should BE be displayed? I never noticed this column in forward test.


simplex

haha, sorry that was just to confirm that the break even function was active, gold, not active red is active, but forget that function because I coded that when I was usining fixed lots, I have to re-code when I arrive home. :oops:
Author:  simplex [ Mon Apr 08, 2013 9:51 pm ]
Post subject:  Re: Multi 10:4 Trader EA

MrLong wrote:
simplex wrote:Hi Andy,

I have some trouble understanding the following code (line 2863 ff in v2.00):
...
  • What is the logic behind the colours? No BullishColor used?
    Under which condition should BE be displayed? I never noticed this column in forward test.
simplex

haha, sorry that was just to confirm that the break even function was active, gold, not active red is active, but forget that function because I coded that when I was usining fixed lots, I have to re-code when I arrive home. :oops:
Great - I'll relax!

simplex
All times are UTC Page 74 of 160