MultiTime BackTesting Strategy Help please.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10836 quote
    DungerDunger
    Participant
    New

    Hi,

    x = any predefined range from the market open, i.e. If x = 15 and market open was 8am GMT, then we would have a range from 8am-8.15am, if x was 30, then we would have range from 8am-8.30am.

    y = the target points above or below a break of x range. (user defined)

    z = stop position. hard-coded number of points for your stop from entry.

     

    Rules Take a break of the x range (+2pts) and the target is y. Stop is z.   Thanks in advance.

     

    Regards.

    #10847 quote
    DerekDerek
    Participant
    Veteran

    I don’t know what you mean by “take a break of range x” but maybe this will help

    Z = 25
    A = 50
    B = 40
    If currenttime=090000 then
    Range1= open
    Endif

    If currenttime = 091500 then
    Range2=close
    Endif

    If Range2>Range1 And Range2-Range1 > Z then
    Buy 1 contract at market
    Set Target Profit A
    Set Stop Loss B
    Elseif Range1 >Range2 And Range1-Range2 > Z then
    Sellshort 1 contract at market
    Set Target Profit A
    Set Stop Loss B
    Endif

    :

    I couldn’t use the PRT function because I am on mobile.

    #10849 quote
    DungerDunger
    Participant
    New

     

    Thanks for the feedback Derek.

     

    I will give this a go.

     

    Best Regards.

    #10850 quote
    DerekDerek
    Participant
    Veteran

    I just did on my system. This is definitely working:

     

    DEFPARAM CUMULATEORDERS = false
    
    Rangetoenter = 50
    TargetProfitinPoints = 50
    StoplossinPoints = 40
    
    IF currenttime = 090000 THEN
    price1 = open
    endif
    
    IF currenttime = 091500 THEN
    price2 = close
    endif
    
    If price2-price1 > 0 AND price2-price1 > Rangetoenter Then
    Buy 1 contract at market
    Set Target pProfit TargetProfitinPoints
    Set stop pLOSS StoplossinPoints
    elsif price1-price2 > 0 AND price1-price2 > Rangetoenter Then
    SELLSHORT 1 contract at market
    Set Target pProfit TargetProfitinPoints
    Set stop pLOSS StoplossinPoints
    endif
    
    #10851 quote
    DungerDunger
    Participant
    New

    Hi,

     

    So it seems I am taking multiple trades per day. I only want to have one trade per day.

    So, imagine the open is 8am and I have defined a range of 15mins.

     

    Therefore, I want to trade a break higher or a break lower of that opening 15m range until either Y is hit (hardcoded target points) OR Z is hit (hardcoded stop number of points)

     

    This current script is not quite hitting the mark with that as it is taking multiple trades in a given day. Thanks in advance for details provided in order to correct it to allow this.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

MultiTime BackTesting Strategy Help please.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Dunger @dunger Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by DungerDunger
10 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/24/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...