Help take position quickly!?

Forums ProRealTime English forum ProOrder support Help take position quickly!?

Viewing 13 posts - 1 through 13 (of 13 total)
  • #107316

    Have a question about how to code so that position is taken faster than the next candle (if possible).

    According to the ring in the chart.

    The price breaks above the blue MA10.

    Right there I want algo take position for buy.

    If it takes position at the next candle it is too late as the course has increased 70 points since.

     

    Is this possible?

    #107318

    Use a pending STOP order. You have to place it every bar you want it on the market as they only last one bar. x is whatever price (worse price than the current one) that you want it to be.

    https://www.prorealcode.com/documentation/stop-pending/

     

    #107319

    Simple answer is both yes and no:

    No its not possible, because you would need to anticipate that move. You need to buy before that big candle happens.

    Yes it is possible, if you go down to a smaller timeframe and start trading it as its breaking out upwards.

     

    Edit: Price breaks over the MA 10 line, but it dosnt actually break above it until the candle finishes, right?

    You dont know if price will close above or below, until the candle finishes.

     

     

    #107320

    You need to use Multi Time Frame support and launch your strategy from a very short TF, say 1 minute or even less, to be able to detect such occurrences almost as soon as they happen.

    The drawback is that your lowest TF becomes the default TF, the one on the chart, thus reducing the number of data history available for backtests.

    #107321

    Something like the above achieves what you are saying you want to do.

    #107325

    Something like the above achieves what you are saying you want to do.

    How can he know when there will be a crossover and at what price?

    #107327

    You and Jebus 89 are correct Roberto – I was forgetting that we do not know what the MA[10] level will be in the next candle when we place the pending order at the end of the current candle. MTF is the only way then by checking the time frame we want the MA[10] in using DEFAULT and then for the trade to be opened in a faster time frame such as 1 second. more coffee needed!

    #107329

    The code look like this.

    Tick by tick.

    Spread=1

    Timeframe 15 min

    I am just started with the code and run a WF just for fun..

    Optimized only om 2019 data.

    The result?

     

    #107331

    Thanks for all the answers 🙂

    #107333

    I think that you will find that the 2 pip trailing stop level will not be allowed by any broker. Check the minimum stop distances for the market you are trading.

    #107334

    This is the MTF version, try launching it from a 1-minute or 10-second TF:

     

    #107335

    @Vonasi

    True, my mistake..

     


    @Robert

    Thanks for the code 🙂

    See that you have removed SL and TP.

    Don’t you think it’s a good idea to bring them or..

    Saw in my backtest that tickmode was over 500 resulting in an incorrect result.

    It might not work with TP and SL in that code?

    #107337

    @robert

     

    saw your comment in the code now.

    Be a little quick there 

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

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