Would you be able to provide me with basic code that would (once long a position):
Exit in 1 of 2 ways:
1) Stop loss which is triggered when the 50 day MAV turns down (prior it is trending up).
2) Profit target = 100 day MAV (stock is currently below the 100d MAV).
Thanks.
Size:
Color:
What is the stop loss level? Do you mean to simply exit the Position when the 50 dma turns down?
Size:
Color:
The rules aren't entirely clear to me. Hope that helps.
CODE:
Please log in to see this code.
Size:
Color:
This is helpful, thank you very much. However, more specifically, I would like the SellAtLimit to occur at the 50 MAV and be entered as a limit order each bar. I.e. I do not want to have to wait until it crosses and then sell the position on the next bar. I want the order to be in as a limit order at the 50 MAV.
Does that make sense?
Thanks for your help.
Size:
Color:
Yes, makes sense. Comment the line with the condition.
Size:
Color:
Perfect thanks.
Size:
Color: