Newbie questions about automatic trading with ProOrder code

Forums ProRealTime English forum ProOrder support Newbie questions about automatic trading with ProOrder code

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

    Hi,

    I’m quite new here, but I have the following questions. I’m creating a code, but I can not figure out how to create the following piece of code:

    • Every trading day I would like to know what the highest market price is between the previous day 21.00 and the current day 04.00 hours. And I would like to know what the lowest market price is between the previous day 21.00 and the current day 04.00 hours.
    • Trading hours are from 06.30 hours until 21.00 hours
    • I only want to trade when the 1-hour candle closes above the highest market price mentioned before or when the 1-hour candle closes under the lowest market price mentioned before.
    • When the 1-hour candle closes above the highest market price, we take a long trade with a stop loss of 230 pips and a profit stop of 800 pips
    • When the 1-hour candle closes below the lowest market price, we take a short trade with a stop loss of 230 pips and a profit stop of 800 pips
    • We will only trade once a day. So after the first trade, the system should stop.

    Thanks guys!!!

    #41624

    First question:

    Second question: Use “defparam flatafter/flatbefore”. Eg. “Defparam flatafter 210000”. Must  be the first lines in your  code.

    Third question:

    Then set your SL/TP. Does that help you on the way?

    #41701

    Thanks a lot, Wing. I created the following code, but it is not working. Would you be able to look into it, maybe you have a solution for me? Thanks in advance…

     

     

     

    #41708

    Hi PJ, Wing is offline, so thought I’d jump in (to keep you going 🙂 ) … is this maybe the problem?

    From your ‘non-code strategy’ below, it looks like it should be …

    • When the 1-hour candle closes below the lowest market price, we take a short trade with a stop loss of 230 pips and a profit stop of 800 pips

     

    #41709

    Maybe “Sellshort” instead of buy in line 30?

     

    Edit: You were faster Grahal 🙂

    #41711

    Thank you guys. Changed it, but still no results 🙁

    #41716

    Close cannot be superior to myHigh or inferior to myLow, you must referred to their values one bar ago, otherwise Close is myHigh or myLow and testing a value superior or inferior to itself has no sense.

     

    #41727

    Andyswede we were both correct, but not quite correct enough! 🙂

    #41753

    Hi guys,

    Thanks again, but I still dont have any results. Something is wrong. I did some manual backtesting and there should be 17 trades in june 2017. You have any clues left? Thanks again for helping me out, I really appreciate it.

     

    #41754

    🙂

     

    #41787

    Hi PJ

    Please add your code at latest up to date version on here then I will run it on my platform,

    GraHal

    #41791

    Thanks GraHal,

    This is the code I use right now.

     

    #41801

    You say … . I did some manual backtesting and there should be 17 trades in june 2017 …. what does manual backtest mean, how did you do it??

    Aren’t you restricting potential with time= 040000 ??

    Results attached since 1 Apr 13 (100,000 bars?) on DAX at 1 hour TF with time = 040000 lower curve. With time = 090000 upper curve … rest of the code same as yours above.

    #41805

    I did the backtesting myself using graphs and no software.

    Attached you will find the results with a 250 pips profit stop and a 230 pips stoploss

    #41808

    Your code above shows 800 profit stop, but your manual results above are based on 250 profit stop?

    So is there still a problem or are you good to continue now?

    If there is still a problem, is it that you want PRT backtest results to match your manual backtest results? Have you got same parameters in each scenario, including spread etc?

Viewing 15 posts - 1 through 15 (of 22 total)

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