Highest function in for loop

Forums ProRealTime English forum ProOrder support Highest function in for loop

Viewing 5 posts - 1 through 5 (of 5 total)
  • #240582

    Hi Guys,

    I need a little help with some code that I cant seem to get to work probably. I’m trying to detect  if a cross of the highest function has occurred within the last 20 bars. Can you use the highest function in a for loop. I am heading towards a breakout system with a pullback.

    I have tried the code as an indicator and I seem to get the right output but not in trading system.

    Thanks Carter

    #240590
    JS

    What is the difference between the outcome of the indicator and the trading system in the backtest…?

    #240594

    With the indicator I get the expected histogram when triggered but in the back test I don’t seem to get any triggers. I used the graph function to try and see what was happening in the back test but it came out blank. I have simplified the code to find the issue because when included there were no trades taken. So when I started to investigate it seems as though a never get a positive result from the loop. maybe I’m missing something. Please find indicator code below I was using.

    Thanks Carter

    #240596
    JS

    When I use your original trading system, it does generate positions…

    I have set the number of contracts from 0.2 to 1…

    The signals are a bit “treacherous” for example the signal “b1” can remain valid for 20 bars so within 20 bars after the actual “trigger” more buy signals can follow…

    #240598

    Try rewriting line 3 this way:

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

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