I feel I’ve reached a low point in my coding … it takes me too long (rest of life suffering! 🙂 ) to get other than simple strategies up and running … but I still have lots of ideas I want to try out.
I coded a strategy over the weekend and it has entered a trade at a logical point in the price curve, but I want to try a version that will reduce – gains turning into losses – by using the structure of the price curve.
So you super coders, anybody want to post code to achieve the attached scenario?
If what I am after is not clear, please just say.
Thank you in Anticipation
I can think of just two ways to work it out:
- trailing stop (and you can use some of the many kinds you can find on this forum)
- exit on a filter, in your case it could be an MA that, when broken downwards before reaching TP, will exit the trade
did you expect some different solutions?
Thank you Roberto … no wonder I was struggling! 🙂
Yeah maybe I think you supercoders can code anything that is showing on the screen.
did you expect some different solutions?
Yes, I was trying to code up an exit strategy that involved the following …
Ha = Highest[x](close)
price curve followed by
La = Lowest[y](close)
price curve followed by
Hb = Highest[z](close)
Hb - Ha > a*pipsize
Exit at ((Lowest[y](close)) - b*pipsize) stop
I did get above working and optimising etc, but it kept blowing all the money in the first few weeks! 🙂
Re above … I was attempting to get Ha followed by La followed by Hb by setting the optimisation ranges accordingly.
So for example my optimisation range for …
- Variable x was 100 to 1000
- Variable y was 50 to 750
- Variable z was 25 to 500
I dont’t usually care much about curves, but rather horizontal lines plotted (theoretically) by my trailing steps, it’s the market plotting curves!
I really can’t think of a better way to adapt to curves other than using a Trailing Stop code. You can trace newer highs (or failed newer highs), then new lows, then exit your trade…. that’s just stop trailing!