Set stoploss with percentage

Forums ProRealTime English forum ProOrder support Set stoploss with percentage

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

    Hi,

    I have this code before,
    https://www.prorealcode.com/topic/rsi-automated-buy-and-sell-request/

    But would like to develop a stop loss function with this. I want it to buy when it buys, but I want that if I lose more than 0.3% then I want to sell, just as security, otherwise I want to sell at the highest similar to what the code shows, in this case: if onmarket and myrsi > 70 then sell at market

     

    1 user thanked author for this post.
    #116342

    k3rex – Your topic has been moved to the ProOrder forums which are for automated strategy topics. You posted in the ProBuilder forum which is for indicator topics. Please try to ensure that you post in the correct forum with future topics.

    #116343

    Just add:

    to the bottom of the strategy and it will sell when price hits 0.3% below your buy price.

    Alternatively you can add:

    and it will sell at the close of any candle that closes 0.3% or more lower than your buy price.

    You should check that 0.3% is not too close to price as your broker will have a minimum stop distance and reject any order that is too close and possibly stop your strategy. You can use use MAX to try to ensure that no order is sent that is too close although sometimes brokers can add a big spread and a big minimum stop distance during high volatility so this is not totally foolproof.

    For example if the minimum stop distance is 5 then the following will ensure that the 0.3% order is never closer than 5.

     

     

    1 user thanked author for this post.
    #116539
    if onmarket and myrsi > 70 then
    sell at market 
    and then make an short position? So when the short position hit :
    if myrsi < 30 then
    buy 1 contract at market
    endif
    I mean the RSI 30-level and then sell it? Like it goes around like a circle.
    So what I mean is, when you reach the 70 level, then it becomes a short position and it sold when you reach the 30 level, and at the 30 level you buy and sell at the 70 level, and of course 0.3% stop loss function is inserted so you do not lose any capital.
    #116563

     

     

    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