• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:59pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:59pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Why do indicators not work/work? Why is Forex not truly random? 129 replies

do automated trading systems work or... 21 replies

MIG makes constant reqoutes 1 reply

MIG making reqoutes again 2 replies

How Do Forex Futures Work? 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: How do EA's work with Reqoutes?
Cancel

How do EA's work with Reqoutes?

  • Post #1
  • Quote
  • First Post: Dec 18, 2008 7:21pm Dec 18, 2008 7:21pm
  •  lesney75
  • | Joined Sep 2008 | Status: Member | 11 Posts
Hi, Please could someone help me. I'm using an EA and it won't place a trade if there is a reqoute. How do I get it to accept the reqoute?
  • Post #2
  • Quote
  • Dec 18, 2008 11:31pm Dec 18, 2008 11:31pm
  •  Jwentro
  • | Joined Sep 2008 | Status: Pips do not always equal profits | 370 Posts
Quoting lesney75
Disliked
Hi, Please could someone help me. I'm using an EA and it won't place a trade if there is a reqoute. How do I get it to accept the reqoute?
Ignored

Im only a beginner when it comes to this type of coding, but what you want is SLIPPAGE.


example:

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

someone please correct me if im wrong.
 
 
  • Post #3
  • Quote
  • Dec 18, 2008 11:37pm Dec 18, 2008 11:37pm
  •  Ronald Raygun
  • Joined Jul 2007 | Status: 32 y/o Investor/Trader/Programmer | 5,016 Posts
slippage helps avoid a requote.

If you do get a requote with an EA, just wait for the next signal. No need to chast after the market.
 
 
  • Post #4
  • Quote
  • Dec 18, 2008 11:57pm Dec 18, 2008 11:57pm
  •  Orest
  • Joined Sep 2007 | Status: Member | 411 Posts
I disagree. What if your EA happens to be helluva successfull and broker intentionally hunt your orders? Besides changing the broker you could programmatically protect yourself from requotes (at least in theory) executing your SendOrder in the loop until success code is received.

Here is a snippet

PHP Code
  void SendOrder(){ 
      
int ticket=0; 
      
int err=0; 
      
int c = 0; 
      
int Attempts = 100; 
       
      for(
c = Attempts ; c >= 0; c--){ 
            
HealthCheck(); // check to make sure EA is running correctly 
            
RefreshRates(); 
            
ticket=OrderSend(O_Symbol,O_Type,O_Lots,O_OpenPrice,O_Slippage,O_StopLoss,O_TakeProfit,O_String,O_Magic,O_Exp,O_Color); 
            if (
ticket > 0) {Print(" Order Symbol : "O_Symbol," Order Type : "O_Type," Lots : "O_Lots," Open Price : "O_OpenPrice," Slippage : "O_Slippage," Stop Loss : "O_StopLoss," Take Profit : "O_TakeProfit," "O_String," Order Magic : "O_Magic," Order Exp : "O_Exp," Order Color : "O_Color," Open Time : "OrderOpenTime()," EA Took ",GetTickCount() - TickStart," milliseconds" );break;} 
            
err=GetLastError(); 
            if(
err==0 || err==2 || err==4 ||err==6 || err==8 || err==9 || err==64 || err==128 || err==132 || err==133 || err==137 || err==139 || err==141 || err==146){ //Sleep and retry errors 
               
Print("....................... Sleep And Retry Error Code= ", err," "ErrorDescription(err)); 
               
Sleep(10); 
               continue; 
               } 
            if(
err==135 || err==136 || err== 138){ // price change errors 
               
Print ("..................Invalid Price " O_String + " .............."); 
               
WindowScreenShot("S_REQUOTE_"+Month()+"_D"+Day()+"_H"+Hour()+"_M"+Minute()+"_S"+Seconds()+".gif",1440,900); 
               Print(
"....................... Price Error Code= ", err," "ErrorDescription(err)); 
               
start();//restart and make sure that new price meets our entry criteria 
               
break; 
               } 
            else{ 
// other errors 
               
Print(".......................Error Code= ", err," "ErrorDescription(err)); 
               break; 
               } 
          } 
    } 

from here http://www.forex-tsd.com/metatrader-...-requotes.html

Quoting Ronald Raygun
Disliked
slippage helps avoid a requote.

If you do get a requote with an EA, just wait for the next signal. No need to chast after the market.
Ignored
 
 
  • Post #5
  • Quote
  • Last Post: Dec 19, 2008 12:13am Dec 19, 2008 12:13am
  •  Ronald Raygun
  • Joined Jul 2007 | Status: 32 y/o Investor/Trader/Programmer | 5,016 Posts
Orest, that would apply perhaps if the EA were a scalping type EA, but you're right about that.
 
 
  • Platform Tech
  • /
  • How do EA's work with Reqoutes?
  • 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 / ©2023