Trailing_Limit_monitor

Strategies are published here.

Moderator: admin


Re: Trailing_Limit_monitor

Postby conjure » Mon Jul 16, 2018 8:32 am

Thank you for all these lines you wrote Apprentice!!!!

I m trying it on a demo account but limit is not moving.
I m uploading a screenshot of settings.
Capture.JPG
conjure
FXCodeBase: Initiate
 
Posts: 135
Joined: Sat Jul 22, 2017 7:27 am

Re: Trailing_Limit_monitor

Postby Reymondpolanco » Mon Jul 16, 2018 6:57 pm

I have the same problem with this similar strategy and no body solve it I wrote like 4 request to solve it and nothing.

viewtopic.php?f=31&t=65947&start=10
Reymondpolanco
FXCodeBase: Initiate
 
Posts: 160
Joined: Sat Jun 17, 2017 3:07 pm

Re: Trailing_Limit_monitor

Postby conjure » Tue Jul 17, 2018 6:15 am

I tried to write to text the trade.Open and trade.Limit
and trade.Limit gives me result of 0

Code: Select all
function CreateController(trade)
    local offer = core.host:findTable("offers"):find("Instrument", trade.Instrument);
    local controller = {};
    controller.TradeID = trade.TradeID;
    controller.TrailingSize = instance.parameters.TrailingStep;
    controller.InitialLimit = math.abs(trade.Open - trade.Limit) / offer.PointSize;
   local file = io.open("trade.Open.txt", "w")
file:write(trade.Open)
file:close()
   local file = io.open("trade.Limit.txt", "w")
file:write(trade.Limit)
file:close()
    return controller;
end

conjure
FXCodeBase: Initiate
 
Posts: 135
Joined: Sat Jul 22, 2017 7:27 am

Re: Trailing_Limit_monitor

Postby Apprentice » Mon Aug 06, 2018 9:18 am

I changed the algorithm a little bit to handle of trades with the limit set after the creation of the trade. I think that was the issue.
Trailing_Limit_monitor_1.lua
(44.1 KiB) Downloaded 582 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 20 guests