custom strategy not putting on Entry orders

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

custom strategy not putting on Entry orders

Postby arvi87 » Mon Jun 29, 2015 4:27 am

suddenly all my running strategies are not able to set Entry orders.

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

arvi87
 
Posts: 2
Joined: Mon Jun 29, 2015 4:07 am


Re: custom strategy not putting on Entry orders

Postby arvi87 » Wed Jul 01, 2015 2:07 am

last two days its working again, works nice in backtest also. i guess it is server problem
arvi87
 
Posts: 2
Joined: Mon Jun 29, 2015 4:07 am


Return to Discussions

Who is online

Users browsing this forum: No registered users and 12 guests

cron