stop loss code not working

Forums ProRealTime English forum ProOrder support stop loss code not working

Viewing 7 posts - 1 through 7 (of 7 total)
  • #99821

    Hi

    Was hoping someone can shed some light on the code below:

     

    In the back test i was expecting the worst trade value to be £100 but turns out as £466. If you swap the position of the set stop loss and trailing i.e. have

     

    then the worst trade value os £384

    If you change everything to 4*atr as below then the max loss comes to £232

     

    I’m quite confused as to what i’m doing wrong. Anybody able to help please?

    Kind regards

    JV

     

    #99822

    Since you are using two different SL instructions, the second one will always override the first one.

    Moreover, set stop trailing will backtest using a 1-pip step.

    You’d better using custom code, instead.

    You can retrieve many snippets on the forum or from the Snippet Library you can find using the search box.

    #99830

    jayvee – Welcome to the forums.

    There are some basic rules that everyone needs to follow when posting in the forums and you have broken two of them.

    Please always use the ‘Insert PRT Code’ button when putting code in your posts as it makes it much easier for others to read. The ‘Insert PRT Code’ button can be found at the far right of the tools that are located above the box where you type your post.

    I have tidied up the code in your last post for you. 🙂

    Also ensure that you post your topic in the correct forum. You posted in the General Discussion forum with a ProOrder autotrading related question. I have moved your topic to the correct forum.

    #99833

    Thank you Roberto and Vonasi. Apologies, will keep in mind next time; I’m new to this

    #99834

    I presume where it says in the documentation (https://www.prorealcode.com/blog/learning/kinds-trailing-stop-proorder/) the below is incorrect then?

    Is there a way of combining a hard stop loss (set stop loss x) as I’ve done above with Nicolas’ code as it only executes when the candle closes? Apologies, I know this is probably really basic!

     

     

    #99835

    Despite documentation, the line:

    is incorrect, since it contains 2 different kinds of SL on the same line. Use

    then add the above code, as is (provided you set your own pip values), to your strategy.

     

     

    1 user thanked author for this post.
    #99843

    40 pips for a forex pair like EURUSD is set with these instructions:

     

    2 users thanked author for this post.
Viewing 7 posts - 1 through 7 (of 7 total)

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