DislikedThe 'smart money' expects BOJ to intervene tonight. Those rsi readings do not often go this low.
Ignored
Trading correlation pairs by using the other pairs 843 replies
Export All pairs or selected pairs to .csv with script 3 replies
Pairs of Currency Pairs 4 replies
Trending Pairs / Ranging Pairs 0 replies
Robot trading 120 replies
DislikedThe 'smart money' expects BOJ to intervene tonight. Those rsi readings do not often go this low.
Ignored
DislikedYeap.
You gotta admire their business model, drive the Yen high in their trading session (making millions) and then drive it back down throughout the day to keep interest rates down and exports popular.Ignored
DislikedThar she blows?
Incidentally guys, I just got that invalid trade parameters error on demo - I had to work quite hard to send the sell basket manually.
Still don't know what the problem is, mind.
Ignored
DislikedSteve,
In case it helps, here is copy of my terminal with the error 4051, version Original 1.3 on Alpari UK from this evening.
I noticed before the error an 'invalid lots amount' warning, not sure if this means anything ...Ignored
bool SendTrade(int type, string symbol)
{
// Attempts to place a trade according to type, i.e.
// 0 = OP_BUY
// 1 = OP_SELL
// 4 = OP_BUYSTOP
// 5 = OP_SELLSTOP
// Check spread
if (MarketInfo(symbol, MODE_SPREAD) > MaxSpreadAllowed)
{
string rr;
if (type == 0) rr = "Buy ";
else rr = "Sell";
Alert(symbol, " scooby-doo basket ", rr, " cancelled; spread too wide");
return(false);// Spread too large, so abort send
}//if (MarketInfo(NULL, MODE_SPREAD) > MaxSpreadAllowed)
//Convert sl and tp from integers to doubles
double ConvertedStopLoss = EmergencyStopLoss;
double ConvertedTakeProfit = EmergencyTakeProfit;
if (ConvertedStopLoss > 0) double sl = NormalizeDouble(ConvertedStopLoss * point, digits);
else sl = 0;
if (ConvertedTakeProfit > 0) double tp = NormalizeDouble(ConvertedTakeProfit * point, digits);
else tp = 0;
RefreshRates();
// Buy trade
if (type == 0)
{
double TradePrice=ask;
double Stop = NormalizeDouble(ask - sl,digits);
double Take = NormalizeDouble(ask + tp,digits);
}//if (type == 0)
// Sell trade
if (type == 1)
{
TradePrice=bid;
Stop = NormalizeDouble(bid + sl,digits);
Take = NormalizeDouble(bid - tp,digits);
}//if (type == 1)
//Calculate differential lot size
double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
//Make sure that there are not too many decimal places in the result of the calculation
int decimals;
if (LotStep >0 && LotStep < 0.1) decimals = 2;//0.01
if (LotStep >0.09 && LotStep < 1) decimals = 1;//0.1
if (LotStep >0.9) decimals = 0;//1
double PairBid = MarketInfo(symbol, MODE_BID);
double Lot = (NormalizeDouble(BaseLot * (strongest / PairBid), decimals));
//Non ECN crook
if (!CriminalIsECN) int ticket = OrderSend(symbol,type, Lot, TradePrice, 50, Stop, Take, TradeComment, MagicNumber,0, CLR_NONE);
//Is a 2 stage criminal
if (CriminalIsECN)
{
ticket = OrderSend(symbol, type, Lot, TradePrice, 50, 0, 0, TradeComment, MagicNumber,0, CLR_NONE);
if (EmergencyStopLoss != 0)
{
if (ticket > 0)
{
bool result = OrderModify(ticket, OrderOpenPrice(), Stop, Take, 0, CLR_NONE);
if (!result)
{
int err=GetLastError();
Alert(Symbol(), " ", type," TP order modify failed with error(",err,"): ",ErrorDescription(err));
Print("Order send failed with error(",err,"): ",ErrorDescription(err));
}//if (!result)
}//if (ticket > 0)
}//if (Take != 0)
else Print("Skipping OrderModify because no SL or TP specified.");
}//if (CriminalIsECN)
//Error trapping for both
if (ticket < 0)
{
err=GetLastError();
Alert(symbol, " ", type," order send failed with error(",err,"): ",ErrorDescription(err));
Print("Order send failed with error(",err,"): ",ErrorDescription(err));
if (err == 146) Sleep(1000);//Trade context busy error, so sleep 1 second to give it a break
return(false);
}//if (ticket < 0)
else return(true);
}//End void SendTrade(type)