Go Back   DailyFX Forum > FXCM Products and Services > MT4 > Expert Advisor Discussion

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
  #46 (permalink)  
Old 08-26-2009, 02:22 AM
Registered User
 
Join Date: Aug 2009
Posts: 2
vintage is an unknown quantity at this point
4 v. 5 digit

Quote:
Originally Posted by Luke Quinn View Post
I wanted to post this here because I get a lot of questions about Fractional Pricing with FXCM. Fractional Pricing allows a broker to more easily tighten spreads because of the precision of pricing. A Broker may not be able to offer spreads of 2 pips on EURUSD but wants to be lower than 3. With fractional pricing in place, it allows a broker to do a 2.6 or 2.3 pip spread, passing the difference on to the client.

A problem that arises from this is that a lot of programmers don't write EA's with this in mind. This limits the client's flexibility, and can lead to a lot of confusion. The biggest mistake revolves around the predefined variable "Point". A point, by MT4 terms, is the smallest unit by which a a price can increment. Most developers assume that Point equals 1 pip, but on a fractional pricing server a point is actually 1/10th of a pip. This leads to common problems such as stops and limits being 10 times too small.

An easy way to address this on pre-existing strategies is to create an external variable and integer.

extern bool FractionalPips = true;

int pip;

Then after the start of the strategy you include some code that sets the value of pip. Essentially when fractionalpips equals true, then pip equals 10, if not, pip equals 1.

if(FractionalPips==true)
{
pip=10;
}
else pip =1;

Once that is complete, at every spot in the strategy where you see "Point", change it to "Point*pip" This will allow your Point value to once again be equal to 1 pip, thus restoring the original functionality of your system.

For many people adding this code to their strategy is quite easy. If you lack confidence in doing this, Programming Services is available for projects such as this and have the experience necessary to follow through. Inquiries can be sent to consulting@fxcm.com.


Luke Quinn
Programming Services
In response, I think traders need to know the following. It is in their best interest.
4 v 5 digits

Which is better 4 or 5 digits when trading with an EA?

Take into consideration that a market maker can change the settings on their MT4 to throw off your EA from executing correctly because of a 5 digit decimal setting. This allows them to be able to reduce their exposure while increasing yours. We have our platform set to execute on 4 digits only.

We tell all of our clients and programmers that we have our platform setting to execute only on 4 digits not 5 digits. Although, we have some banks in our ECN that will throw 5 digits decimal pricing to try to throw off any EA’s that are succeeding on our ECN MT4. But they cannot affect the EA’s from that perspective because our platform will not allow execution if it gets a 5 digit decimal quote from one of our banks. Our ECN MT4 will only accept the first 4 digits only.

PFG believes in creating a fair playing field for traders against the banks.

That is why all EA’s must be coded to execute on Market Order Execution instead of Instant Order Execution. This way the banks don’t get to see your stop loss, take profit target or trailing stop. Why? Because the order isn’t written in the same way Dealing Desk Brokers/Market makers lead you to believe. So what does that mean?

When you place an order on a market makers MT4 platform you place it as Instant Order Execution; this means the market makers and their bank/s sees all and knows all because the order looks something like this.

The EA puts in your order, stop loss and take profit all at once and the market maker knows ahead of time where your stops and limits are; this gives them quite an advantage. One could say they have a full on view of your poker hand or put another way, your trading strategy. This way they can combat your strategy with one of their own.

Whereas with a true ECN MT4 the above scenario is not the case; the bank gets a market order and that is all the bank sees. When your robot places the stop and limit orders next, those orders stay on our server where the bank cannot see it until it is time to execute one or the other. And that, as they say about roads, can make all the difference.

To further illustrate, kindly take into consideration that a market maker can change the settings on their MT4 to throw off your EA’s from executing correctly on a 5 digit decimal setting.

We on the other hand have our ECN MT4 platform set to execute on 4 digits only; this way even though some of our banks do try to go to that fifth digit, our platform denies this capability.

As you probably know, with a market maker if you win they lose so while you are busy scalping them they in turn are busy scalping you with that 5th digit, how nice is that? Pretty good deal for the market maker, don’t you think? They do.


vintage
Reply With Quote
  #47 (permalink)  
Old 08-26-2009, 08:54 AM
Member
 
Join Date: Aug 2009
Posts: 5
BALLARD is an unknown quantity at this point
Where can I get some EAs?
Reply With Quote
  #48 (permalink)  
Old 08-26-2009, 09:44 AM
Jason Rogers's Avatar
DailyFX Moderator
 
Join Date: Jun 2009
Posts: 121
Jason Rogers is an unknown quantity at this point
Quote:
Originally Posted by BALLARD View Post
Where can I get some EAs?
hi ballard,

We have a list of free EA's you can start out with here Free FXCM Expert Advisors
__________________
Follow me on twitter: www.twitter.com/jasonforex
Reply With Quote
  #49 (permalink)  
Old 09-02-2009, 12:20 PM
Registered User
 
Join Date: Aug 2009
Posts: 3
fxalgotrader is an unknown quantity at this point
Send a message via Skype™ to fxalgotrader
Ftactional Pricing

You can get round the fractional pricing problems by setting your SL and TP levels using an order modify function after the order has been executed. My broker moved to fractional pricing recently which stuffed up all my EAs which used to set the SL and TP at the same time the order was executed on the trade server.

Ordermodify is the way forward.

You can also add some code into your EA which can modify the EA to work with fractional accounts.
Reply With Quote
  #50 (permalink)  
Old 09-04-2009, 04:49 AM
art art is offline
Registered User
 
