Need a little help with my code of open breakout on SAF40

Forums ProRealTime English forum ProOrder support Need a little help with my code of open breakout on SAF40

Viewing 8 posts - 1 through 8 (of 8 total)
  • #105675

    Hello Can someone please assist me with my code..
    I run it on South african 40.. But I want it to open a buy or sell when it breaks the high or low of the 8:55 candle on 5 min chart.
    I dont know how to change the code so that when price moves past the high or past the low it opens a order in that direction. So far all i could put together is this code below ehich opens a trade once the candle closes but i want it to place a trade in the candle thats busy breaking high or low not after close.

    Please help me change the code to be able to do it.

     

    #105690

    Replace lines 58 and 66 with pending orders, instead of at-market orders:

    In this case you won’t even need lines 56-57, 59-61, 64-65 and 67-69.

    #105793

    Hi Roberto

    Thanks for the help.. Now it buying at the right place  but It keeps on placing orders through the day. I just want it to do on 1 trade per day.. Just the 9 O clock trade en when it closes it must do nothing for the rest of the day. Can you help me with this?

     

    Thanks

    #105795

    At line 10 add:

    This should do, since no trade will ever enter at a negative price. Next morning, AT STARTTIME new values will be set to start trading again.

    #105797

    You don’t say what time frame you are running this on. In one of your other similar topics you were asking for one pending order to be cancelled if the other one is filled. In the code you have posted here are you aware that if you run it on a say a 15 minute time frame then you will have both orders on the market at the same time and if one is filled the other one will still be on the market until the current fifteen minute bar closes? This means that at volatile times you could open a long and then have it close with a short order fill before the fifteen minute candle closes.

    #105809

    With that SL & TP it’s quite difficult that an order opens and closes on the same bar.

    #105815

    My comments weren’t really regarding TP and SL but I now see that I misread the code and it is actually only placing one pending order at a time and not the two that I thought it was. Totally my mistake for mixing up topics by Lombard974.

    #105823

    Thank you guys for the reply.. The code I put together here was a mix of a few forums.. I am running it on 5 min time frame.. I dont want it to place 2 pending orders anymore just open a trade when 5 min candle breaks the high or low at 8:55.  The code above opens a trade but waits for the close of the first 5min candle 9:05. But thats sometimes a little late.. some trades on SAF40 I close manually 9:02 because price moved fast.. So this is what I am aiming for- High low break of 8:55 candle when market opens at 9:00. Then it must place no other trades- So far the code and trailing works well but if i can get it to activate a trade before the 9:05 candle closes the profit potential is allot higher.
    I will try the above suggestions.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)

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