Trying to code a "trailing" Take Profit

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #88951 quote
    PastaPesto
    Participant
    Veteran

    Hi,

    I am struggeling trying to code a kind of “trailing” TP but just cannot get it to work. My thought about this is the following:

    1. Price misses my Take profit and goes the wrong way.
    2. I dont want to use a traditional Stop Loss. Instead I want to have a trailing TP that moves down when prices reaches a trigger point. In that case the price has a chance of recovering a bit and the loss is a bit less.
    3. If price doesnt reach the new TP, there is a new trigger level lower down and a new TP is set.
    4. It in a way works the same as a trailing SL but the opposite.

    As said my thought is that maybe I can reduce my losses a bit if price recovers a bit before going further down. Maybe 🙂

    I have tried many things but I feel nothing that I can even post here because I havent even been close of solving this. It seems that a Set TP cannot be changed so I tried to use some kind of “newTP”. I couldnt even get the “trigger” to work propably .

    Please take a look at my picture to see what I mean. Do you have any thoughts? Is it worth working on?

    BR

    PastaPesto

    Trailing-TP.jpg Trailing-TP.jpg
    #88975 quote
    robertogozzi
    Moderator
    Master

    You’re LONG, but price does not reach TP (#1). How can a lower price be a new TP (#2) since you’re now suffering a loss?

    #88978 quote
    PastaPesto
    Participant
    Veteran

    Hi Roberto,

    Thank you for your reply. I will try to explain a bit further.

    • 1. The word TP is of course wrong in this situation as it will be a loss, but some also use the word trailing stop loss even though it is not a loss 😊. Have you looked at my picture? I tried to show what I mean there. I can understand it is hard to figure out exactly what I mean, but the price is going the wrong direction and instead of taking a loss at the stop loss level I try to give price a chance of recovering a bit before stopped out.
    • 2 I am suffering a loss, price in the picture moves down when Im long in the  arket.
    #88981 quote
    Vonasi
    Moderator
    Master

    Pending orders won’t work. Sell if close is above your new TP(?) price will so maybe using MTF to trade in a faster time frame would achieve what you want.

    In reality I think you will achieve a big loss as price bounces back and fails to hit your new TP(?) and continues lower and then misses your next new TP(?) on another bounce and so on and so on. In reality you are trying to only cut off four fingers instead of five while catching a falling knife and end up losing an arm instead.

    #88987 quote
    PastaPesto
    Participant
    Veteran

    hahaha, thank you Vonasi for saving me some time as well as a couple of fingers 😂

    Thank you for replying!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Trying to code a "trailing" Take Profit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
PastaPesto @pastapesto Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by PastaPesto
7 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/17/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...