target profit moving average

Forums ProRealTime English forum ProOrder support target profit moving average

Viewing 7 posts - 1 through 7 (of 7 total)
  • #213059

    Hi,

    I was hoping someone could shed some light as still learning the coding on here. If i I wanted to set a target of the price touching the moving average line, how would I code this?

     

    Thank you

    #213060
    JS

    Hi,

     

    1 user thanked author for this post.
    #213175

    Just a follow up question; how do I do partial closure?

    For example two different close positions based on two different moving averages. I have the below code but not sure how to add that

    1*atr closes when it reaches 50 moving average

    and then the remaining (1*atr) closes when price touches 100 moving average

    also, if i wanted to bring the stop loss up to breakeven when it touches for example the 50 moving average, how could i code this?

    Any help would be much much appreciated

    #213182

    for Breakeven you can maybe look at this page it will help you, and about selling at 2 level

    for selling at 2 level of price maybe you can use 2 IF condition and Sell 1 shares when the condition it met

    #213184

    to close partially an order, nice example from Roberto: https://www.prorealcode.com/topic/replacing-tp-with-partial-close/#post-194694

    to put order at breakeven (and many other possibilites) with these new instructions: New trading instructions: better management of your orders!

    #216237

    Hi, just wanted to follow up – based on the above formula – with targeting the moving average as a target price, it seems to execute at the moving average value directly correlating with opening candle of the trade. Is it possible to have the target price move with the moving average so its dynamic. So if the todays candle price touches the moving average it closes at that point. With the formula above, it doesnt seem to close, only when the price hits the initial moving average value that was calculated when the trade first opened. Its a bit difficult to explain – hope this makes sense.

    #216241

    Swap lines 8 and 9, so that set target price (ma1) is the last line, i.e. outside the conditionl block IF…ENDIF and will ALWAYS be executed, not just at entry time.

    Be warned that ma1 might be lower than the prior candle, thus exiting at a lower price than originally set.

     

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

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