Take profit last low / last swing

Viewing 15 posts - 1 through 15 (of 50 total)
  • Author
    Posts
  • #183505 quote
    phoentzs
    Participant
    Master

    A question regardless of the time frame. As you can see in the picture, my entrances are relatively clear. But that has never been my problem either. My problem is how do I define / code the goal, the takeprofit. Highlighted in color on the picture. In this case it is the final low. Does anyone have an idea how I could code that?

    61C7A55E-9796-444F-8032-CAD6BF2AA88D.jpeg 61C7A55E-9796-444F-8032-CAD6BF2AA88D.jpeg
    #183507 quote
    GraHal
    Participant
    Master

    ArrayMin ?

    https://www.prorealcode.com/documentation/arraymin/

    Or maybe we can’t define Lowest Low until we have a Higher Low?

    Looking at the Chart, how about FastAverage[Period,Type](close) > SlowAverage[Period,Type](close)

    Good Topic! 🙂

    #183508 quote
    phoentzs
    Participant
    Master

    Or simply getting out of the backcross MACDHISTO? In the picture the end of the movement. 🤔 Unfortunately, I have no idea about arrays. 😁

    35254941-7B47-490F-B45E-612E59904D24.jpeg 35254941-7B47-490F-B45E-612E59904D24.jpeg
    #183510 quote
    phoentzs
    Participant
    Master

    I’ve been doing this all day, manually mind you. With different assets. Wave diver SMA20 / 200 with filter in the M1 works as a mechanical variant. At least today. As I said, I only work from my cell phone at the moment. MACD pullback works very well as well. I’m just looking for a way to get out of the car. An indicator that shows me this or a calculation for the TP.

    #183525 quote
    GraHal
    Participant
    Master

    Did you see the Topic below … MAE using Arrays!

    I might even have a go myself, something new to revitalise interest! 🙂

    https://www.prorealcode.com/topic/mae-maximisation/

    Ha, I fell at the first hurdle … as the code is written, it won’t give us the turning point. Code on the link above is for the MAE after several Orders.  But I’m sure a man of your coding calibre can adapt it phoentzs ? 🙂

    #183529 quote
    GraHal
    Participant
    Master

    Haha I’ve got it doing ‘something’ … there is no exit in the code apart from using Array values!

    Need to do some jobs now, but more later hopefully!

    Array.jpg Array.jpg
    #183531 quote
    nonetheless
    Participant
    Master

    you should be able to use the inverse of a Donchian stop

    // DONCHIAN STOP
    Upper = Highest[D](high)
    Lower = Lowest[D](low)
    if longonmarket  then
    laststop = Lower[1]
    endif
    if shortonmarket  then
    laststop = Upper[1]
    endif
    if onmarket then
    sell at laststop stop
    exitshort at laststop stop
    endif

    not tested but I think it would be:

    // DONCHIAN EXIT
    Upper = Highest[D](high)
    Lower = Lowest[D](low)
    if longonmarket  then
    takeprofit = Upper[1]
    endif
    if shortonmarket  then
    takeprofit = Lower[1]
    endif
    if onmarket and positionperf >0 then
    sell at takeprofit limit
    exitshort at takeprofit limit
    endif

    optimize D for how far back you want it to look for the last dip / peak

    #183533 quote
    phoentzs
    Participant
    Master

    @ Grahal Thanks for your approach. Maybe you could post your version of the code? I still don’t really get it. 🙈 I had already worked through the subject of arrays. Unfortunately, since I’m not a big coder, I still haven’t understood how it works.

    #183534 quote
    phoentzs
    Participant
    Master

    @nonetheless Thanks for the suggestion. I understand this solution. 😁 I could try that.

    #183537 quote
    JS
    Participant
    Senior

    Nice idea nonetheless

    But I think it will take profit the moment you enter.

    The price is already above the previous Upper (when Long).

    #183538 quote
    nonetheless
    Participant
    Master

    I would also try different values for D upper and D lower, ie DL and DS, as falling price patterns can be very different than rising.

    #183539 quote
    nonetheless
    Participant
    Master

    But I think it will take profit the moment you enter.

    not if D = 200 (for example)

    #183540 quote
    phoentzs
    Participant
    Master

    Here on the M1 Nasdaq last night. Long entrances green vertical marking and exits in red. The system is the wave diver, works only with the SMAs. But gets out very precisely near the summit.

    081B05FB-D882-44EC-A7BC-69DBEA090880.jpeg 081B05FB-D882-44EC-A7BC-69DBEA090880.jpeg
    #183544 quote
    Eric
    Participant
    Master

    Limit fractal low?

    FRACTAL.itf
    #183548 quote
    nonetheless
    Participant
    Master

    you could also just use a fast MA with very little lag, like Least Squares or Time Series

Viewing 15 posts - 1 through 15 (of 50 total)
  • You must be logged in to reply to this topic.

Take profit last low / last swing


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 49 replies,
has 7 voices, and was last updated by phoentzs
4 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/17/2021
Status: Active
Attachments: 20 files
Logo Logo
Loading...