When I have a sell signal on a day for Bar+1 "Exit At Market", my system won't produce a buy signal for that day, considering I have ( Active Positions.Count <2)for each condition for buys, more than 2.
Given that, the following day will signal an open trade for an issue I was unaware was being signaled the day prior considering the system was "thinking" that the next days sells wasn't putting "active positions to 0 or less than 2 for buying purposes.
What can I do to allow for 2 or less open positions, given a sell signal would open up an opportunity to purchase new signals? In other words, can I allow for a sell signal( "sell at market") to allow for buying opportunities that I need to show?
Sorry if my question seems awkward, and please let me know if I should rephrase.
Size:
Color:
Probably we could live without rephrasing if you can show the code ("as-small-as-possible") that demonstrates that behavior.
Size:
Color:
Believe the matter is buy and sell orders for next bar gets confused as the system won't give a new buy signal, (assuming conditions for buy is there) since it hadn't sold the 2 positions for that next day( only 2 active positions allowed). It is only the next bar will that buy order show up for that day. Future reports will show that I should have had the position, but by then it is too late.
CODE:
Please log in to see this code.
Size:
Color:
Kindly let me remind that...
QUOTE:
· It's usually a mistake to use LastPosition logic (especially IsLastPositionActive) in MP Strategies. You can unwittingly close the last Position, leaving Positions that were opened earlier unprocessed.
As advised in the WealthScript Programming Guide, Programming Trading Strategies >
Multi-Position Strategies, I'd eliminate this remnant first.
Size:
Color:
Thanks Eugene. Changed the code as per the manual and so it works.
Size:
Color:
Glad to help Mike.
Size:
Color:
I am still experiencing the same issue for both multi and single symbol back tests: E.g.Active positions<2, 2 open positions are in portfolio, Sell and buys are at market, Sell rule is generated when I should also get a buy signal. As it is a sell signal will not open up for a new active position on that day. Result is: Next trading day, after collecting new data, I show a new position, despite not getting a signal for it.
CODE:
Please log in to see this code.
and
CODE:
Please log in to see this code.
Size:
Color:
I didn't see anything suspicious here. The problem might be elsewhere (i.e. what's left behind).
Size:
Color:
Today, I have one less open position for EDMC than the system shows for open positions. I did not receive a buy signal for EDMC yesterday when I should have. For clarity, I did a single position test with EDMC for today and for yesterday. Same thing. Seems when there are 2 active positions as there was, and a sell signal prevents that buy signal for the next bar, the system won't produce a new buy signal ; however after the sell, the next day, shows that I should have had a buy signal( one more position than I had).
In essence: Two open positions, a sell signal and a buy signal at the same bar that should happen does not for that day when there are 2 actives. It's only the next bar do I find out I needed to buy.
What should I do?
Size:
Color:
Have you tried in Raw Profit mode? What sizing are you using?
You should test a time-based exit before other types. They're both AtMarket exits, so I don't expect it will change anything but since the code is incomplete you never know.
Size:
Color:
Hi Cone, Sizing 6 percent and Raw profit both are producing this error. I'll try time based exit and let you know. My exit consists of many else statements and so I wonder if this may be the issue? I'll start with that. Thanks
Size:
Color:
Additionally, if you can think of what or why I am getting this outcome could you suggest possibilities.
Size:
Color:
Sorry fellas, but I am stuck. First, do you understand what is happening? Have I described what is happening clearly enough? As it is, I could use Your help , please!
Size:
Color:
QUOTE:
Place exit logic above entry trading rules to prevent the exit logic from being applied to Positions that are opened on the very same bar.
This seems to explain what I am trying to work around. Exit logic then entry. Sorry to be repetitive, limit on open positions to 2 or less and yet a sell signal for the next bar will not allow for a concurrent buy( which I want)if 2 positions remain open. Only later after the day later, I then show that a buy was triggered. (after the fact)
Size:
Color:
Help us help you Mike: provide the complete code demonstrating the effect together with the enviornment (we seem to have the position sizing but what are the symbols, bar scale, data loading range?)
Size:
Color:
Daily, symbols( one position or multiple positions)Data range (any; I can tell 500 bars or select dates)Will provide code ASAP; however can I send privately as a ticket? Thanks Eugene.
Size:
Color:
Please provide an "as-small-as-possible" code skeleton (that doesn't depend on 3rd party libraries) to demonstrate the anomaly.
Size:
Color:
sorry,working with what I got. A loyal and long term customer, not a hacker or devious user that needs a lead. Prhaps a you can extend some, but not gret deal o effort to get this user on track. Is this reasonable ?
Size:
Color:
Sure, it's reasonable to show you a functioning example. Let's completely forget about your purchased code with the DLL, leaving its support/enhancements to its respectable creator, and start from scratch.
Please restate your first question as clear as possible, i.e. what you want to get in the end, and we'll try to come up with something.
Size:
Color:
Thanks Eugene. I'll put my mind to it and return.
Size:
Color: