ProBackTest Buy On Market setting

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

    I’m trying to write a ProBackTest script to accurately reflect an Intraday (1 minute time frame) Strategy using End of Day Pivot Lines. However the BUY AT MARKET function enters trades at the open of the following bar. Some 1 minute bars are over 100 pips long such as the GBP/USD 13:30GMT 1 minute bar on Tuesday 13th December 2022 which went through R1 and R2. I did this trade for real and made a 60 pip profit in 20 seconds however when I try and program ProBackTest to do the same trade it waits until the next bar opens to trigger the order missing out on 78 pips and resulting in a loss. What setting or Function needs to be used so that ProBackTest can enter trades at the ACTUAL required level so it TRULY backtests strategies accurately?

    Really appreciate any advice on this.

    #206106 quote
    JS
    Participant
    Veteran

    Hi @nick147

    If you want the Buy to take place at a “resistance level” then you have to use (pending) Stop orders…

    For example:

    If Close < R1 then

    Buy 1 contract at R1 STOP

    EndIf

    This stop order is placed every bar (minute) as long as Close < R1 and is executed when the Close passes through R1…

    #206136 quote
    nick147
    Participant
    New
    Hi @JS Thank you for your reply. I tried your suggestion of using pending STOP orders but ProBackTest still uses the NEXT 1 minute bar which is too late. Is there a way for ProBackTest to use the SAME bar and the ACTUAL order price of the buy order? Some 1 minute bars are over 100 pips long such as the GBP/USD 13:30GMT 1 minute bar on Tuesday 13th December 2022 which went through R1 and R2 so when trying to buy AT R1 waiting until the next bar to open well above R2 is too late and misses the trade? Really appreciate any advice about this.
    #206151 quote
    JS
    Participant
    Veteran

    Hi @nick147

    That is very strange, can you show a piece of code including the STOP orders…?

    #206172 quote
    nick147
    Participant
    New
    Thank you @JS so much I finally got it to work.
    JS thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

ProBackTest Buy On Market setting


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
nick147 @nick147 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by nick147
3 years, 2 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 12/20/2022
Status: Active
Attachments: No files
Logo Logo
Loading...