Yesterday I posted a long message with
a few questions. I still can't see it in the Forum, so I guess I have
to rewrite. Here goes...
I would like to rebalance my open
positions within a long term trend following system. Since there is
no function like this:
SetTradeRisk(PointRisk)
Balance("LA1", 1, 0,
CloseEntry, Day)
(Where new position will keep the
position name, and account equity would be tracked by the TradePlan)
That would just buy or sell the net
between the current open position and the desired new position, I
have worked with this:
TradesAllowed = AllOrders
If TradeDayOfMonth = 1 Then
SetTradeRisk(PointRisk)
ExitLong("RLA", "LA",
GetCurrentSize("LA"), 0, CloseExit, Day)
Buy("LA", 1, 0,
CloseEntry, Day)
This works fine within a Session, but
not within a TradePlan, which will not recognize the buy order.
Changing the buy order to:
Buy("LA", 1, 0, Market,
Day)
still works within a Session but not
within a TradePlan. What's up with this? Why doesn't the TradePlan
accept all trades generated by the Sessions? Are there any other
instances where a TradePlan might skip trades generated within the
Sessions?
Changing the name of the buy order
works sometimes, but only if the name is kept within quotes as
opposed to stored as a variable, be it String, Integer or BarArray.
For example, this still works fine within a Session, if n has been
defined as a BarArray:
If TradeDayOfMonth = 1 Then
ExitLong("RLA" + n,
"LA" + n, GetCurrentSize("LA" + n),
0, CloseExit, Day)
n = n + 1
Buy("LA" + n, 1,
0, CloseEntry, Day)
Producing a series of trades for the
entire length of the position that could look like this:
Buy/Sell Entry date Entry name Exit
date Exit name
Buy 91-01-16 LA1 91-02-01 RLA1
Buy 91-02-01 LA2 91-03-01 RLA2
Buy 91-03-01 LA3 91-04-01 RLA3
Buy 91-04-01 LA4 91-04-12 XLA4
Sell 91-05-09 SB1
And so on
(Depending on the
money management used within the Session the number of contracts
bought and sold would vary correctly)
But within a
TradePlan the same sequence of trades would be reduced to:
Buy/Sell Entry date
Entry name Exit
date Exit name
Buy
91-01-16 LA1 91-02-01 RLA1
Sell 91-05-09 SB1
My question is,
how do I make this work within both a Session and a TradePlan? And
again I need to ask, why isn't the TradePlan accepting all trades
from the Session as it is?
/Thomas Stridsman
ps. I too have
long missed the the possibility to use multiple SetTradeRisk. Or at
least individually for long and short trades. The function could work
like this SetTradeRisk(”Buy”, PointRisk), indicating it would
only apply to an entry with the same name. For years I have worked
around this by separating all my systems into long and short
versions.
pps. It's May 19.
The latest indication for a software update mentioned May 15. How's
it coming?