Hi Cone & Eugene,
I'd like to limit the buying time of a system to within 10 days of a 21 day high.
If Bars since last 21 day new high is less than 10
If Price is 5% less than 21 day high
BuyAtMarket
How would I create that 10 day window following the 21 day High?
Thanks again for your help
Tobey
Size:
Color:
Size:
Color:
Hi Eugene,
I tried to adapt the code you showed me but I didn't get all the way there. I'm not sure what the _howMany parameter is.
Here is my poor attempt. Is there more information, other examples or do you have another suggestion?
Thanks again for the help
Tobey
CODE:
Please log in to see this code.
Size:
Color:
Size:
Color:
Hi Eugene,
Thanks for the Code! Pretty fancy with variables in the Description. I hadn't seen that before.
It looks like the code is setting the 10 day buying window from the cross to a new high. This is OK even with a couple of new high days, but with a run up of a few days you're shorting the buy window. How could the count for the buying window be set to the most resent high?
CODE:
Please log in to see this code.
Once again thanks for the help and the fancy code!
Tobey
Size:
Color:
Tobey,
You're welcome.
A runup resets the condition, not shorting the buying window. It's always 10 days (or whatever the "Within" slider is set) since the last new high. Could you show me an example in some particular stock?
Size:
Color:
Hi Eugene,
Yes you are right. Every thing is working.
I did add your variable code to the green background
CODE:
Please log in to see this code.
CODE:
Please log in to see this code.
I also added an additional line to your xPane just for looks.
CODE:
Please log in to see this code.
The attached chart of PVH shows what I am seeing. The detail chart show the last signal. In that case it did not pickup the 3/29/17 High of 104.28. But this could be a data issue not a code issue.
I really appreciate your help! This is fare better than where I started out.
Tobey
Size:
Color:
Hi Tobey,
I see, good observation. I think this should get there. Set "Within" to 15 bars to get an alert for tomorrow on PVH:
CODE:
Please log in to see this code.
Size:
Color:
Hi Eugene,
You got it! It works great! Many thanks!
Tobey
Size:
Color:
You're welcome!
Size:
Color: