Hi, I'm new to this and I have been trying to run a simple strategy of buying when the fast moving average is below the slow moving average and crosses through. I've run a backtest on the WLP 100 and for some reason I'm not always getting a buy signal when the averages cross. HPQ is one of the stocks I was looking at. Any suggestions?
Size:
Color:
What's your position sizing? On a portfolio of 100 stocks, how many trades were not taken due to insufficient capital?
P.S. Please see:
How to report a Problem?
Size:
Color:
I was using $1000 raw profit mode and back testing for all data. Some of the charts do not show a buy signal when the fast moving average crosses upward through the slow moving average. I think when I ran the back test I had 2 with errors for insufficient capital.
Size:
Color:
Where's the script and what are the symbols?
Size:
Color:
In RP mode, trades are not skipped due to insufficient funds - that was probably a different option.
Please revisit the link above and be more explicit about the strategy rules, the date when you think a signal should be generated (also specifying the bar scale used).
Size:
Color:
There is one reason a trade can be skipped in RP mode - the dollar size must be at least large enough to buy 1 share of the instrument. So, if RP were 1,000, you'd wouldn't be able to trade any stock (or index) that was ticking over $1,000/share.
Size:
Color:
Oh, that. Thanks.
Size:
Color:
Here is the code which is just the preset codes available. I was thinking HPQ should of had a buy signal around bar 4377 on April 15th, 2009. I found others as well but this is one example. Thanks for the input.
CODE:
Please log in to see this code.
Size:
Color:
Right, a crossover happened on 04/15/2009. You're trying to buy at limit [of that day's close = $34.85]. Next day, the stock gapped up (35.50) and the low of the day was 35.46. The limit order thereby doesn't have a chance to be filled. Use a market order to collect more trading signals.
Now you see that being detailed is the key in troubleshooting?
P.S. Please paste your code inside a pair of CODE tags next time. tia.
Size:
Color:
Thanks, that makes more sense to me now. I don't know what the code tags are as I'm very new at this.
Size:
Color:
The code tags is the label that reads "CODE" right above the message entry field (Bold, Italic, Underline etc.)
Size:
Color:
One last question: Right now I'm getting my alerts at the end of the day. Is there a way to get them intraday as the fast moving average crosses through? Same code as above. Thanks again for all the help.
Size:
Color:
Size:
Color:
If you're using a SMA Crossover strategy, you should definitely check out RevEngSMA_TC. Your signals will occur 1 day earlier about 95% of the time with very few false alarms. Keep in mind, however, that can be a double-edged sword.
Also, like Eugene said, you can't currently use "partial bar" data in a script, however, you
can calculate the Daily moving average on an intraday basis. The example shows you how to do it and compares it to a Daily-synched SMA. You'll notice that the two indicator averages "synch" on the last bar of the day. Also, you'll see that this doesn't buy you much in the "look ahead" department since the biggest change in a moving average occurs when the front bar slides out of the average's window.
CODE:
Please log in to see this code.
Edit 10/8/2010: Just spotted an error to this procedure, now corrected.
With this correction, there actually does seem to be an advantage to using the partial bar method... subject of an upcoming TSL.
Size:
Color: