MinStopDistance and rejected orders

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37455 quote
    Despair
    Blocked
    Master

    Following situation, i buy a security with a minimum stop distance of say 10 points. Then i want to use “set stop ploss 10” to set my stop loss. The commands are right after eachother in my code. Now my bot generate a buysignal to buy at market on the next candle. The bot buys but experience some slippage so the actual candle is trading below the buy-price. Then tries my bot to set the stop loss 10 points below my buy-price but because the current candle trades lower the stop order is rejected because it is closer than the 10 points minstopdistance. This happens 12 times (12 seconds in a row) and the whole trade is canceled.

    How can one approach this problem. We always only get the info from the last candle but not the current that is in the making, am i right? So how can one avoid this rejection-problem. Of course setting a much wider stop would solve the problem but is there a better solution?

    #41930 quote
    Seb
    Participant
    Average

    Do I understand it correctly that you end up in a position that’s designed to have a stop but the stop is missing? Have you tried rebuilding the code of the stop to a section that uses “if longonmarket” and a stop sell order condition (for long)? You can still set an emergency wider stop that meets the minimum stop criterium.

    #41933 quote
    Despair
    Blocked
    Master

    No, you understood me wrong. There is no position opened at all, the order is rejected but forget about it (this was an old post) I decided not to trade the security in question but thanks anyway.

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

MinStopDistance and rejected orders


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Despair @despair Blocked
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Despair
8 years, 7 months ago.

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