Hi Folks!
Thanks in advance for taking my question.
I've put together a rather trivial strategy for checking backtesting and paper trading enabling. In the backtest the strategy works as expected. However, when I try to paper trade it only the Buy Limits are executed. The ensuing condition and Market Sell do not go off at all. They have satisfied the condition for the sale as i can see by auditing the conditions.
Here's the rule based construction:
Buy at Limit
--Moving Average turns up
Sell at Market
--Current open Position is profitable
Sell at Breakeven Stop
What am I failing to see?
-Rick
Size:
Color:
Rick, how many bars of data are loaded when the strategy paper trades?
Also, what are the parameters behind each condition?
What symbol(s) and bar scale is this?
Size:
Color:
Hi and thanks!
1. One year of data
2. current open is profitable > 0 (see code below). (question arises: is this above the predetermined costs of slippage + commission?)
3. on stop loss i have given it a "1" but my next question was how to understand this metric (a "5" was the default setting)
CODE:
Please log in to see this code.
Size:
Color:
oh, and it was the nasdaq 100 and the bar scale is daily
Size:
Color:
Thanks, and what was the moving average and its period? Also, there seem to be two groups of entries which isn't in line with your rules in post #1. It would be easier to copy/paste the entire code.
Regarding the "Current open Position is profitable" rule, it might not be what you're looking for. This built-in condition queries the
most recent open Position which may be somewhat counterintuitive. So we added "Active Position is profitable" condition to
Community.Rules that acts as most users would expect it to do. (However, first we have to get your Wiki account signup procedure done.)
As a quick workaround, replace these lines in the code above:
CODE:
Please log in to see this code.
With this one:
CODE:
Please log in to see this code.
How exactly are you paper trading it i.e. Strategy Monitor or Str. window?
Size:
Color:
Hi Eugene,
Here is the code in entirety. I note that when backtesting it the commissions and paid in cash are figured so that i don't need to do anything extra dock the strategy. Is this also true on paper trading here?
CODE:
Please log in to see this code.
as to your question i think i am in a strategy window.
thanks much, rick
Size:
Color:
and i am using a SMA on the Close with a 20 period
Size:
Color:
Rick, now the code is completely different. What should this mean with regard to the problem outlined in the topic title?
Note that you can't expect realistic results if backtesting/trading this strategy in post #6 on Daily bars because it uses same-bar stop and/or limit orders. You might want to check out this FAQ and follow the pointers:
I want to test a strategy that buys and sells with stop/limit orders on the same bar.
Size:
Color: