Novice Needs help with PRT

Forums ProRealTime English forum ProOrder support Novice Needs help with PRT

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

    Hi, Im new to PRT, coding and programming.

    I have a little bit of trading knowledge.

    I need help with 2 items:

    1. If I do a back test I need to enter the market at “current period” and not “next bar open”, as this is too late (see image attached).

    How can I change this or manually change the code.

    The code is:

     

     

     

    2. If I set the back test date manually it ignores it and uses the displayed time only, how do I correct this.

    Humble regards

     

    #185991

    If it’s any help, we all have to enter at next bar open … that’s the way PRT works (and I think, all other Platforms?).

    Time difference between current bar close and next bar open is only a few milliseconds; the price is therefore as near the same (current close to next open) as makes no difference.

    #185997

    Your pic shows you are using a 1-minute TF.

    You could use MTF (Multiple Time Frame) support to use a default 1-second TF to be able to enter as quick as 1 second after your conditions are met, without having to wait for the 1-minute candle to close.

     

    #185999

    Hi, thanks for you help.

    What I want to do is to enter a long position if the change of price is 5 points/pips within 1 minute tf bar, the trade must then be executed on the 1 second tf, So immediate if it reached 5 point it must buy, how will that coding look?

    I looked at the mtf coding and this is what I developed, not sure if its correct:

    If I use this then I get the message that timeframes don’t match….

     

     

     

    #186000

    Ok thanks, I don’t really have an idea how this work. You can check my other reply on this topic to see what I want to do.

     

    Regards

    #186001

    This your code ready to run:

     

    #186024

    Hi, when I run that code I get this error (see image), i tried to fix it but could not get it right.

    What I want to do is to enter a long position if the change of price is 5 points within 1 minute tf bar, the trade must then be executed on the 1 second tf, So immediate if it reached 5 in 1 bar tf point it must buy.

    It will main ly be for CFD indices so will the “*pipsize” be required.

     

    Thanks for your help, im trying to make sense of all of this.

    #186030

    Hello Francois – Try this version :

    Roberto is playing with his new Editor which left some strange characters behind. 🙂
    Peter

    1 user thanked author for this post.
    #186048

    Thanks Peter & Roberto, when I run that code no trades get activated.

     

    Im trying to develop a scalping strategy but struggling with the code.

    I want to enter a long position if the change of price is 4 points within 1 minute tf bar, the trade must then be executed immediately on the 1 second tf, So immediate if it reached +4 points in 1 minutetf point it must buy.

    The TP will be 1 points and the SL will be 1 points after activation.

    I want to  enter a short position if the change of price is -4 points within 1 minute tf bar, the trade must then be executed immediately on the 1 second tf, So immediate if it reached -4 points in 1 minute tf point it must sell.

    The TP will be 1 points and the SL will be 1 points after activation.

    <span style=”text-decoration: underline;”>The code from the PRT simplifier looks likes this:</span>

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated

    // Conditions to enter long positions
    indicator1 = close-close[1]
    c1 = (indicator1 >= 4)

    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Conditions to enter short positions
    indicator2 = close-close[1]
    c2 = (indicator2 <= -4)

    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    // Stops and targets
    SET STOP pLOSS 1
    SET TARGET pPROFIT 1

     

    The problem with this code is that it then executes the trade on the next 1 minute bar which by then is too late and the trade is a loss, as it does not allow for MTF.

    The image attached at point 1 shows 4 point change (where i want to buy) and it went beyond 5 points (where i want to exit long at 5 point). Point 2 shows -4 point change (where i want to short) and it went beyond 5 points (where i want to exit long at 5 points).

    So I would scalp 1 pont at each of these positions

    How will that code look?

    #186052

    You don’t need to post your code at every post, unless you have modified it.

    You need to use 200K 1-second bars, which is barely 10 days.

    If that is not enough to open a trade then you have to resort to, say, 10 seconds (but this won’t change much about data history), or you need to use your original code and open only when the 1-minute candle closes.

    There’s no further option available.

     

    #186053

    Try running on the 1 second timeframe and then let us know?

    #186054

    So I would scalp 1 pont at each of these positions

    Spread is more than 1 point on most Indices, even DAX is 1.2 so you lose 0.2 on each trade?  EURUSD is 0.6 sometimes! 🙂

    Get the System going with loads of trades and you can adjust / optimise TP and SL later.

     

    #186065

    Thanks for all your input and advise.

    If I make my analysis timeframe one second, which could enter the position on the “next bar open” (next second) but the condition is that the change in point must be 4 and -4 (long and short) on the 1 minute timeframe, how will that look.

    #186069

    See attached, if you want to go back to >= 4 then replace A13 and A14 with 4.

    Otherwise I’ve set up A13 and A14 for you in the optimiser.

    Run below on 1 second TF.

     

     

    #186131

    I have to say I like the idea behind it. Maybe trade the whole thing only in peak trading hours, maybe some trend on that…I would try on SP500. Small spreads and SL/TP can be placed very close.

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