Hi, Appreciate some help understanding what might be wrong with my code for a simple MacdEx crossover buy / crossunder sell.
When I run it, it seems to work, but when I look at the charts, it seems to buy even though there does not appear to be an immediately recent crossover. Or maybe my chart panel is messed up, or whatever.
As one of many similar occurences, it shows a buy for RDC on 6/27/2014, and a sell on 1/13/2015. What is triggering the buy on 6/27 ? Thanks.
CODE:
Please log in to see this code.
Size:
Color:
Hi,
The priority code borrowed from gbeltrame's "n-Liner" series of scripts applies to multi-position strategies. Here it worked incorrectly. Replace the trading logic with this one and the false trade will disappear (actually, the trades will be totally different):
CODE:
Please log in to see this code.
Size:
Color:
Thank you. I wish to include a priority cutoff to reduce often excessive number of signals. How can that be done here?
Size:
Color:
You might want to use the
Position Options PosSizer from
MS123 PosSizer Library. It provides the ability to reject a Position if its Priority value is less than or greater than some threshold.
Size:
Color:
Wow. Thanks.
Size:
Color:
swuzy said, "I wish to include a priority cutoff to reduce often excessive number of signals."
Eugene said, "It provides the ability to reject a Position if ..."
Keep in mind that "signals" (Alerts) are not the same as "Positions" (backtest). PosSizers can't change the number of Alerts.
Size:
Color: