Trying to make the TradeTrailLock work

Posted By: nanotir

Trying to make the TradeTrailLock work - 10/10/15 22:36

Hi

I have developed a TMF function where if the price reaches a certain value then the TradeStopLimit is set a bit bellow that value and it works.
However, I want to add that once a value is reached the Profit is lock so I have used TradeTrailLock but I cant make it work. I tried to plot the TradeTrailLock to see what is actually going on but I could not neither frown

My whole idea is like:

if the price is bellow A then do nothing
if the price is above A then use A as stop and follow the price curve so that an small reduction of the profit close the position.


Any ideas? laugh
Posted By: boatman

Re: Trying to make the TradeTrailLock work - 10/10/15 23:30

If you post your script, it would make it a lot easier to help you out.

Have you set both the Stop and Trail variables? They are both required for TrailLock.
Posted By: nanotir

Re: Trying to make the TradeTrailLock work - 10/11/15 08:44

The script is a mess but I will get something from it in post it over here.

I did not set the Stop and Trail because I do not want to trail the price until I reach a certain price. I will try to set them from that point. Maybe so it will work
Posted By: nanotir

Re: Trying to make the TradeTrailLock work - 10/13/15 00:12

Maybe it could help if I know how the trailLock is calculated from the trail.
My problem is that I do not want to trail the price at all. Only when it reach a certain value.
So if I do not want the value trail to influence a trade I can write like Trail = 100*PIP; but then, when I use TrailLock=90; there is no effect at all. However if I write Trail = 4*PIP; then I can see an effect from TrailLock but if I write that trail then the trade is closed before I want. So this is my dilema. How to trail from a certain level and how to lock the profits from that level too?
Posted By: roshanbaba

Re: Trying to make the TradeTrailLock work - 07/11/16 09:57

i am also facing the same problem in the matter of trailing..cant make the traillock work ..
Posted By: MatPed

Re: Trying to make the TradeTrailLock work - 07/11/16 12:31

The easiest way is to create a TMF that does what you want. You can find examples in the manual at the end of the Trade Functions section. Sorry but I can not direct link it. The manual contains a lot of useful examples while is not the easiest to be navigated and searched.

HtH Ciao
Posted By: jcl

Re: Trying to make the TradeTrailLock work - 07/11/16 13:08

If you only want to lock profit when a certain level is reached, just set Trail and TrailLock accordingly. But for more complex tasks you need indeed a TMF.
© 2024 lite-C Forums