profit reduces by 33%

Forums ProRealTime English forum ProOrder support profit reduces by 33%

Viewing 15 posts - 1 through 15 (of 40 total)
  • #69043

    I have a buy order

    initial stop is 20

     

    market went in my favor say to 30,40,50 etc

    when market moves back  I want keep  66 .6 profit

    if longonmarket then

    if  ( x-close)<=.66*(close-tradeprice) then

    sell at market

    endif

    endif

     

    what is the X? how to code variable X

     

    #69049

    Try this one

    Roberto

    #69052

    I’ve added above to the Snippet Link Database

    https://docs.google.com/spreadsheets/d/1rgboqj7sVwsP9ZRhOduOefye48QMWC07jWVXCl-KJPU/edit?usp=sharing

    Thank You @robertogozzi

    1 user thanked author for this post.
    #69055

    I’ve added above to the Snippet Link Database

    https://docs.google.com/spreadsheets/d/1rgboqj7sVwsP9ZRhOduOefye48QMWC07jWVXCl-KJPU/edit?usp=sharing

    Thank You @robertogozzi

    Sorry GraHal, I forgot to (as I do most of times). Thanks for paying attention.

    #69065

    Thanks for your fast reply Roberto. I have am back testing this now, will take another 4 to 5 hours get decent result.

    I my guess it may not work, as soon as the  profit falls below the 30 , the stop will go to the original stop loss

    I am keeping fingers crossed, I will post the results by EoD today

    #69067

    This trailing SL is hard coded in your strategy, not managed by ProOrder or your broker, it’s a pending order to be set at each new candle.

    You may as well have set your stop ploss at, say 100 pips, but still exit in profit as this code is progressing candle after candle.

    #69071

    please find the screen shots

    if max profit once gone past 30 say 36

    I want keep stop loss .66(tradeprice+36) at least in the event market is coming back.

    on the other hand if the profit goes to 60 i want keep .66(tradeprice+60)

     

    I tested the code is not working, as the price keeps falling after >=30 SL coming down by .33%

     

     

     

    #69074

    Well… It works almost like that, but if it reaches 50 pips profit Y will be set to 33.3, but if the next candle decreases to 40 pips profit, it won’t keep 33.3 but will decrease to 26.6.

    I will make a change.

     

    #69075

    This should work

     

    #69076

    I am running the strategy on 3 sec or 5 seconds range.

    it is keeping changing, the whole is ideas is keep some profits.

     

    how above set stop loss trailing SL

    SL=(1-y)

    #69080

    thanks, I am doing back testing, will update the feedback soon

    #69110

    I have back tested even modified code is not working

    it strange.

     

     

    #69118
    Leo

     

    Try this.

     

    #69120

    Hello Léo

    I don’t understand  : MaxX=MaxX=max(x,MaxX)

    could you explain me  well detailed ??

    #69128

    back testing is on , collecting sample data before conclude whether the code works or not.

Viewing 15 posts - 1 through 15 (of 40 total)

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