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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Strange MT4 iMA() problem 9 replies

Strange "No Connection" Problem in MT4 2 replies

Strange problem with MT4 self-scrolling 1 reply

Strange IBFX Problem, chart descrepancy 0 replies

very strange problem with MT4 build202 and 203 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Strange problem on backtesting my EA, Orders not passed
Cancel

Strange problem on backtesting my EA, Orders not passed

  • Post #1
  • Quote
  • First Post: Sep 20, 2007 12:22pm Sep 20, 2007 12:22pm
  •  mjollnir
  • | Joined Sep 2007 | Status: Member | 40 Posts
Here is the code:

Inserted Code
      ticket=OrderSend(Symbol(), OP_BUY, max_slippage, Ask, max_slippage, Ask-take_profit*Point, Ask+lot_size*Point, "Long Order", 31337, 0, Green);
      write_time("OrderSend BUY");
      if(ticket<0)
       {
        Print("OrderSend failed with error #",GetLastError());
        write_time("OrderSend failed with error #"+GetLastError());
        return(0);
       }
Everytime the code is executed, ticket value is -1, meaning there has been a problem but GetLastError() returns 0, meaning everything is OK.

The order is not passed.

This happens on backtesting, and probably real trading too.

write_time() is my own function to log data into a file.

Any clue?
I used to be schizophrenic, but now we are sane.
  • Post #2
  • Quote
  • Sep 20, 2007 1:16pm Sep 20, 2007 1:16pm
  •  Kir
  • | Joined Sep 2007 | Status: Profit Prophet | 41 Posts
This has something to do with the arguments that you are passing to OrderSend. Here is it's head:
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

I see you passing max_slipage as the lot size for example.
 
 
  • Post #3
  • Quote
  • Sep 20, 2007 4:28pm Sep 20, 2007 4:28pm
  •  mjollnir
  • | Joined Sep 2007 | Status: Member | 40 Posts
Problem solved. Thank you.
I used to be schizophrenic, but now we are sane.
 
 
  • Post #4
  • Quote
  • Last Post: Sep 20, 2007 5:57pm Sep 20, 2007 5:57pm
  •  yaskevich
  • | Joined Aug 2006 | Status: Member | 19 Posts
Quoting mjollnir
Disliked
Here is the code:

Inserted Code
      ticket=OrderSend(Symbol(), OP_BUY, max_slippage, Ask, max_slippage, Ask-take_profit*Point, Ask+lot_[url="http://autoclubforum.com"][color="Black"]s[/color][/url]ize*Point, "Long Order", 31337, 0, Green);
      write_time("OrderSend BUY");
      if(ticket<0)
       {
        Print("OrderSend failed with error #",GetLastError());
        write_time("OrderSend failed with error #"+GetLastError());
        return(0);
       }
Everytime the code is executed, ticket value is -1, meaning there has been a problem but GetLastError() returns 0, meaning everything is OK.

The order is not passed.

This happens on backtesting, and probably real trading too.

write_time() is my own function to log data into a file.

Any clue?
Ignored
You know, it's much more easier to test strategies using Tradestation platform (Omega). There are no so many bugs as in Metatrader.
 
 
  • Platform Tech
  • /
  • Strange problem on backtesting my EA, Orders not passed
  • 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