BreakEven & Trailing Profit: complete function

Viewing 3 posts - 136 through 138 (of 138 total)
  • Author
    Posts
  • #249988 quote
    Wim
    Participant
    Junior

    Well, not sure I’m happy with this. This thread is titled “breakeven-trailing-profit”. It was exactly this phenomenon of putting Trailing Profits above the price (for Longs) that works like a charm. And now, this phenomenon is killed and this code turns into an ordinary trailing stop. You don’t need the last min(close…) or max(close…) modifications to prevent trailing profits, if that’s what you really want. Just fill in “1” instead of “100” in the next line:

    ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))         //make sure ProfitPerCent doess not exceed 100%

    I guess the limit orders were introduced for a reason. When you eliminate the possibility of Trailing Profits above the price, no need for limit orders anymore. The whole IF … ELSE … ENDIF around stop and limit order can be replaced by one line “SELL AT SellPrice STOP” for longs. That’s what I call an ordinary trailing stop.

    Personally I will continue with the extra-ordinary Trailing Profit version. In backtest I have seen 75% of the Limit orders (trailing profit) being granted, only 25% needed the SafetyNet I introduced. Nice bunch of bonusses compared to a trailing stop where you always return a bit to the market. I simplified the part with Steps and Chunks and no longer let BasePercent also influence the increments. Same good results, but simpler and less parameters for the optimiser.
    Thanks for your effort.

    #249990 quote
    SnorreDK
    Participant
    Junior

    Hi wim.

    Can u post the hole code including ur modifications?

    #249997 quote
    Wim
    Participant
    Junior

    Sure @SnorreDK. Please find attached the ITF and a little document with a explanatory diagram and some screen captures.
    I also deleted the lines that, in the original code, update the stop loss after accumulating new positions. My strategies do not accumulate new positions, so I never studied this part of the original, nor checked its correct working. If you want it back, you know where to get it.
    Have a peek in the document, just 3 pages, mainly screen captures, not too much reading.

    GraHal thanked this post
Viewing 3 posts - 136 through 138 (of 138 total)
  • You must be logged in to reply to this topic.

BreakEven & Trailing Profit: complete function


ProOrder support

New Reply
Author
Summary

This topic contains 137 replies,
has 23 voices, and was last updated by Wim
5 months, 1 week ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 03/18/2019
Status: Active
Attachments: 25 files
Logo Logo
Loading...