How to limited one stop order per day?

Forums ProRealTime English forum ProOrder support How to limited one stop order per day?

  • This topic has 16 replies, 3 voices, and was last updated 6 years ago by avatarBC.
Viewing 15 posts - 1 through 15 (of 17 total)
  • #110938
    BC

    Hi PRT Master

     

    I copy the syntax from below Blog to control the trade (Stop order, Long & Short)  per day, but I found it will out of order if the 1st trade close at the 1st bar, is there any solution to solve this issue?

     

    https://www.prorealcode.com/blog/automated-breakout-trading-strategy-french-cac40/

     

    Thanks.

    #110942

    So you want to know if a pending stop order has triggered during the day and even if it has triggered and closed during the same bar?

    #110996
    BC

    Hi Nicolas

     

    Yes and sorry for my poor description.

     

    Thanks

    #111004

    Hi BC I notice you are from HK as well.

    Feel free to contact me at [deleted by moderator] for more discussion and sharing of ideas.

    btw i leave the message here because i don’t see any inbox function on this forum, or have I missed it?

    #111019

    @solar Sorry but there is no private messaging in the forum and sharing personal link is not allowed.

    @BC You can use the snippet below, it returns a boolean if we were at market on the previous bar, and even if an order has opened and closed during it.

     

     

    #111033

    So How can I contact somebody without violating the forum rules?

    #111049

    If BC is ok, I can make it possible for you to contact him off-forum.

    #111053
    BC

    Thanks Nicolas, will try your code tonight. Also I am OK let Solar contact me off forum.

     

    Nice to meet you, Solar.

    #111076
    BC

    Hi Nicolas

     

    I tried but not work on below code, it seem [wasonmarket] will return=0 after a position close.

    What I did wrong?

     

    Thanks

     

     

    #111094

    You didn’t adapt it correctly to your own strategy, because you should only reset the variable one time each day:

    delete lines 46 and 47 and put that at the beginning of the code:

     

     

    #111133
    BC

    Hi Nicolas

     

    I tried to follow your instruction, but seem not work correctly.

     

    Thanks

     

     

    #111154

    Because you included the condition into “tradingtime”, so the test cannot be made outside the time conditions. Anyway, I also made a small add to the condition to check another ‘wasonmarket’ situation that was not included.

     

    1 user thanked author for this post.
    avatar BC
    #111216
    BC

    Thanks Nicolas, but I found it still open another trade if 1st trade close on same bar.

    #111225

    Seems to work well on the first trade at the left of the screenshot. How was closed this one you mentioned because I do not see any square (stoploss) or cross (code exit) symbol on the chart?

    #111252
    BC

    Most 1st trade on 1st bar can trigger [wasonmarket], but sometime not, very strange.

Viewing 15 posts - 1 through 15 (of 17 total)

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