Order Entry n Candles after Trigger

Forums ProRealTime English forum ProOrder support Order Entry n Candles after Trigger

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

    Hi all,

    I’m just getting started with Prorealtime coding, so apologies up front if this is a noddy question. I have a basic strategy I’m trying to set up for testing.

    The idea is to catch a pullback into a trend (downtrend in the example here, but inverse would apply for uptrend) by identifying a candle which pushes up though a descending EMA but closes below, and using this as a trigger from which to place an order. As an example, a short entry 3 points below the lowest Low of the 5 candles preceding the Trigger candle. I’ve managed to get as far as identifying the Trigger candle and coding an entry which works provided the candle immediately following the Trigger candle hits the entry price, but if I’m understanding correctly, the order effectively dies if not hit by this next candle. I want to keep the order valid until hit, or cancelled by an intervening close above an EMA. Hopefully the attached image illustrates.

    Any pointers greatly appreciated.

    Regards

    WT

    #83201

    Image didn’t attach 🙁

     

    #83223

    Easiest way to get an answer is to post your code thus far (using the Insert PRT Code on the toolbar above each new post).

    Are you using the Select File button below each new post to (try) and attach an image?

    1 user thanked author for this post.
    #83227

    Just set a flag to keep putting the order on the market until you no longer want to: Something like:

    Not tested.

    1 user thanked author for this post.
    #83234

    Thanks for the replies both, I’ll have a play around and see what I can do. Is it the case then that if I assign a variable a value, that value is ‘remembered’ beyond the next candle? Is it just the Order that gets forgotten?

    Re. the image yeah I tried the Select File thing… In fact I’ll try it again here now…

    #83237

    Variable values are remembered candle to candle. You can use the instruction ONCE before assigning a variable value and this means that that value is only set on the very first run through the code and not on subsequent candles.

    Limit and stop orders last for just one candle.

    Your image is very clear and should be easy to code. Often the best way to code is to write down what you want in clearly defined steps and often you will find that the code is not far off what you have written down so you are half way there already.

    I think it is best if you have a crack at it yourself and ask any questions that crop as you will learn so much more doing it that way.

    1 user thanked author for this post.
    #83316

    Absolutely, thanks very much for the response. Will have a go over the next few days.

    cheers,

    WT

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