Stop Profit doesnt work

Forums ProRealTime English forum ProOrder support Stop Profit doesnt work

Viewing 10 posts - 16 through 25 (of 25 total)
  • #226022

    yes, its the same

    #226024

    One hour later … and after typing a post which headed the wrong direction, this is the short answer :

    Because your trailing condition is not correct, you set the Set Stop Profit right away, and thus the exit happens right away.

    that.

    Killer, I am sure you are not satisfied with this answer, so just let me know – then I may post that more vague text, but which will be explanatory just the same. But in brief (what I think of it) :

    It comes down to using the Set Stop Profit on the wrong side of the price. You must first have profit, in order to set it Under the price. But because your condition is not correct, the command gets active right away and “profit” is taken accordingly.
    Add to this that the documentation is written out of sufficient context, and you may be using the command wrongly. But I can’t be sure about that.
    In any event, see below; the white line is your trailingsl. And you can see how it starts under the (entry) price. And the vagueness in all : let it start above the price does not work either. So it is the moment where you start using it, not being correct. And this just comes down to the If condition (see above) not being correct.

    I made a new .itf I originally wanted to post, but *that* could be with the wrong assumptions on what you actually want to achieve. So I better not post that.

    Regards,
    Peter

     

    1 user thanked author for this post.
    #226026

    thx, but this i didnt understand.

    1
    if hightradeprice(1) > 100 and longonmarket then 

    means for example if the tradeprice is 15000 and den high of the last bar ist 15150 then set the stop proft at 15100. Whats wrong? What is my misunderstand? And what is the correct condition?

    Maybe you can post your itf, so i can take a look at it.

    #226033

    Please remember what I said : this earlier made post will only make it more vague. But it gives some insight and from there you should be able to get it working.
    Main culprit remains : That If condition does not work out for you and now the Set Stop Profit will work against you.
    Ask questions when needed.

     


    I don’t know exactly what the idea is behind Set Stop Profit, but it does not work out the way you use it (also see below at the Disclaimer).
    https://www.prorealcode.com/documentation/set-stop-profit/

    The other day someone was fighting with Set Target Loss ? same thing I guess (but I did not try that). I think it was @ashehzi.

    The commands feel a bit “bad” to me . So what you you mean set a Stop for profit ? we set TARGETs for profit. And we set STOPS for loss (protection).
    I never used these commands, so undoubtedly I am wrong all over. Fact is, that it just does not work as advertised (which is without further context).


    In between the lines 😉
    I myself can be easily confused by the fact that I would use Set Stop Loss for the exact same, with the notice that I would set this when in profit. Notice that this just works (well) and that Set Stop Profit with that is redundant or not understood by me.


     

    So Killer, try the one attached. See at the bottom.

    Now it works exactly as you would expect it. **
    Notice that I (re)activated the spread, so that you can even better check that it works. Play with that; set it to e.g. 40 and see the results.

    Mind the ProfitParam I added for even easier checking.

    The Set $Profit vs Set Profit does not make a difference in this 1 point instrument case (1 point is 1 euro).

    I could be important that I tried this under V12, but I don’t think so, because you could not get it to work yourself either. However :

    Your trailing is not working well. See the white GraphOnPrice line (line 60). But I am sure you will easily solve that now, now it starts to work in the base.

    **): But it depends; the sheer fact that you use it under the condition of the trailing, suggests that you want to use it under the price, so that if the price drops the exit occurs and the profit is taken. This makes the culprit one thing only : your trailing condition is not right (and it isn’t).

    Regards,
    Peter


    Disclaimer : I feel that Set Stop Profit can be used differently (like we can set Stops or Limits at the wrong side of the Price) and possibly this is related to having more contracts (or better : cumulated orders), but Nicolas’ documentation does not talk about that. And in any event without further context, the command as described places the exit at the wrong side of the Price and goes out immediately.
    So to me it feels like Set Stop Profit can be used to lock in profit (price drops too much, so let’s take some of the profit). Thus from the documentation (I only read Nicolas’s) :

    Allows you to place a stop at X points / % / € / unit above the entry price of the position (for a buy order or below for a sellshort order).

    It would imply that you first are above the entry price and then at a certian stage apply the Set Stop Profit.

    1 user thanked author for this post.
    #226038

    Allows you to place a stop at X points / % / € / unit above the entry price of the position (for a buy order or below for a sellshort order).

    It would imply that you first are above the entry price and then at a certian stage apply the Set Stop Profit.

     

    Thx, but this is exactly what i have done: If the the trade is 150p in plus then set the stop in profit at 80 –> Allows you to place a stop at X points / % / € / unit above the entry price of the position (for a buy order or below for a sellshort order).

    With this condition the system will make only 1 trade or 1 trade and the following trades will be close in the same second.

    1. If  the stop profit wont be filled the system will make only one trade
    2. If the stop profit will be filled the system will have this stop profit anymore and close all following trades in the same second

    The solution could be to cancel the stop profit order, but how can i do this?

    #226039

    Thx, but this is exactly what i have done:

    Thank you. That is good to know. So this takes out the confusion in the post I wrote at first, as it is now known that it is your intention indeed to take the profit under the price.
    I am out for a bit of shopping and when back I will try to make it work for you.

    N.b.: Possibly you took this code from some regularly posted trailing code ? if so, can you give a link to that ?

    1 user thanked author for this post.
    #226040

    Thx a lot for help, now it works.

    This code must be at the end

     

     

     

    1 user thanked author for this post.
    #226042

    to take the profit under the price.

    For Longs:

    Yes this is my understanding, Set Stop Profit, example … profit currently at 100, lets preserve some of that if / when price falls back, I be happy to exit with 80 profit. 

    Similar (but kinda opposite logic) to Set Target Loss, example … Loss currently at 100, let’s see if I can get out with less loss if price rises, I be happy to exit at 20 loss.  

    2 users thanked author for this post.
    #226043

    This code must be at the end

    Ah super. And yes, you gave that clue already; I did not look back, but something in the realm of “the command retains to be active” without something like that setting to 0 explicitly. Well done !
    The real clue, of course, is that it always worked a first time and then stopped working. This exactly matches your solution. And your condition was correct at it. 🙂

    1 user thanked author for this post.
    #226045

    Similar (but kinda opposite logic) to Set Target Loss, example … Loss currently at 100, let’s see if I can get out with less loss if price rises, I be happy to exit at 20 loss.

    And now we need a matrix of  all these commands which will override each other. Example (made up and not tested) : A Set Stop Loss will not allowed to be combined with a Set Stop Profit. … Because they are both pending stops (?).
    And will the Set Target Loss be a Stop or a Limit ? … that kind of things.

    Could be quite undoable to work out, because only in practice you will be able to find out for real (practice : Live or Demo, and possibly not even everything for Demo). I mean, only last week I found myself to be a happy camper to be able to graph (thus in backtest) a pending stop for real so that it would match reality. But I could only do that because I had reality in the first place (from past Live trades).

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

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