orders only passed at the closing of the candle?

Forums ProRealTime English forum ProOrder support orders only passed at the closing of the candle?

  • This topic has 24 replies, 6 voices, and was last updated 4 weeks ago by avatarWim.
Viewing 10 posts - 16 through 25 (of 25 total)
  • #230810

    that shows exact candle times.

    Ah right … gotcha now!

    Too many eggs and not enough coffee … I’ll have to wait until morning now as I never drink coffe with caffeine after 2pm ish.

    Happy Easter anyway!!

    1 user thanked author for this post.
    #230813

    Ha ! Always glad that sports like you are around !
    Coffee is around over here all day (typical Dutch). Until … yea, until somewhat more after (Easter) dinner. Then a nice whiskey is pored. Still struggling with that in preparation of more eggs.

    #230816
    Wim

    I am Dutch too, like Peter. But never drinking coffee I was forced to leave the country a long time ago.
    But back to business. I prepared another picture, showing one trade on chart and the corresponding line from the Detailed Report. All backtest, not live trading!
    The trade is opened with the following command:
    sellshort posSize contracts at entryPriceS stop

    The exit this time is due to a fixed distance stop loss of 5 points:
    set stop loss slDistance

    The little triangles on the chart are, for the entry, at the low end of the bottom wick, and for the exit somewhere full in the body of the candle. I call that “they are not at the open of the candle”. But they are exactly ont the levels I wanted them.
    When looking at the timing data given by ProBacktest, be it in the Detailed Report (line in picture below chart), in the exported csv or when hoovering over the entry and exit symbols on the chart, they are ALWAYS 7:05 for entry and 9:00 for exit. The start time of the respective candles.
    I am on ProRealTime Complete with IG. Maybe we found a difference in behaviour between ProRealTime Complete and Premium? Wouldn’t be the first.

    #230820
    Wim

    I like to add that in my opinion the commands set stop loss, take profit and breakeven work like a charm. The backtest timing data (shown to me, and shown to you in previous post) might suggest that all order executions are taking place at the open of a candle. But don’t worry, as soon as you activate your strategy on demo or live account, the timing data will seldomly show the exact opening time of a candle for order execution (conform the live screen capture shown by Peter).

    #230821

    OK, thanks to your tremendous help I have been able to assess that while SL and TP are indeed triggered inside a candle, instruction such as “if close crosses under… then sell at market” are only triggered at the close of each bar AND MOREOVER, THAT THEY ONLY TAKE EFFECT AT THE OPEN OF THE FOLLOWING BAR, which is even worse. I am curently comparing the results between the two methods. I have two additional concerns:

    1. I calibrate my custom SL and TP not relative to the entry point of the position, which is the open of the candle following the triggering condition, but relative to the theorical entry point of the position, which is the closeof the candle when the triggering condition was fulfilled. Of course there’s not much difference but it does marginally improve the strategy. How can I translate this logic into simple SL/TP instructions?
    2. Another reason I wanted to avoid SL/TP was because I feared brokers, even established ones such as IG, could be “chasing stops”. Is it a real concern nowadays or am I just being paranoid?

    One again, thanks for your help!

    #230823

    juld, a few answers from my side, each in a different post (and taking my time for it).

     

    Another reason I wanted to avoid SL/TP was because I feared brokers, even established ones such as IG, could be “chasing stops”. Is it a real concern nowadays or am I just being paranoid?

    This happens for real, and it is up to you whether it bothers you. It is also up to you whether you are attractive to the buyers (this should be related to the amounts and whether other good offers exist at the particular moment). But there is another more important thing : hide from the broker.
    They too – or especially them – are able to see your pending orders. Is that too large ? then at least IG will go in manual mode which means you will get a worse price (because of so-called slippage). And so I have learned to cope with all via Market Orders. This is almost exclusively everywhere by now. And Yes, this means a worse price, but nothing is worse per se when you anticipate it. This means, for example, that Market Orders will imply more trades (the opportunity won’t disappear by not-filled Limit/Stop orders). And more trades mean more money (but make them winning trades 😉 ).

    The actual reason I started to really do this for “strategy” is technical : with IB too many pending orders fail because of the too slow response from IB vs the time the pending order exist (which mostly is 1 minute in my case, with “seconds” as a definite no-go to begin with). Thus, if the broker does not respond within the time your candle lasts (which can also be a few seconds in a 1 minute candle because the price is touched right before the end of the candle (time) !), the System is thrown out by PRT (communication error with the broker). With IG this is no problem, but with IG the issue is as described above : they watch your orders when somewhat larger. This is not a problem with IB, BUT they have hard limits when not arranged for professionally (limit is 6M USD).

    Peter

    #230828

    For Flying Dutchman @Wim :

    This is from a Backtest in V12 (but in V11 it will work too). This is a Limit (Entry) order … I can only show the same as you, Wim. So no precise time for the Backtest Entry (or Exit for that matter).
    Like with you, indeed the 2nd picture shows that in reality the opening (or close) is in-bar. See the triangles. The green is from Live. Blue is backtest in retrospect.

    I can’t tell whether tis has changed. Maybe I drank to much (coffee or otherwise). It is hard(er) for me to test this in V11 because there (which is IB) all works with Market Orders so I can’t check with reality (past Live).

    Anyway summarized and what keeps on working : watch the triangles. They may not 100% resemble (due) Live, but for 1 minute bars I am 99% of times fine (Backtest and Live will happen in the same bar).

    #230831

    I calibrate my custom SL and TP not relative to the entry point of the position, which is the open of the candle following the triggering condition, but relative to the theorical entry point of the position, which is the closeof the candle when the triggering condition was fulfilled. Of course there’s not much difference but it does marginally improve the strategy. How can I translate this logic into simple SL/TP instructions?

    Suppose you use TradePrice to (virtually) work relative to the opening of the position, then saving the price in a variable at the opening of the bar which is going to fulfill the position, allows you to replace TradePrice with that variable.
    Thus currently you do something in order to work relatively to the opening of that candle, and that something has to be replaced by

    I know, you will deem this obvious. But it requires your literal StopLoss and Target code to replace it with what’s required here.
    Btw, I never come up with real example codes – others may have the better focus for it (me typing forum posts in between backtests).

    #230832

    instruction such as “if close crosses under… then sell at market” are only triggered at the close of each bar AND MOREOVER, THAT THEY ONLY TAKE EFFECT AT THE OPEN OF THE FOLLOWING BAR, which is even worse.

    Indeed. And therefore it requires other trickery to achieve the same.
    You could read back on the post from JS to see what could be done by means of using different TimeFrames in your code (he uses it to Buy, but it can be used to Sell (which is what you asked for) just the same). Please notice that in the very end all such solutions with using more TimeFrames, end up in drama, already because you can’t sufficiently backtest any more (like 1 second gives you 3 weeks or so). Also, you can’t trigger (with) your normal crossing any more, because its behavior will be different. However, you can be faster. Thus, while the crossover will occur on the (s)lower TimeFrame as usual, you won’t need to wait for the opening of the next long TF bar to have the entry. But you’d really enter trickery territory of which some stipulate it can’t be done. …  😉

    It may come across as pompous, but from the start of your topic I would try to approach your literal issue (like quoted again above) by the means of chance it would cross at the upcoming bar. I won’t claim you can do it, but I coincidentally claim that @JS can (call it extrapolation). I name him, because he implied the unsolvable in this realm (but use a smaller TF). Use a spline or something. 😆 No guarantee that the lines to cross both go there indeed, but you can predict the future from a small past. If it works out in 90% of cases, you earn quite some more (on a better price) and got theoretically rid of the psychologically wrong thing of knowing that you are always being one candle too late.
    But would it be worth it ? I myself don’t use any indicators at all, so not for me for predicting crossings. I could use something like this though – it’s a nice technical means which could be used in all sorts of areas.

    #230842
    Wim

    Hi @PeterSt, no need for a Fokker Friendship, Fiat Doblo Cargo was good enough 🙂
    I am not sure what triggered you to talk about v12 versus v11 (the previous version with less bugs), I’m on 12 also. But you are surely on the Premium version (1M candles history), whereas I am on the Complete version (200K candles history). I see your answer as a confirmation that the Backtest Detailed Report on Premium is equal to that on Complete. Thanks.
    Maybe I will launch my strategy on ProOrder shortly to show a capture with entry and exit times different from the backtest ones.

Viewing 10 posts - 16 through 25 (of 25 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login