Forex



Go Back   Forex Trading > Discussion Areas > General Discussion
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
  #11 (permalink)  
Old 12-11-2008, 04:16 AM
Senior Member
 
Join Date: Dec 2006
Posts: 110
dwmcqueen is on a distinguished road
Keep on getting 130

Here is my code - always give me a 130 error and sl and tp look a digit too short. Any thoughts??

if (RegularorCandleCloseStoploss == True)
{
if (StealthMode == False)
{
CalcStopLossPips = StopLossSell;
}
else
{
CalcStopLossPips = EmergencyStopLoss;
}
}
else
{
StopLossLevel =NormalizeDouble(Low[iLowest(NULL,0,MODE_LOW,NmbrBarsBackStopLoss,1)], 10);
CalcStopLossPips = (MathAbs(Bid + StopLossLevel)) / pp;
}


if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Bid - TakeProfitSell * Point, 10);
else TakeProfitLevel = 0.0;

Print("Sell Stoploss: ", DoubleToStr(StopLossLevel, Digits));
Print("TP: ", DoubleToStr(TakeProfitLevel, Digits));

Print("Bid: ", DoubleToStr(Bid, Digits));

Print("Digits: ", Digits);


Ticket = OrderSend(Symbol(), OP_SELL, lotsForOrder, Bid, Slippage, NormalizeDouble(Bid + (CalcStopLossPips * Point), Digits), TakeProfitLevel, "Sell(#" + InternalMagicNumber + ")", InternalMagicNumber, 0, DeepPink);
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #12 (permalink)  
Old 12-11-2008, 06:28 AM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Why do you normalize 10 digits? Use Digits everywhere.
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
  #13 (permalink)  
Old 12-11-2008, 01:26 PM
Senior Member
 
Join Date: Dec 2006
Posts: 110
dwmcqueen is on a distinguished road
Thanks - still get the error, though. My code looks like this now:
if (RegularorCandleCloseStoploss == True)
{
if (StealthMode == False)
{
CalcStopLossPips = StopLossSell;
}
else
{
CalcStopLossPips = EmergencyStopLoss;
}
}
else
{
StopLossLevel =NormalizeDouble(Low[iLowest(NULL,0,MODE_LOW,NmbrBarsBackStopLoss,1)], Digits);
CalcStopLossPips = (MathAbs(Bid + StopLossLevel)) / pp;
}


if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Bid - TakeProfitSell * Point, Digits);
else TakeProfitLevel = 0.0;

Print("Sell Stoploss: ", DoubleToStr(StopLossLevel, Digits));
Print("TP: ", DoubleToStr(TakeProfitLevel, Digits));

Print("Bid: ", DoubleToStr(Bid, Digits));

Print("Digits: ", Digits);


OrderSend(Symbol(), OP_SELL, lotsForOrder, NormalizeDouble(Bid, Digits), Slippage, NormalizeDouble(Bid + (CalcStopLossPips * Point), Digits), NormalizeDouble(TakeProfitLevel, Digits), "Sell(#" + InternalMagicNumber + ")", InternalMagicNumber, 0, DeepPink);
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #14 (permalink)  
Old 12-11-2008, 07:06 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Show me your experts logs, please.
What is pp?
I think you have a mistake when you calculate CalcStopLossPips.

Last edited by Roger09; 12-11-2008 at 07:11 PM.
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
  #15 (permalink)  
Old 12-11-2008, 07:44 PM
Senior Member
 
Join Date: Dec 2006
Posts: 110
dwmcqueen is on a distinguished road
pp is Point. The way the logic is working, though, this is getting executed:

CalcStopLossPips = StopLossSell;
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #16 (permalink)  
Old 12-11-2008, 08:29 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
OK, how much is StopLossSell?
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
  #17 (permalink)  
Old 12-11-2008, 08:31 PM
Senior Member
 
Join Date: Dec 2006
Posts: 110
dwmcqueen is on a distinguished road
It is set at 40.
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #18 (permalink)  
Old 12-11-2008, 09:12 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Add
Print("SL: ", NormalizeDouble(Bid + (CalcStopLossPips * Point), Digits));
and show me your logs when you have an error.
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
  #19 (permalink)  
Old 12-12-2008, 02:17 AM
Senior Member
 
Join Date: Dec 2006
Posts: 110
dwmcqueen is on a distinguished road
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: last error: 130
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Failed trade: OP_SELL USDJPY@105.63000000 tp@105.57000000 sl@105.66000000
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Failed to execute OP_SELL, after 0 retries
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Non-retryable error: 130
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: OrderSend error 130
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: About to attempt a OP_SELL 4.00000000 lots @105.63000000 sl:105.66000000 tp:105.57000000
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: SL: 105.66
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Digits: 3
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Bid: 105.630
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: TP: 105.570
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Sell Stoploss: 105.630
2008.12.11 20:15:47 2008.09.17 00:00 FBMSoftwareEA USDJPY,H1: Alert: SELL
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #20 (permalink)  
Old 12-12-2008, 06:32 AM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
I think you already understood your problem. You have Digits=3 and SL=40, it's too little. You have to set minimum SL(I don't no exactly your value) +Slippage.
You can check this value:
Print("Minimum SL - ",MarketInfo(Symbol(),MODE_STOPLEVEL));
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

Tags
"order send error 130", error 130, ERR_INVALID_STOPS, Order Send error 130, order send error 131, OrderSend error 130, error 130 invalid stops, MT4 error 130, metatrader error 130


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: Invalid Integer Number As Parameter secxces Questions 4 05-25-2006 03:50 PM
invalid stop driving me nuts caldolegare Expert Advisors - Metatrader 4 11 05-04-2006 09:03 PM
invalid account huhenyo Metatrader 4 4 04-03-2006 08:37 PM


All times are GMT. The time now is 04:34 AM.



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