lbranjord
Well-known member
- Messages
- 453
- Likes
- 15
Below is most of the code from an EA I'm working on. I keep getting the OrderSend 130 even though I know my stop loss and entry should be ok! Anyone know what the problem is? I'm thinking some kind of error with the doubles. It's only opening half the time and other half it doesn't get past the 130 error. This operates on daily time frame so should look at open prices only of the '0' candle.
Thanks guys! let me borrow your brain.
int Symbol.magic=90022;
extern double Lots=0.05;
int Slippage=3;
int start()
{
if(Volume[0]>1) return;
CloseAll();
SetNew();
return(0);
}
//+------------------------------------------------------------------+
void SetNew(){
double high=iHigh(NULL,PERIOD_D1, 1);
double low=iLow(NULL,PERIOD_D1,1);
OrderSend
(Symbol(),OP_BUYLIMIT,Lots,high,Slippage,low,0,"Big Ben Making dollars.",Symbol.magic,0,Blue);
OrderSend
(Symbol(),OP_SELLLIMIT,Lots,low,Slippage,high,0,"Big Ben Making dollars.",Symbol.magic,0,Blue);
Thanks guys! let me borrow your brain.
int Symbol.magic=90022;
extern double Lots=0.05;
int Slippage=3;
int start()
{
if(Volume[0]>1) return;
CloseAll();
SetNew();
return(0);
}
//+------------------------------------------------------------------+
void SetNew(){
double high=iHigh(NULL,PERIOD_D1, 1);
double low=iLow(NULL,PERIOD_D1,1);
OrderSend
(Symbol(),OP_BUYLIMIT,Lots,high,Slippage,low,0,"Big Ben Making dollars.",Symbol.magic,0,Blue);
OrderSend
(Symbol(),OP_SELLLIMIT,Lots,low,Slippage,high,0,"Big Ben Making dollars.",Symbol.magic,0,Blue);