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 - 31 through 45 (of 57 total)
  • #76886

    Wow , thank you, 3 masters. 🙂

    Just backtesting now.

    Many thanks for all 3 contributions. 😉

    Have a good weekend.

    #76903

    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 🙂

    I WAS on my phone (I also wrote TradeInex instead of TradeIndex, but on the phone I couldn’t see whether it was highlighted or not!) . Thank you Vonasi.

    #82554

    I was trying to add 2 time conditions, but it doesn’t seem to be working.

    Could somebody advise where I have gone wrong please?

    #82574

    There’s a missing ENDIF at line 37.

    Also, testing MY CONDITION at line 29 is useless (but this does not affect performance) since it’s been already evaluated at line 27.

    1 user thanked author for this post.
    #82657

    Robertogozzi,

    Many thanks for your email reply. 😉

    I added an, ENDIF in line 37, but the code doesn’t work?

    I get a syntax error: the following variable is undefined : my condition.

    Many thanks for all your help.

     

    #82664

    I thought MY CONDITION was a plain text to refer tou tour own undisclosed conditions.

    Variable names cannot have spaces, nor special signs, only aphanumeric characters.

    You will have to define what your conditions are and write them in palce of MY CONDITIONS, say

    or the like.

    #82667

    Roberto,

    Ok thank you, I will try.

    “my conditions” referred to the time, eg timenterbefore1 etc.

    i did write tcondition, but it still didn’t work.

    Thanks

    #82670

    MYCONDITION, TCONDITION or whatever else you write MUST be defined before being used, if it refers to the time conditions already in place, just remove it.

     

    #82781

    robertogozzi

    Thank you, that made it work. 😉

    #83081

    Hi,

    Please could somebody clarify why my code works some days and not others.

    On 5/10/18 my code worked, how I wanted it to work, 0805 it went short, after the breakout of the conditions, yl / yh.

    On 8/10/18 my code didn’t work at 0755 short, when it should have, but activated at 1505n short? It’s the same code, the backtest proves it doesn’t work all the time.

    I have experienced it on other days as well, sometimes it works and sometimes not, not sure why?

    All I was after was a simple breakout strategy, but it seems I may have coded it incorrectly.

    Many thanks in advance. (The code should be attached)

    #83093

    On which instrument and TF?

    #83094

    Sorry. 🙄

     

    Wall Street, 5 min chart.

    #83100

    I think line 30 should read “close<yh-os“, but the cause for not entering on 8/10/18 at 0755 is because the previous bar, when the pending orders are placed, the short order was NOT place du to false conditions, because CLOSE (26435.1) < Y+OS(26435.6) and conditions at line 28 were not met.

     

     

    1 user thanked author for this post.
    #83102

    You can use GRAPH to display variables at runtime, with their values retained each bar.

    This debugging tool will help find out errors quickly (well… a bit quicker).

    1 user thanked author for this post.
    #83105

    Many thanks again Roberto. 😉 I will have a look into the graph function.

    I have changed the code, as you instructed above, it works on the 8/10/18, but there are more trades it does not take, where as the old code did.

    I presume there is no way of re-wording my code, to simplify it, so when the price crosses the breakout points,  yh / yl , it buys/sells regardless?

Viewing 15 posts - 31 through 45 (of 57 total)

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