Help programming this code to trade shorts as well

Forums ProRealTime English forum ProOrder support Help programming this code to trade shorts as well

Viewing 6 posts - 1 through 6 (of 6 total)
  • #57766
    Hi!

    I’m new to programming so need some help.

    Why can’t I get this system to trade shorts as well?

    Thxs, Magnus

     

    #57772

    Rules of the forum are written in bold and in the yellow box just above the text editor when you write a post, please respect them. Thank you.

    At line 35 of your code, you must use SELLSHORT to initiate a new sell order, SELL instruction is made to close long orders.

    Same for line 40, use EXITSHORT to close a short position.

    #57838

    Thanks Nicolas, but now I don’t get it to take any positions at all..? Am I doing it all wrong?

    Sorry to waste your time on trivialities!

    #57840

    Should work if you only changed the lines 35 and 40.

    #57855

    I played about with it after I got no trades (even after Nicolas change) then I got it to trade but was a  ‘oblique path to doom’ (looked like all losers?) then I reversed the buy sellshort conditions (as a quick look see) but still not good.

    Then I started to change the code and got trades on Daily TF and 4 Hours, but was still looking way out so I abandoned it.

    I reckon you should comment out all except 1 entry and 1 exit condition and get it trading and then uncomment more … making  only 1 change at a time?

    Please post results as I may get back into it at some stage?

    GraHal

     

    #57858

    You can test each variable with the GRAPH instruction while backtesting, that way you’ll get a better view of what’s not working:

    Just add these lines at the end of the code and launch a backtest.

    If a variable is true, then it should be equal to 1, and a new order should be initiated as per your conditions.

Viewing 6 posts - 1 through 6 (of 6 total)

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