Wanted: small code snippet for reinvestment

Viewing 15 posts - 31 through 45 (of 69 total)
  • Author
    Posts
  • #57550 quote
    pitupitu
    Participant
    Junior

    Dear friends: I¡ve been trying to run this code in my PRT Demo account, but no signal appears in the backtest (Dax 1€, timeframe 4h). I’ve checked the platform opcions on the time-zones issue, and it seems that everything is ok. Any idea about why I’m not seeing any trade?

    Thanks a lot!!!

    #57579 quote
    indy2005
    Participant
    New

    Hi

    Can i check the timezone just to be sure.  Also, as already stated some of these times don’t work on a 4 hour chart – or is that not the case (090000 for example).

    Regards

    i

    #57582 quote
    Juan Salas
    Participant
    Master

    Hi Pitupitu,

    Did you check the time criteria??? I have tried the code and it works fine. Check that the time criteria fits the 4 hour candles. I have seen a second code in page 2 that set time not achievable for 4 hour candles (080000, 120000, etc) unless you have UTC time. Remember that Spain and Central Europe is UTC+1.

    I hope this is the problem. As I said, I have copy/paste the code of the first page with time criteria 090000, 130000 etc and it works, as it is match my time zone.

    Saludos,

    Juan

    #57587 quote
    indy2005
    Participant
    New

    Thanks, basically I should just set my platform options for European Indices to be UTC+1 to test this strategy I assume.  I am new to PRT.

    But when the original code posts 08:00, it means 08:00 in the local market.

    #57593 quote
    Vonasi
    Moderator
    Master

    Sorry – I changed the times in my modified code as I have my platform set to UTC. I just find it easier to know that 4HR candles are at 0400, 0800 etc etc. I normally get very confused as I am actually UK based but do most of my trading from Greece so in reality I have no idea what time it is anywhere!

    #57601 quote
    pitupitu
    Participant
    Junior

    Hi guys,

    Thank you for your advice. In fact, there are two options, but you have to be coherent: using 8-12-16-20 with UTC, or 9-13-17-21 with UTC+1.

    Now, it works, but now in all the domain. I don’t understand why my differences with the results figures attached by Vonasi (my backtest also attached here).

    Any idea? Thank you again!!!

    DAX30-1€-4h.png DAX30-1€-4h.png
    #57619 quote
    indy2005
    Participant
    New

    Bit confused as I just went from one OC to another and now the backtest launches no trades.  I am assuming my changing to UTC +1 for EU Indices didn’t take effect until I logged in fresh onto second PC – and now none of the times are triggered.  In the original code, what were the times in – utc or utc+1….I.e is 08:00 actually a UK time implying 09:00 trade time trigger for DAX in local time.

    #57655 quote
    indy2005
    Participant
    New

    Hi,

    Can someone please explain the logic in the code, and any pre-requisites.  By pre-requisites I mean do we need to exclude out of hours trading from the chart, or leave 24 hours in play.

    Also, whats the logic here:

    IF time = 090000 or time = 130000 or time = 170000 or time = 210000 then
    If Repulse[3](close)< -0.3 Then
    sell at market
    Endif
    ENDIF

    Why does looking for Repulse (not familiar with this one) 3 bars ago create a sell condition…are we not looking 12 hours back here in this line of code?

    Excuse the silly questions…

    Regards

    i

    #57673 quote
    Vonasi
    Moderator
    Master

    JohnScher may be in a better position to answer your questions about the logic behind the strategy but this is my impression.

    All codes make their decisions at the close of a candle and then opens the position at the open of the new one after the close. TIME is a little confusing and I suggest adding the following to a chart as an indicator to understand it better and then hover over any bar to understand fully what time actually means.

    Graph Time as "Time", OpenTime as "OpenTime"

    So it will only exit at the end of the 0500 0900 1200 and 1700 bars and at the actual time of 0900 1300 1700 2100. I’m guessing this is to ensure that positions are only closed during the main European/American sessions and not during the usually flat Asian overnight session.

    #57683 quote
    Vonasi
    Moderator
    Master

    Oooops! Typo in my last post.

    Graph Time as "Time", OpenTime as "OpenTime"
    

    Should be

    Return Time as "Time", OpenTime as "OpenTime"

    to run as an indicator. Use GRAPH if you are adding it to a strategy.

    #59027 quote
    Vonasi
    Moderator
    Master

    My ‘three entry condition’ version with seasonal adjustment has now been on backtest since new year’s day. Just one trade – a win of £597 for a £3 bet that took 4 days and 3 hours on the market ( over 6 days reality due to the weekend). It was up by £1017 at its highest point but fell back to be closed by the very distant trailing stop. Not a bad start though. It was never in a loss.

    [attachment file=59028]

    Screenshot_6.png Screenshot_6.png
    #59030 quote
    verdi55
    Participant
    Veteran

    Wouldn’t you have got a similar result with a supertrend ?

    [attachment file=”DAX 4h.png”]

    #59031 quote
    verdi55
    Participant
    Veteran

    image attached[attachment file=59032]

    DAX-4h.png DAX-4h.png
    #59036 quote
    verdi55
    Participant
    Veteran

    ooops

    #59042 quote
    Vonasi
    Moderator
    Master

    ooops

    Now you are just trying to rack up points for forum posts I think?

    Yes there are many ways to skin a cat. Although I think that a blind man could have made money out of last weeks DAX new year post Christmas back to the office rally!

    You seem to be a big fan of SuperTrend…. I may have to revisit it and see if I can fall in love with it.

Viewing 15 posts - 31 through 45 (of 69 total)
  • You must be logged in to reply to this topic.

Wanted: small code snippet for reinvestment


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
JohnScher @johnscher Participant
Summary

This topic contains 68 replies,
has 7 voices, and was last updated by Nicolas
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/31/2017
Status: Active
Attachments: 23 files
Logo Logo
Loading...