Help on open price of trade retainment

Forums ProRealTime English forum ProOrder support Help on open price of trade retainment

Viewing 6 posts - 1 through 6 (of 6 total)
  • #132971

    Hi

    Yet again my head is numbing, I’ve created a program trailing a stop with the highs and lows, however I want to  use the initial stoploss level as a reference.. for starting the trail.

    So I could do this with MTF using a second or 2 second chart, but this limits my backtesting too excessively.

    Help with stoploss level retention?

    and

    Open price level retention?

     

    I’m guessing its a command I’m not locating or a simple line of code..

     

    Any direction?

    I’m thinking something like the above code written here as well placed after the buy code:

    But I think this will produce a new value of open each candle

    I can likely code it after losing some numbing 🙂 , but is there a simple command to reference it or a simpler logic to that which I ‘m using?

    #132973

     

    Ah, maybe the “once” command – LOL

    #132999

    So that works for some instances – any help if I need to get an actual level such as price it buys at on a cross signal, as I can do this with MTF, but that severely restricts back-testing if using second candles –

    Another option would be usefull to allow better backtesting..? 🙂

    #133008

    TRADEPRICE will always return the price of the last trade so if your starting stoploss is calculated from the opening price then you can calculate it at any time after one candle has been onmarket from TRADEPRICE.

    ONCE is no use to you. Anything following ONCE is done only on the first candle after your strategy is launched and on no others.

    When we send an order to the market to open a trade we cannot know the opening price of the next candle with out a crystal ball so we can only hope that it is the same as the close of the latest candle. We can store any value at the time we send an order simply like this:

    The second bit updates the opening value of x after the close of the first bar to TRADEPRICE just in case it is different to the close of the previous candle.

    #133087

    Ok thanks Vonasi

    I will go and take a look at that.

    I’ve created a trail that works well on a particular trade, using it for the 4hr trend on a 7hr trade, though it drops some winning trades, financially it can be better with the trail, its part of a 2 prong approach as I have another code on the same trade using same strategy but referencing the 2 scenarios seperately, so this is one part – half of the strategy, but I want to see if I can pick up the lost trades when backtesting, but haven’t referenced the levels yet just the HHs and LLs accordingly. So that may be useful if I try referencing the TradePrice value and to do things like only start trail if it comes past the open price + initial stoploss or the like, or if following the trend earlier is more beneficial, which is what it is doing now – just want to see if I can refine a little further as it does on occasion turn a winning trade into a losing trade, so want to get the improved results without that happening, though its kinda good as it is but just looking to tweak and use it as a learning curve for programming.

    Cheers for the support, I’ll be playing around with that with different ideas…

    Trail v No Trail pics attached – not much difference financially slightly better here , but backtesting further can be around the same financial difference inverted.

    Pics attached.

     

    #133144

    Graph and GraphonPrice useful tools when learning – I’ve got this up live, but from what I can see thats not actually a trailing stop, but a stop reduction after a certain bar count if the loop matches the prior highest high or prior lowest low, but I’m not 100% sure yet but all I’m seeing is a varying loop sequence and then it breaks I think once the values match and it reduces the Stopploss to the value, not as a trail but it seems to be in reference to the opening price as it resets the stoploss value instead of using it as a trail,  So the logic I think is “once th eloop is seing a match to the HH or LL then reset the stoploss value… I’ve got some more finer analysing to do.

    An interesting concept for programming reducing stoplosses if thats what its doing ?!?!? LOL , but I’ve also been able to use the graph and graphonprice to  develop an actual trailing value, which I now need to set as a trailing stop of course… – Getting there… I may find that this initial fluff could prove to be better, but we’ll see… 😀 –

Viewing 6 posts - 1 through 6 (of 6 total)

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