Storing the candle close price on differing TFs

Forums ProRealTime English forum ProOrder support Storing the candle close price on differing TFs

Viewing 15 posts - 1 through 15 (of 15 total)
  • #251830

    Hi

    I’m interested in automated trading and have the attached indicator and proscreener to use, I believe the proscreener can be used to convert to an automated system.

    The indicator delivers buy/sell signals for which the proscreener then searches, what I want to know is this. Say a buy signal is delivered on the 4hr, 2hr, 1hr or 30min can the candle close price be remembered irrespective of what timeframe it is delivered, I then search for a subsequent buy signal on the 10min, 5min, 2min or 1min. If the close price on the shorter timeframe is lower than the close price on the longer timeframe  it is an entry opportunity and we automatically buy, if the close price is higher than the ‘remembered’ longer timeframe signal we abort unless already in a profitable trade and therefore constitutes an additional entry.

    I hope that all makes sense and would appreciate any help forthcoming.

    Chris

    #251837

    Hi. Here you have an example.

    2 users thanked author for this post.
    #251872

    First of all Ivan, many thanks for your help.

    From your reply and my very limited knowledge of coding I’ve written the attached WIP file, this for long positions only.

    Long TFs are 4, 2, 1 hour and 30 minutes.

    Shorter TFs are 10, 5, 2 and 1 minutes

    You will see from the Grocery Outlet Holding Corp screenshot a long entry was given on the 30 minute TF (close 1567.5) with a subsequent long entry on the 2minute TF (close  1510), however no entry was highlighted on the probacktest when run. Is my code incorrect or may I have overlooked something?

    Again, many thanks for your help.

    Chris

    #251901

    UPDATE

    Having worked on this code over the weekend I attach my latest update. My concern is that when using multiple TFs it appears they need to be multiples and in this example of 10,5,2 and 1 minute that has to be 1 minute, does that mean the code will only autotrade on the 1 minute chart. If so can I overcome that so that entries can be on either the 10,5,2 or 1 depending on what  secondary shorter TF the signal is delivered.

     

    Many thanks in anticipation.

    #252010

    The default timeframe (the one on the chart)  must always be <= the smallest timeframe in the code. And ALL timeframes in the code must be multiples of the default timeframe.

    In your case you can only trade the 1-minute timeframe.

     

     

    2 users thanked author for this post.
    #252011

    Hi Robert

    Many thanks for your reply and help. So I’m guessing individual codes for the 4 individual shorter timeframes is the only answer. I’ll get on it.

    Thanks again.

    #252084

    Hi again

    Looking at the attached code can anyone please explain why the entry at 19:25 this evening didn’t trigger.

    Many thanks in anticipation.

    Chris

     

     

    #252095

    What istrument is it?

    I could only spot PAR on your pic, but none of the instruments tagged PAR that I found match that price levels.

     

    #252098

    Good morning Robert

    It is PAR Technology Corporation, a US share company.

    Many thanks for looking into this for me.

    Chris

    #252112

    Sorry, but I could only find a similar asset quoting around 38.1, instead of 3.76, so I assume it’s not the same, so I couldn’t verify your missing trade.

    1 user thanked author for this post.
    #252142

    good afternoon Robert

    If I can provide further information to hopefully you in assisting me.

    On 25/9 at the close of the 16.00 candle (value 3995.5) a buy signal was delivered on the 30 min chart, subsequently a further buy signal was given on the 1/10 at the close of the 19.25 candle (value 3791.5). As you can see this close on the shorter TF is lower than that given on the longer TF and should have resulted in a long position.

    I attach the indicator code, the probacktest / automated trading code for your purposes along with all the info I can find on the instrument.

    par technology corporation stock – Search

    As per usual, in anticipation I am most grateful for your help.

     

    Chris.

    #252158

    That’s not a ProRealTime chart, how could you run your code?

     

    1 user thanked author for this post.
    #252166

    Apologies Robert the PAR screenshot was to provide further information on the instrument (which you had difficulty locating) for which signals had been delivered, sorry for the confusion.

    However, using the same indicators and the same 4,2,1 and 30min longer TFs and the shorter 10,5,2 and 1min shorter TFs signal were given on Friday, they are:

    Instrument: AIG American Intl Grp Inc. Short signal (3/10/25) on 30min at 15:30 candle close (value 8021.5). Subsequent short signals (3/10/25)  on 5min at 17:10 candle close (value 8106.5) and on 1min at 20:41 candle close (value 8136.5)

    Instrument: Belden Inc. Long signal (29/9/25) on 30min at 17:00 candle close (value 12141). Subsequent long signals (3/10/25) both on 2min at 18:56 candle close (value 11876.5) and again at 20:50 candle close (value 11805)

    All entries show as being triggered if one runs a probacktest on the shorter TFs but are not triggered on an automatic trading system generated by the same probacktest code.

    Many thanks for your continued support Robert

    #252169
    JS

    Hi,

    When I look at the code of the “Call” indicator “the one”, I notice that the conditions required to produce a positive (1) or negative (-1) signal are very specific, you need to meet ten (10) conditions to trigger either signal, which means it will occur relatively rarely…

    It’s therefore important that a signal is remembered until the opposite signal appears, in other words, a +1 signal should remain +1 until a (counter)signal of -1 is generated…

    The signal should only have two possible values: +1 or -1…

    This is where things go wrong, because line 6 in the code (Signal = 0) resets the signal every 5 minutes…

    Remove line 6 (//Signal = 0) from the code of “the one” and try again…

    2 users thanked author for this post.
    #252179

    Good evening JS, many thanks for taking the time to help.

    I have added your indicator code to the attached 2 min charts for the following example triggered on Friday afternoon.

    Instrument: Belden Inc. Long signal (29/9/25) on 30min at 17:00 candle close (value 12141). Subsequent long signals (3/10/25) both on 2min at 18:56 candle close (value 11876.5) and again at 20:50 candle close (value 11805)

    You will note from the probacktests that my code only allows entries when the value is 1 (18:56 and 20:50 close) where yours would have an entry on all candle closes until the indicator changes to -1, this unless I of course add the extra if “notlongonmarket”. Although in the example given the market has gone against it is not always the case a -1 will follow a 1 signal, one may wish to average up or down and would therefore need to revert to the 0 in order to trigger subsequent entries if a subsequent signal in the same direction is given prior to an exit signal.

    I hope I’ve explained that correctly.

    Many thanks for your time and expertise.

    Chris

     

    1 user thanked author for this post.
    avatar JS
Viewing 15 posts - 1 through 15 (of 15 total)

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