Problem with Stops being cleared

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21280 quote
    Rien
    Participant
    New

    Hi All

    I’ve learned so much from all of you on this forum so for that thanks a lot!

    Today I hope that someone can help me with a specific query though. I’ve coded most of my strategies with progressive stops. As my profit runs up I’ve adjusted stop loss to lock in more profit. Every now and then, I have a problem where my stops suddenly disappear though. I’ve let’s say upped it twice and thereafter I suddenly have no stop loss and I’ve lost big. Means I can’t really let an Algo run unattended either. Does anyone know of this problem? Is it perhaps true that when target is adjusted (limit order), a stop loss order must also be set?

    Thanks

    Rieneke

    #21298 quote
    Nicolas
    Keymaster
    Master

    Without the code itself, it’s a little bit tricky to answer precisely. However, did you looked at your orders history (CTRL+O), to see the reasons why the stoploss didn’t move correctly?

    If you are using STOP pending orders to set your stoploss, remember that you need to set them at each new candlestick, because this kind of orders only last 1 bar (expiration).

    #21300 quote
    Rien
    Participant
    New

    Thanks, Nicolas. That is my answer. I didn’t know that they expire! Thanks

    #21306 quote
    Rien
    Participant
    New

    Sorry, thinking further. They only get cleared some of the time, others stay active. Below an example of the code used.

    if tradeext = -0.8 and lprice < (positionprice - 355) then
     tradeext = -1
     exitshort  at positionprice - 195 stop
    endif
    #21307 quote
    Nicolas
    Keymaster
    Master

    Pending orders that stay active are still alive because your condition tested in your first line of you example is still true.

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

Problem with Stops being cleared


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Rien @rien Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Nicolas
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/16/2017
Status: Active
Attachments: No files
Logo Logo
Loading...