Why are my trades closing after 0 bars with a stop loss?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23166 quote
    n79xt
    Participant
    New

    Hi,

    When I backtest my strategy with a stop loss command (SET STOP PLOSS 50 for example), in the detailed report I get several trades which close after 0 bars (on the same day) with a loss equivalent to the stop loss (see attached image). However if I remove out the stop loss command, these trades seem to proceed through but they don’t necessarily enter a large loss – sometimes they even enter a profit. The backtesting period I am using is Daily, and I force all my trades to close after N number of days (using BARINDEX-TRADEINDEX(1)>5 for example).

    Could I please get an explanation as to why ProRrealTime is forcing some of my trades to close on the same day after 0 bars, rather than closing my trades N days later?

    This is the code I have that exits all my positions:

     

    // Conditions to exit ALL positions
    
    IF ONMARKET AND closeDate THEN
    SELL AT MARKET
    ENDIF

    Thanks and I appreciate your help.

    trades-closing-after-0-bars.jpg trades-closing-after-0-bars.jpg
    #23169 quote
    GraHal
    Participant
    Master

    Hi N

    Are not the Trades getting stopped out .. as in price drops at some point by 50 points and Trade exits? Because Trade is stopped out in same day as entry then it shows as zerobar because that daily bar did not finish before getting stopped out?

    Cheers
    GraHal

    #23182 quote
    Big Hug
    Participant
    Average

    I agree with GraHal ..

    If for example, take the 14th June 2016

    Open 6018.8 H 6041.8 L 5905.6 C 5915.6

    Open to Low = minus 113 Points

    High to Low = minus 136.20

    It obviously depends on what the entry conditions are,  but if it moves more than 50 points from the trade entry point & as specified by your stop – the trade will close out.

    You could try widening your stop to 150 points and then see how this computes.

    My usual rule of thumb : The longer your time frame – the larger your stops need to be ( & the bigger your bank needs to be)

    Nicolas thanked this post
    #23919 quote
    n79xt
    Participant
    New

    Thanks for the reply, guys. Turns out my stop was indeed getting triggered far often than required during intraday hours even on a daily period.

    I consider this matter to be solved now.

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

Why are my trades closing after 0 bars with a stop loss?


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
n79xt @n79xt Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by n79xt
9 years ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 01/30/2017
Status: Active
Attachments: No files
Logo Logo
Loading...