Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2006, 09:34 PM
Junior Member
 
Join Date: Nov 2005
Posts: 26
caldolegare is an unknown quantity at this point
invalid stop driving me nuts

I am getting an invalid stop every time my EA goes to trade. It is driving me nuts. I have posted the OrderSend code for you to look over.


int ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,6,Bid+1 5*point,Bid-takeProfit*Point,"comment",283,0,CLR_NONE);

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*point,Ask+takeProfit*Point,"comment",283,0,CLR_ NONE);

A side point. I have int ticket for both functions as I have the buy and sell in seperate modules. Didn't want anyone to think I was declaring it twice.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 09:35 PM
Junior Member
 
Join Date: Nov 2005
Posts: 26
caldolegare is an unknown quantity at this point
int ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,6,Bid+1 5*point,Bid-takeProfit*Point,"comment",283,0,CLR_NONE);

Hit the space bar. It is correct in my code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2006, 10:13 PM
cucurucu's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 314
cucurucu is on a distinguished road
Lightbulb Hi caldolegare

I see the space between "1" and "5". That's one problem.

The other problem is "point" instead of "Point". You must write it with "P".

So, it should be like this:

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*Point,Ask+takeProfit*Point,"comment",283,0,CLR_ NONE);

Bye.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2006, 11:01 PM
Junior Member
 
Join Date: Nov 2005
Posts: 26
caldolegare is an unknown quantity at this point
Upon further review. I made those changes already. Sorry about that. I actually had it in my code like that and still got the problem.

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*Point,Ask+takeProfit*Point,"comment",magic,0,CL R_NONE);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2006, 11:16 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
Originally Posted by caldolegare
Upon further review. I made those changes already. Sorry about that. I actually had it in my code like that and still got the problem.

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*Point,Ask+takeProfit*Point,"comment",magic,0,CL R_NONE);
caldolegare,

There's no problem in your above line of code Could u send the EA?
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 05-03-2006, 11:17 PM
cucurucu's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 314
cucurucu is on a distinguished road
Quote:
Originally Posted by caldolegare
Upon further review. I made those changes already. Sorry about that. I actually had it in my code like that and still got the problem.

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-15*Point,Ask+takeProfit*Point,"comment",magic,0,CL R_NONE);
The problem still persists? I don't see any problem.

Try to define the stoploss variable:
extern int stoploss=15
and modify the ticket to:
int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-stoploss*Point,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);

may be this will work. However I can't see any problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 05-04-2006, 12:34 AM
Junior Member
 
Join Date: Nov 2005
Posts: 26
caldolegare is an unknown quantity at this point
Already tried that. Even tried this.

double stopLoss=15*Point

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-stopLoss,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);

Could it be that I am using double instead of int?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 05-04-2006, 12:39 AM
Senior Member
 
Join Date: Mar 2006
Posts: 793
Maji is on a distinguished road
Quote:
Originally Posted by caldolegare
Already tried that. Even tried this.

double stopLoss=15*Point

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-stopLoss,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);

Could it be that I am using double instead of int?
I am not sure if this will work, but give it a try...

Code:
double stopLoss=NormalizeDouble(15*Point, Digits);

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Bid-stopLoss,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 05-04-2006, 01:55 AM
Junior Member
 
Join Date: Oct 2005
Posts: 28
bill3002 is on a distinguished road
Some things in mq4 are case sensitive.

Ex: colors ...brown isn`t recognized while Brown is.

Everywhere in your code (including variables), try changing these:

stopLoss to StopLoss
takeProfit to TakeProfit
point to Point

Make sure that all words "lots" are either all spelled lots or Lots

---------------------------------------

Quote:
Originally Posted by caldolegare
Already tried that. Even tried this.

double stopLoss=15*Point

int ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,6,Ask-stopLoss,Ask+takeProfit*Point,0,magic,0,CLR_ NONE);

Could it be that I am using double instead of int?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 05-04-2006, 03:14 AM
firedave's Avatar
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 414
firedave is on a distinguished road
Well, other possibility is the SL or the TP is too tight and your MT4 platform can't accept it. Just my two cents
__________________
David Michael H
"Trader helps traders with sincerity, honesty and integrity"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Codes cardio Setup Questions 28 11-05-2009 01:13 PM
Error 130 - invalid stop. Why? Lou G General Discussion 23 12-14-2008 08:58 PM
ERROR: Invalid Integer Number As Parameter secxces Questions 4 05-25-2006 03:50 PM
invalid account huhenyo Metatrader 4 4 04-03-2006 08:37 PM


All times are GMT. The time now is 06:54 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.