React by the tick in m1?

Forums ProRealTime English forum ProOrder support React by the tick in m1?

Viewing 12 posts - 1 through 12 (of 12 total)
  • #213921

    Hello, I’m backtesting a scalping strategy which once in position will need to analyze every tick movements to react quickly and I was wondering if there was a way to do it while still processing the m1 timeframe?

    Thanks

    #213922

    Multiple Time Frame support only allows using more than one TF, provided it’s a time-based one.

    Ticks cannot be mixed with 1-minute TF.

     

    1 user thanked author for this post.
    #214026

    Thanks for your answer, so basically if I have a 60ticks chart and want to backtest my strategy by the tick (so I don’t have to wait for the total 60tick candle to form before reacting) I couldn’t and the only way to do this is to create an algo on a 1tick chart and calculate the 60ticks candle myself?

    #214033

    Yes, exactly. That’s the only way you can achieve your goal (well… approximately, as 60 ticks are not exactly 1 minute, in most cases).

     

    #214224

    Great, I’m implementing that right now and I might be nitpicking but for the sake of readability (and also to learn more about the systems limits) I was wondering if the backtest system (or should I say BASIC in general?) allows to create more complex structures as variables, like you can do in C for example?

    The idea is that I would like to create a structure candle from which I could get and set candle.opencandle.close, candle.high, candle.low instead of 4 separates arrays

    #214225

    You guessed it – not possible.
    But maybe your focus is on arrays while they may bring you hassle only (in PRT that is). I would say (estimating what you are after) :

    Open[0] is the open of the current last candle (you can never know anything about the momentary built candle). Open is the same ( [0] can be omitted for the current last candle).
    Open[1] is the open of the previous candle. Open[2] the open of the one prior again.

    With Close and High and all it is the same. No arrays required.

    This works the same for each variable you define. Suffix it with e.g. [3] and you have its value from 3 bars (candles) back.
    Same for system functions (which PRT tends to call constants) like PositionPerf. Want the gain from 2 candles back ? write PositionPerf[2].


    On a different subject, it seems that you may confuse ticks with TimeFrame. If you work with a TF of 1 minute, in your terminology (as it seems !) you have 1 tick per per minute. It is fine to think so. But it is not great once you realize that there’s also real ticks, which represent buys and sells on the instrument. They occur in unpredicted fashion, and may occur 100+ times per second. Or only once per two hours.
    The units of the chart can be set to Ticks as well, per your own definition. Each tick, or once per 10 ticks, or once per 560. It defines the bar. But you can not AutoTrade which such a unit.

    As per your own description, it seems that you want a TF of 1 minute, but like to be in control per e.g. 1 second. Less than one second is not possible. In that case, define your chart in a TF of 1 second, and use the TimeFrame command in the code to set it to a multiple of the TF of the chart. E.g. 1 minute or 60 seconds (both works out to the same). So investigate the TimeFrame command. For example TimeFrame(1 Minute, UpdateOnClose). All your further commands (like Averaging math) under the last TimeFrame command  now work subjective to that set TF.

    Hope this helps !
    Peter

     

    2 users thanked author for this post.
    #214228

    As PeterSt pointed out, complex structures, such as STRUCT, UNION etc… are not supported.

    It is rumoured that FUNCTIONS will be supported in the future (at present not in v12). You can still use indicators to sort of mimic them.

    Monodimensional arrays are already supported.

     

     

    1 user thanked author for this post.
    #214229

    This works the same for each variable you define. Suffix it with e.g. [3] and you have its value from 3 bars (candles) back.

    Oh really? So if I define any variable, each of their previous values are stored and accessible with brackets?

     

    PeterSt wrote:

    On a different subject, it seems that you may confuse ticks with TimeFrame. If you work with a TF of 1 minute, in your terminology (as it seems !) you have 1 tick per per minute. It is fine to think so. But it is not great once you realize that there’s also real ticks, which represent buys and sells on the instrument. They occur in unpredicted fashion, and may occur 100+ times per second. Or only once per two hours.

    The units of the chart can be set to Ticks as well, per your own definition. Each tick, or once per 10 ticks, or once per 560. It defines the bar. But you can not AutoTrade which such a unit.

     

    I might have confused some people talking about ticks and TimeFrames but this was only used as an example and I am mostly talking about real quotation ticks and working with tick based chart right now doing my backtesting. I was planning on creating a ProOrder system based on a 1 tick “Time Frame”, calculating myself 100 or 200 ticks candles so I could use an indicator based on those 200 ticks candles, and then enter and exit position by the tick.

    The idea is to have a system as responsive as if I was myself scalping in real time a 200 tick “TimeFrame” chart and that I was taking into account every tick to enter or exit position.

    But from what you say it will not be possible to use such system for ProOrder?

    Also I was under the impression that on a 1 tick chart, every new quotation tick would update the chart, but if I understand correctly : even then the chart will only be updated every seconds?

     

    If so, then sure, I will have to work with seconds based TF instead of ticks..

     

    #214231

    Also I was under the impression that on a 1 tick chart, every new quotation tick would update the chart, but if I understand correctly : even then the chart will only be updated every seconds?

    From your stance the answer should be Yes indeed. Still from deeper down wishes (again, if I read well) there is a better fitting answer :

    Any Indicator (compare Strategy vs Indicator) will update by the tick. But it can only be used like that visually. This is what you want for manual trading.
    This goes automatically.
    An Indicator can show on the Price pane and in its own (horizontal) pane.

    And then I’d have to disappoint again, because no AutoTrading can use that; the smallest level remains at the one second.

    With 1 second charts there’s a downside : less backtesting data. And way longer backtesting times (progressively longer).

    Lastly one hint : I myself have been excessively using 1 second charts (up to 6 seconds) in order to get real scalping running. I could not do it effectively. Effectively : more profitable then an e.g. the 1 minute chart. Of course this relates to my (or one’s) scalping capabilities, but there’s more than that and this is trailing. So what I’m saying is that with good trailing there’s much much more to gain and I could not do that with 1 second charts. Also not when all math is done in the e.g. 1m TF of 5m or longer. So it is exactly the detail of the 1s – which Yes allows you to interfere at any level – but it is too complicated to get it right (even as a die hard programmer). So the hint in this realm is Stop and Limit pending orders, because they to the work for you automatically. And code your own trailing of course.
    Per this means I “achieve” 25-30 full trades per day on one System. This is not explicitly scalping, but the aim *is* as many trades as possible. And Yes this is a goal in itself because of the now more possibilities of better gain (due to the Trailing).

    Don’t forget to decently go about with Spread (take into account a sufficient number of points) or else it will kill you when Live.

    1 user thanked author for this post.
    #214233

    Thanks, I’m going to check and fiddle with that

    When you advise to code your own trailing : are you talking about using the SET STOP pTrailing X with different conditions to place it at different times, or does this command have limits I am not yet grasping which forces you to code your own?

    #214234

    The Set Stop Trailing works all right** but it is not as intelligent as you can make it yourself. It is fine to start out with it.

    **): Currently this can not be used with PRT-IB (yet). For PRT-IG it’s OK.

    Be prepared that no two Stop commands can concur at any same time. So it is relatively difficult to use the Set Stop Trailing combined with a Sell x Contracts at YourPrice Stop.

     

    #214235

    Alright, I didn’t really try to close order partially yet but I will think about it, it’s true that this is a risk management tool that I should take into account

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

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