it was working perfectly until last week, now it sometimes work and other time its not
working. Log says it sent entry order, shows alert , but nothing appears on orders table.
does not show 'entry order successful' in log thou. can but orders manually.
so far i have, rewritten strategy, used different computer and different internet connection.
disabled firewall etc. contacted fxcm support (they dont give any support and dont know
whats wrong)
i'm using modified inbuilt fractal alligator strategy, on GER30, USoil, and EuSTXX50 instruments.
added two extra indicators and fixed trailingstop and order expiry options (day and gtc)
this is the set entry section of strategy, added fixed trailingstop and order type "DAY" and "GTC" option.
- Code: Select all
-- Create new order (or to replace deleted)
local valuemap = core.valuemap();
valuemap.Command = "CreateOrder";
valuemap.OrderType = orderType;
valuemap.OfferID = Offer;
valuemap.AcctID = Account;
valuemap.Rate = rate;
valuemap.BuySell = BuySell;
valuemap.Quantity = Amount * BaseSize;
valuemap.GTC = instance.parameters.OrderType1;
valuemap.CustomID = CID
if SetLimit then
-- set limit order
if BuySell == "B" then
valuemap.RateLimit = rate + Limit;
else
valuemap.RateLimit = rate - Limit;
end
end
if SetStop then
-- set stop order
if BuySell == "B" then
valuemap.RateStop = rate - Stop;
else
valuemap.RateStop = rate + Stop;
end
if TrailingStop then
valuemap.TrailStepStop = instance.parameters.TrailingPips;
end
end
if (not CanClose) and (SetStop or SetLimit) then
valuemap.EntryLimitStop = 'Y'
end
local success, msg;
success, msg = terminal:execute(102, valuemap);
if not(success) then
terminal:alertMessage(instance.bid:instrument(), instance.bid[NOW], resources:get("R_FailedCreateLimitOrStop") .. ": " .. msg, instance.bid:date(NOW));
end
end