Newbie questions about automatic trading with ProOrder code

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #41815 quote
    Pjotterd
    Participant
    Average

    I have used the 250 pips profit stop in PRT as well, but I do not get any results at all…. I have used the same parameters and the spread as well.
    If the code is correct the PRT backtest results should be equal to the manual test results. But in PRT I do not have any results at all.

    ps. I’m using the Gold spot (E1 contract), 1 hour timeframe

    #41820 quote
    GraHal
    Participant
    Master

    First time you have mentioned Gold?

    Attached results on Gold 1 H TF … Time = 040000 lower curve, Time = 010000 upper curve.

    There are results on Gold so is attached of interest / help?

    PJ-2.jpg PJ-2.jpg
    #41832 quote
    Pjotterd
    Participant
    Average

    Thanks for helping me out, but it doesn’t work the way it should. So, I will get into this to fix it.
    Thanks again!!!

    #41834 quote
    GraHal
    Participant
    Master

    Okay, I was confused as you said … in PRT I do not have any results at all … so I thought your code didn’t open any positions for you in PRT?

    Anyway, let us know when you sort it please as I like to know there is closure on a problem.

    Cheers
    GraHal

    #41836 quote
    Pjotterd
    Participant
    Average

    will do, thanks GraHal

    #41847 quote
    Pjotterd
    Participant
    Average

    Ok, I think I have found the solution. Look at the code. That gives me the results I want. Thank you guys!

    // Gold breakout
    // 1 hour
    // One order per day, from 06:30h. The system shuts-down at 21:00h
    // Everyday highest and lowest position from 2100 to 0400
     
    DEFPARAM CUMULATEORDERS = false
     
    // OPERATIONAL TIME
    DEFPARAM FLATBEFORE = 063000
    DEFPARAM FLATAFTER = 210000
    Operationaltime = TIME > 063000 AND TIME < 210000
     
    // ONE TRADE PER DAY. It resets the variable each new day
    IF INTRADAYBARINDEX = 0 THEN
    alreadytraded = 0
    ENDIF
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 1 OR OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // RANGE between 2100h to 0400h
    IF TIME=040000 THEN
    channelhigh = Highest[7](high)
    channellow = Lowest[7](low)
    ENDIF
    
    // BREAKOUT Conditions
    c1= close > channelhigh
    c2= close < channellow
    
    // LONG Positions-Opening
    IF Operationaltime AND not daysForbiddenEntry and c1 AND alreadytraded = 0 THEN
    BUY 10 CONTRACT AT MARKET
    alreadytraded = 1
    ENDIF
     
    // SHORT Positions-Opening
    IF Operationaltime AND not daysForbiddenEntry and c2 AND alreadytraded = 0 THEN
    SELLSHORT 10 CONTRACT AT MARKET
    alreadytraded = 1
    ENDIF
    
    // Stops and targets
    SET STOP LOSS 2.3*pipsize
    SET TARGET PROFIT 8.0*pipsize
    
    #41851 quote
    GraHal
    Participant
    Master

    Yeah now you have the 17 Trades in June you wanted / needed, but most of them are closed within the same 1 H bar (as opened) and so don’t show as positions on the chart results (but they do show in the Orders List / Tabular results).

    Do you get the same equity curve as attached?

    PJ-3.jpg PJ-3.jpg
Viewing 7 posts - 16 through 22 (of 22 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

Newbie questions about automatic trading with ProOrder code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Pjotterd @pjotterd Participant
Summary

This topic contains 21 replies,
has 5 voices, and was last updated by GraHal
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/25/2017
Status: Active
Attachments: 4 files
Logo Logo
Loading...