Turok, hayman:
In this post I'll try to describe the rules as clear as I could be.
#1. For a given stock calculate the following parameters for each day.
O = (OpenBid + OpenAsk)/2;
UpSwing% = 100*(O - LowestAsk)/O
DownSwing% = 100*(HighestBid - O)/O
If UpSwing > DownSwing Then
MaxSwing = UpSwing
Else
MaxSwing = DownSwing
End
Find the Min value of MaxSwing for at least 250 days. (GuaranteedSwing)
ProfitTarget = 0.9*GuaranteedSwing
For each new day repeat calculations so you know your ProfitTarget ahead of the Open.
Design ProfitTrigger using the following:
If your current profit >= ProfitTarget then start calculating MaxProfit. If your 100*(CurrentProfit - MaxProfit)/CurrentProfit >= 8% then Exit
Calculate Delta:
Delta = Abs(EntryPrice - ((Ask+Bid)/2) - Commissions - slippage)
Find optimum Delta over 250 days that has minimum losses using the formula Shares*Delta*Flips
Design FIR filter (length 38)
http://www.dspguru.com/info/faqs/firfaq.htm
Run this filter in real time over AskPrice and BidPrice.
If filtered BidPrice is higher then upper limit of delta then go long
If filtered AskPrice is lower then bottom limit of delta then go short.
Optimize delta again to have best profit/loss ratio.
Repeat optimizations every day to tune delta ahead of trading day.
Please let me know if I was clear