- ago
Is this scenario possible?

My wealth-lab strategy signals and enters a long position on SPY for 10 shares

I then enter another long position through my broker manually for 10 shares.

Then my wealth-lab strategy signals an exit but I want it to only exit the 10 shares that the strategy itself had generated not my entire position.

0
664
4 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.62% )
- ago
#1
Sure, WL will exit only what quantity is contained in the signal.
0
- ago
#2
Ok one more related scenario.

If I am running a strategy and it enters into a position.
Then I close wealth-lab.
re-open wealth-lab and the strategy is no longer in the strategy monitor.
add the strategy back with the same configuration.
would it generate the closing signal for the initial entry?

Essentially I am trying to figure out why my ORB strategy is not generating close at end of day signals when I can see that it does on the backtests.
0
Cone8
 ( 4.98% )
- ago
#3
Why it doesn't work is sort of a guessing game since you're not revealing the strategy's logic.
Is "close at end of day" the same as MOC orders?
Precisely what is the logic for signaling this order?
What is the bar interval?

Edit: ---
If the strategy is the one posted here - https://www.wealth-lab.com/Discussion/8299 it certainly should signal to exit at market on the nextToLastBarTime (if I'm recalling the variable correctly) if and only if the strategy is able to hypothetically recreate the position again. Make sure to load enough data.

Example -
If you're initializing 100 bars for 1-minute intervals, the strategy may create a position at the beginning of the day. If you reinitialize everything at the end of the day, the strategy will be unaware of anything that occurred earlier than the last 100 bars (about 1 hr 40 min ago).
0
- ago
#4
CODE:
             if (bars.IsLastBarOfDay(idx + 1)) {    SetBarColor(bars, idx, WLColor.Orange);    ClosePositionEod(); } public void ClosePositionEod() { foreach (Position pos in OpenPositions)    {     ClosePosition(pos, OrderType.Market,0,"Exit at open of last bar");    } }


Above is the code I have to close EOD, I am running on 15min and loading 500 bars but the last 2 times I have ran this live it did not generate closing orders for my open positions.
0

Reply

Bookmark

Sort