Join Date: Oct 2007
Posts: 3
art is an unknown quantity at this point
hi am new here,simple question i am running expert advisor, i leave my computer on overnight,when the screen goes blank is the advisor still working,because when i tap the pad to bring the screen back up the platform pings,is the platform still connected to the internet thanks
Reply With Quote
  #51 (permalink)  
Old 09-05-2009, 06:07 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
fxalgotrader is an unknown quantity at this point
Send a message via Skype™ to fxalgotrader
You need to asjust the power managment setting on your machine - there's no problem with the screen shutting down but it sounds like your machine is going into hibernation which will drop your internet connection and your MT4 client connection in turn.

If MT4 makes the ping sound it means the platform has lost connectivity. Have a look at your 'journal' in the terminal in MT4. It will say 'ping failed' or 'login' - this demonstrates a loss of web connectivity.Hope this helps.
Reply With Quote
  #52 (permalink)  
Old 09-23-2009, 09:34 AM
Registered User
 
Join Date: Dec 2008
Posts: 1
wtaylor8763 is on a distinguished road
Adequate testing and history

What is an adequate time frame to test an EA with? I keep finding EAs that work really good, but then as time goes on, they stop working as well. As I get more history to work with, I find out that strategies that worked on a few weeks of data do not work very well over longer testing periods.

So what is a good time frame to test on? 2 years? 5 years? 10 years?

My problem is that I only have 2 months of testing data, which is highly inadequate.

Where can I get 1-min and 5-min data stretching back years, and how many years should I need?

Regards,
Warren
Reply With Quote
  #53 (permalink)  
Old 09-29-2009, 01:37 PM
Gregory McLeod's Avatar
DailyFX Power Course Instructor
 
Join Date: Sep 2007
Posts: 1,135
Gregory McLeod is an unknown quantity at this point
EA Stop and Limits?

Quote:
Originally Posted by Jason Rogers View Post
hi ballard,

We have a list of free EA's you can start out with here Free FXCM Expert Advisors
Is there a way for the EA's to have automatic stops and limits?
__________________
Gregory McLeod moderates the Trend of the Day thread as well as the Short Term Strategies Using Market Depth.

Enroll in our online FX Power Course today and get personalized instruction from our team of expert traders 24 hours a day. We have taught over 25,000 students and in just eight lessons, we will teach you the fundamentals of Forex trading. Click here to get more information.
Reply With Quote
  #54 (permalink)  
Old 09-30-2009, 02:44 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
fxalgotrader is an unknown quantity at this point
Send a message via Skype™ to fxalgotrader
Auto Stop and order management using MT4 EA + Backtesting

To answer George's questions - yes you can automate any part of the order processing functionality. It can get a bit tricky when you split orders as the order comments change but by and large anything is possible with MQL4. the only limit is your imagination.

I noticed some people have been talking about odd results when they backtest MT4 strategies.

People should have a serious look at the data they are using for the backtest. Download the data from the MT4 history center into an Excel spread and examine it. You will be amazed by how many holes there are in most broker's historical time series. In order to properly backtest the data series must be pre-processed first. This is even more appropriate for multiple pair autotrading strategies as the data series must be synchronised first.

I've had simply amazing backtest results from MT4 tester but when you look at the quality of the input data it's no wonder why you get spikes all over the place. As with all things involving data - the quality of the output depends on the input. Ergo crap in crap out.

I am considering writing a data pre-processor for MT4 pair data but it's miles down the development pipeline.

Cheers

FXAlgoTrader
Reply With Quote
  #55 (permalink)  
Old 10-11-2009, 11:45 PM
Registered User
 
Join Date: Oct 2009
Posts: 1
Auto is an unknown quantity at this point
Not Modifing order?

My EA is executing the entry in the market just fine...but not executing the Modify Order......Maybe my stop and target calculation is off. Or, maybe the modify order is executed to soon after the entry order?

z=iATR(NULL,0,atr,0)*target; //target is integer
sl=z*s;
sl=NormalizeDouble(sl,5); // 5 digit decimal
z=NormalizeDouble(z,5);


ticket=OrderSend(Symbol(),OP_BUY,1,Ask,0,0,0,0,0,0 ,Green);
if(ticket>0)
{
OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(OrderTicket(),OrderOpenPrice(),Ask-sl,Ask+z,0,Green);
}
Reply With Quote
  #56 (permalink)  
Old 10-24-2009, 02:19 PM
t1c t1c is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
t1c is an unknown quantity at this point
Forex EA Generator for MT4 needs testing

We are working on Forex EA Generator software for MT4. Please help us test and improve it. Software is free to use for 60 days. No other limitations. Generates source code in MT4 (MQ4) based on your strategy setup via dialog screens.

Forex Expert Advisor Generator for MQ language
Reply With Quote
  #57 (permalink)  
Old 11-09-2009, 12:17 AM
Member
 
Join Date: Sep 2009
Posts: 14
mark9290 is an unknown quantity at this point
Send a message via Yahoo to mark9290 Send a message via Skype™ to mark9290
How to change EA to run ECN Mt4

Hi, guys.I have some EA and script can't run on fxcm ECN MT4, what code should I change to make it able to send market order/


Thanx
Reply With Quote
  #58 (permalink)  
Old 11-11-2009, 05:58 PM
Registered User
 
Join Date: May 2006
Posts: 4
WaveMaster is on a distinguished road
Optimizing an EA

Is it ever necessary to go into negative values when optimizing an EA?

Example . . . . . . start . step . stop
MacdCloseLevel . -15 . . . 1 . . . 15
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.

All times are GMT -5. The time now is 08:48 PM.
Copyright ©2009 Daily FX. All Rights Reserved.