Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2006, 08: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!
Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 08: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!
Reply With Quote
  #3 (permalink)  
Old 05-03-2006, 09: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!
Reply With Quote
  #4 (permalink)  
Old 05-03-2006, 10: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!
Reply With Quote
  #5 (permalink)  
Old 05-03-2006, 10:16 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
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!
Reply With Quote
  #6 (permalink)  
Old 05-03-2006, 10: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!
Reply With Quote
  #7 (permalink)  
Old 05-03-2006, 11:34 PM
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!
Reply With Quote
  #8 (permalink)  
Old 05-03-2006, 11:39 PM
Senior Member
 
Join Date: Mar 2006
Posts: 787
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!
Reply With Quote
  #9 (permalink)  
Old 05-04-2006, 12: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!
Reply With Quote
  #10 (permalink)  
Old 05-04-2006, 02:14 AM
firedave's Avatar
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 416
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!
Reply With Quote
Reply

Bookmarks

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 130 - invalid stop. Why? Lou G General Discussion 9 Yesterday 05:23 PM
Please help Invalid stops Error 130 cardio Setup Questions 4 06-30-2006 04:31 PM
ERROR: Invalid Integer Number As Parameter secxces Questions 4 05-25-2006 02:50 PM
invalid account huhenyo Metatrader 4 4 04-03-2006 07:37 PM


All times are GMT. The time now is 08:08 AM.



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