How to create a breakout box between 2 hours, Code please?

Forums ProRealTime English forum ProOrder support How to create a breakout box between 2 hours, Code please?

Tagged: 

Viewing 15 posts - 16 through 30 (of 57 total)
  • #75863

    You shoud add

    in lines 26 and 29, just before THEN.

    Those days are FORBIDDEN, just remove the ones you want trading to be allowed.

     

    1 user thanked author for this post.
    #75867

    robertogozzi,

    All inserted and working wonderfully.;)

    Many thanks for all your help.

    #76499

    I have been using the Auto Trading and it is working great, after all of the help from everybody 😉 but it only ever buys £1 per point, either way.

    I have been into Options>Trading Options > Auto trading, but there is nothing for position size? ( I have seen it on the simplified creation) and on the website link https://www.prorealcode.com/blog/learning/money-management-prorealtime-code/ from Nicholas, but I can’t seem to add it in.

    If I want £3 per point, example, how can I add this please?

    The link above does state how to amend it, but as my code has gotten longer and longer, I keep getting error messages when I try to insert the position size.

    #76501

    I keep getting error messages when I try to insert the position size.

    It would be easier for everyone if you posted the code on here as otherwise we are all just going to be guessing what you might have done wrong.

    #76502

    Lastly, I have a slight issue with the breakout box settings,  if the time condition is 8-8, as below:

    tcondition = time>080000 and time<200000.

    Eg: Sell example: If the price has moved out of the breakout box at say 7:30, it seems to buy at 8 regardless, I would like the sell trade to be cancelled if the box has been broken before 8.  The buy remains active, but the same conditions as the above.

    Hopefully this makes sense.

    #76503

    Hopefully this makes sense.

    I don’t know what else might be wring as I am just about to run it, but surely Lines 25 to 32 need to read as below (without PositionSize 3) ??

    Also DaysForbiddenEntry in Line 3 is not used in the code??

    Attached is what I get on DJI at 10 min TF (what TF and Market is it supposed to run on?). Ignore the Win %, it is low due to the PRT Even Trades Glitch some of us are experiencing.

     

     

     

    1 user thanked author for this post.
    #76510

    GraHal,

    Many thanks, 5 min chart, I am on.

    I have added the forbidden code in.
    Removing the position size works on a back test, but how do I code in, the position size, (i.e £3 per point instead of the standard £1 per point)
    Also, eg DJI, 5 min chart,  2/7/18. Breakout box was broken at 6:05, the system bought at 08:50, not sure why?
    I would like to code in, if the price has broken out already before 8, the sell trade gets cancelled. (same conditions for the buy)
    #76513

    It’s ok, forget my ramblings, I have made it all work. 😉

     

    #76791

    Is it possible to add a non trade condition to the pro auto trading?

    I would like to add a condition, in that, if the breakout box is over 300 pips, the trades, buy and sell are not allowed to happen.

    I have tried to code it in, but for some reason it won’t work.

    Please could somebody have a look and see where I have gone wrong.

     

    #76794

    Add

    to lines 33 and 37.

    1 user thanked author for this post.
    #76797

    Roberto, top man. 😉

    You guys are great.

    #76881

    I’m hoping this is the last question. 😉 Sorry Roberto.

    I have read lots about selling after n bars, but I would only like to sell after n bars, if the trade is losing.

    I have input the following code, but it sells regardless of profit / loss.

    Is it possible to remain in the trade after 30 bars if winning, but if after 30 bars I am losing, it sells the trade?

    Many thanks again in advance.

    #76882

    You need below or something similar… 🙂

    position perf is a %

    OR

    syntax might be wrong, I have my grandkids here and they want to watch Horrid Henry! 🙂

    #76884

    The code you found lets you close any open trade after N bars, regardless of performance, you ahould add a condition testing whether TRADEPRICE is higher or lower than the current CLOSE  and act accordingly.

    this will close any long trade after 10 bars if the curent price is below entry price.

    #76885

    I think it should be (Barindex – TradeIndex) and not (TradeIndex – BarIndex) and it closes after 30 bars not 10.

    I’m guessing you are on your phone Robertogozzi as the code was not inserted correctly – I tidied it up for you 🙂

    1 user thanked author for this post.
Viewing 15 posts - 16 through 30 (of 57 total)

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