Scale out strategy

Forums ProRealTime English forum ProOrder support Scale out strategy

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

    Hi guys, first post on this great forum. Just a quick question, I have made a strategy from a few bits of code found on this site. The strategy is ment to buy two contracts at entry conditions and set stoploss at 1.5xATR, then it is ment to sell 1 contract at the first profit target which is  1X ATR and also move the stoploss to breakeven/entry price, then sell the remining contract at exit condition. When running backtest I am having issues with the first contract not selling sometime. Anybody have any ideas. As you can tell by my code I am vey new to this.

    Thanks guys.

    Cheers.

     

     

    #166973

    Anybody have any ideas.

    It could be to do with use of EntryPrice = TradePrice(1)?

    When 1 lot of a 2 lot position has exited then TradePrice(1) would equal to the exit price of the 1 lot … I think I am correct in saying ?

    After the 1 lot has exited, you would need to use  EntryPrice = TradePrice(2)?

    Best wait until somebody confirms I am correct in my assertion above … before you spend too much time changing your code?

    You can use GRAPH TradePrice(1) to check if what I say above is correct?  Be sure to let us know please.

    #167004

    Thanks for yor time. I will try this and see how it goes.

    #167070

    Thnaks for the GRAPH tip, makes problem solving alot easier, had a few mistakes in the code.  One issue I have is the ATR stoploss and profit updating on every candle. Is there a way of taking the ATR value from the trade entry candle only?

    ATRP = AverageTrueRange[14](close) //ATR for inital profit short
    ATRS = AverageTrueRange[14](close) * 1.5 //ATR + multiplier for stoploss short

    SL = EntryPrice + ATRS //set stoploss at 1.5x ATR short

    The above code which I am using now changes the stop loss & profit every candle.

     

    Thanks.

    #167072

    Is there a way of taking the ATR value from the trade entry candle only?

    Yes … include the ATR values within the … If Not Longonmarket (and Not Shortonmarket) Endif … statement for entry conditions.

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