Limit buy order below the low of current bar at close

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #203367 quote
    pointofbrew
    Participant
    New

    Hello all!

    Hope someone is able to help me on this.

    I’m trying to place a buy limit order at the low of current bar when the bar closes, and have the limit order deleted if it’s not filled within the close of the following bar. If limit order is deleted, then repeat the process as long as conditions to buy are met.

    #203370 quote
    PeterSt
    Participant
    Master

    Hi there,

    A Limit order (and Stop order) will delete themselves at the close of the bar where they initiated. So it is the other way around : you must repeat them (at the same level or an other level) if you want to sustain them.
    Does that answer your question ?

    Regards,
    Peter

    #203374 quote
    pointofbrew
    Participant
    New

    Thanks for your reply.

    I was not aware of that. Don’t know how I would write the code for this though. Would you be able to help?

    #203379 quote
    PeterSt
    Participant
    Master
    YourPrice = Close - 2   // Just an example !
    
    If Not OnMarket then
      Buy LotSize Contract at YourPrice Limit   // Repeat this each call of your code (hence at each bar).
    Endif

    Manually it could look like you see below (Koop = Buy).

    pointofbrew thanked this post
    image_2022-11-01_190012820.png image_2022-11-01_190012820.png
    #203382 quote
    pointofbrew
    Participant
    New

    Thanks a lot!

     

    How do I repeat it at each call?

    #203385 quote
    PeterSt
    Participant
    Master

    With the lines of code I showed – this goes automatically. Until Not OnMarket is not true any more. Then the position is there, for you to decide when to close it.
    So now you need to learn the PRT language a little (or more); you can search for YouTube tutorials. Like you see in the middle at the bottom (below).

    Have fun !

    pointofbrew thanked this post
    image_2022-11-01_193001724.png image_2022-11-01_193001724.png
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Limit buy order below the low of current bar at close


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/01/2022
Status: Active
Attachments: 2 files
Logo Logo
Loading...