• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:14am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:14am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Guaranteed SL and widening of spread during news 2 replies

USDJPY spread during NFP news release last Friday 06/09/13 32 replies

No "bonus" spread during NEWS 3 replies

Which M4 - 5 digits,Paypal USD,scalper allow,spread <2,regulated Broker you suggest? 0 replies

non-news day trading scalper 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Scalper EA during news, what do you do about the spread?

  • Post #1
  • Quote
  • First Post: Mar 23, 2008 4:44pm Mar 23, 2008 4:44pm
  •  permanentjaun
  • | Joined Oct 2006 | Status: Member | 655 Posts
Hello,

I'm building a scalping EA, and one problem with letting the system run during market hours without interruption is the widened spread during news will kill me. What is one solution to this problem? Can you code the EA to not trade once spread is above X?

One problem with my system though is that it relies on SAR. So if I am in the middle of a trade, get SL'd, and then the news hits and moves price 20-40 pips away once trading settles down, then my system will be at a disadvantage.

Any idea what I could do?
  • Post #2
  • Quote
  • Mar 24, 2008 12:13pm Mar 24, 2008 12:13pm
  •  Royce
  • | Joined Mar 2008 | Status: Member | 25 Posts
Assuming you have the MQL4, you can indeed alter your EA to not trade when the spread widens above a certain point.

If your EA is simple a EA, that is one that does not linger in loops over long, the expression (Ask - Bid) / Point will evaluate to the number of pips in the spread. You can use a conditional statement of some sort with that expression to avoid the trade. However, if your EA does linger for long periods of time without returning from a start() call you will need to be sure to call RefreshRates() just before you use the spread calculation expression.
 
 
  • Post #3
  • Quote
  • Mar 24, 2008 12:30pm Mar 24, 2008 12:30pm
  •  permanentjaun
  • | Joined Oct 2006 | Status: Member | 655 Posts
Actually I will be using tradestation since I need to be on an ECN; ie MB Trading. MT4 brokers don't really care for scalpers. This was the only forum I figured I could ask this question. Do you know if I'll be able to do something like this in ninjatrader?
 
 
  • Post #4
  • Quote
  • Mar 18, 2010 1:31pm Mar 18, 2010 1:31pm
  •  forexman77
  • | Joined Mar 2010 | Status: Member | 13 Posts
Quoting permanentjaun
Disliked
Hello,

I'm building a scalping EA, and one problem with letting the system run during market hours without interruption is the widened spread during news will kill me. What is one solution to this problem? Can you code the EA to not trade once spread is above X?

One problem with my system though is that it relies on SAR. So if I am in the middle of a trade, get SL'd, and then the news hits and moves price 20-40 pips away once trading settles down, then my system will be at a disadvantage.

Any idea what I could do?
Ignored
Use this:
extern int MaxSpread = 8;
.......
double spread = MarketInfo(Symbol(),MODE_SPREAD);
....
if (spread >=MaxSpread) return(0);
 
 
  • Post #5
  • Quote
  • Mar 18, 2010 11:04pm Mar 18, 2010 11:04pm
  •  60minman
  • | Joined May 2009 | Status: Member | 82 Posts
Quoting forexman77
Disliked
Use this:
extern int MaxSpread = 8;
.......
double spread = MarketInfo(Symbol(),MODE_SPREAD);
....
if (spread >=MaxSpread) return(0);
Ignored

77....

would it matter where you place this code? Does it need to go before the conditional codes to buy or sell.....or should it go after?
 
 
  • Post #6
  • Quote
  • Mar 20, 2010 7:24am Mar 20, 2010 7:24am
  •  forexman77
  • | Joined Mar 2010 | Status: Member | 13 Posts
Quoting 60minman
Disliked
77....

would it matter where you place this code? Does it need to go before the conditional codes to buy or sell.....or should it go after?
Ignored
Before. EA stoped looping, he is not pasing Sell or Buy.
MaxSpread = 8;
On ECN broker (5 digits) mean 0.8 pip
 
 
  • Post #7
  • Quote
  • Last Post: Edited at 4:50pm Aug 25, 2010 12:16am | Edited at 4:50pm
  •  zoom27
  • | Joined Aug 2010 | Status: Member | 5 Posts
Can sombody add this maxspread into my code ???
 
 
  • Platform Tech
  • /
  • Scalper EA during news, what do you do about the spread?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022