How do I open and close trades at levels relative to the signal bar?

Forums ProRealTime English forum ProOrder support How do I open and close trades at levels relative to the signal bar?

Viewing 6 posts - 1 through 6 (of 6 total)
  • #48201

    As an example, when  I get a Buy signal (say caused by 2 moving averages crossing), I would like to enter the trade if the next bar’s price goes above the high of the signal bar (and enter the trade at that price not the open of the following bar)

    The profit target would be lets say 2 * ATR(14) above the high of the signal bar.

    The exit would be if the price crosses below the high of the signal bar – the ATR(14) at the time of the signal bar.

    Lastly,  I have borrowed part of this code from MattyJ (thank you). Using the money management code here, how do I code this so the trade size (I am spread betting) is 5% of the account size at the time of the trade?

     

    #48209

    I recognize the code we made recently in the Mattyj’s topic.

    I understand your request about the changes to made to this code, but you did not mention if the elapsed bars after the MA cross conditions should be left or not?

    5% of the account size at the time of the trade

    It is already the case in the strategy, despite the fact that Mattyj reduced the calculated lots by 0.5 at lines 36 and 41 (don’t know why).

    #48214

    Thank you for the very quick reply Nicolas.  I’m not sure what you mean about the elapsed bars being left or not.  Sorry if I wasn’t very clear.  What I meant was the bar at which time the MAs cross is what I call the signal bar.  This should be the reference point for the entry . So in an up trade the high of the signal bar would be the entry level and the take profit would be 2 ATRs above the high and the stop loss would be 1 ATR below the high.

    After each trade the account size would be adjusted and the amount per point on the next trade would change based on the risk percentage stated.

     

    #48259

    ok I understand your strategy, but the code provided embed a lot more than a simple MA cross: it has condition about bars to wait before opening a trade after a cross and it has also 3 MA, not only 2. I’d rather start from scratch 🙂

    So, to be sure: only 2 moving average and no need to wait X bars before launching orders? (apart from the fact that it is necessary to wait for a break of the High of the signal bar).

    #48299

    Yes that’s right Nicolas.

    #48314

    Fine, let’s try with this code, do your own tests cause I didn’t.

     

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

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