help with break-even code as a second position and second exit

Forums ProRealTime English forum ProOrder support help with break-even code as a second position and second exit

Viewing 15 posts - 16 through 30 (of 39 total)
  • #152041

    I’ve cleaned up the code and remove the exit indicator to see if the contracts continue but the code will continue to sell the second contract and that’s the one I want to allow it to run too continue basically i’ve added a picture and on the picture there’s a blue Arrow which shows a sell that is correct but there’s also a red arrow which also shows a sell I want to stop that one from happening

     

    #152047

    That’s because each time line 18 is executed, if conditions are still met, SELL will be executed again closing the second position.

    To keep it running (until you add a condition to close it), replace line 18 with this one:

    so it will execute SELL only the first time.

     

    1 user thanked author for this post.
    #152051

    That is absolutely brilliant thank you

    #152060

    I am so sorry to ask for more help with the same indicator,

     

    I can’t get the short side of a position to work not too sure what it is if you don’t mind thank you very much

    #152061

    I’ve played around with it I found the sell shorts and exit shorts were wrong but I believe the line 16 is not right for shorts i’ve adjusted that as well

     

     

    #152063

    Yes, correct.

    1 user thanked author for this post.
    #152152

    Hello i’m afraid that system that you have helped me build may have an underlying fault built into it or it might just be a part of the sellshort side of the code,
    What I have is a screenshot the top 1 is the normal logic and the bottom one is the break-even and scale-out and as you can see the bottom one does not shortsell as much as I think it should and when you compare it to the normal logic it looks bad i’m wondering if there’s anything that can be done here, thannk you

    I will post both systems normal logic first then the break-even

     

    #152157

    There’s always something to be done. If something doesn’t work as expected it’s just a matter of making it work!

    Append these few lines at the end of your code:

    you will be able to see data plotted using GRAPH in the variable window of ProBackTest and data plotted using GRAPHONPRICE on your chart,candleby candle.

    You will be able to detect any wrong value that may cause issues.

    You can add more variables, if needed.

     

     

    1 user thanked author for this post.
    #152164

    Definitely should be some shorts there you can see an August at the beginning of the chart there’s a crossover and it not on market yet no short and in September there’s a long where they shouldn’t be it goes long yet the qqe has not crossed over i’m going to test a different indicator “what if it’s the indicator”

    #152166

    Eureka I found it he was the indicator numbers

    #152363

    Hello I’ve noticed some anomalies on the chart and I’m not too sure what they are are I’ve uploaded a picture and I put red arrows on it they don’t affect the equity curve nor is there contracts for them i’m wondering if they can affect the trading backtest algorithm or if on market and the blue arrows show a buy but the conditions for the trade was not met the qqe did not crossover, i’m thinking that’s a problem with the code for the QQE or if it repainted.

    thank you

    #152367

    You should duplicate line 5 and move one of them just after line 17 and the other one after line 62.

     

    1 user thanked author for this post.
    #152411

    Hello thank you

    I did that and had exactly the same results so no real effect by doing that

    #152419

    What is exactly the problòem where the arrows are plotted.

    What date are those candles?

    Since there’s no variable declared in the original indicator I don’t know in which order you arranged them, when you call the indicator, is the first parameter the RSIperiod?

    #152431

    Yeah sorry I did not know no what was causing that one contract to come into the market and then go out and like I said it was not affecting the equity curve and it wasn’t showing any contracts on the price chart those blue Arrows that I pointed out in the picture, so what I did I started to strip away at the code and take stuff off so I took the break-even off and that did not affect it and I simplified the code just long and it was still there it’s obvious now to me that is the take profit contract for some reason

    I thank you very much for your help so far

Viewing 15 posts - 16 through 30 (of 39 total)

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