Changing prices in Position object
Author: innertrader
Creation Date: 6/21/2018 3:57 AM
profile picture

innertrader

#1
The system duplicates bar price data if no transactions happen on bar+1. Are there methods to change the entry / exit prices of a position once it is established? Or manipulate the price on bar+1 before position is taken?

profile picture

Eugene

#2
It's not possible as the properties like EntryPrice or ExitPrice have read-only access. You should realize that this isn't a use case in the mind of the developers.

Let's start the other way round: please try to describe your problem in detail rather than directing technicians at a suggested solution. What kind of "system" duplicates bar price data if no transactions happen on bar+1? Thanks.
profile picture

Cone

#3
Keep in mind that bar + 1 is just a bar number. The backtester fills signals on a specified bar number. We use bar + 1 in trading signals because you shouldn't execute signals on the bar for which you have complete data, i,e. bar. That would be peeking. When processing the last bar of the chart, bar + 1 points to a future bar. When trading signals are executed on a future bar, Wealth-Lab generates a [trading] Alert.
profile picture

KGo

#4
This happens as a result of synchronization. Past data is repeated on missing bars until new bar data is available. As a result a backtest trade on a synchronized series can execute at past prices.

Before creating a position, you can change the prices and/or add bars in the source data file so synchronization happens as required. Or you can change bar prices during strategy execution. Or you can trade on an unsyncronized series.
profile picture

innertrader

#5
@KGo - Thanks.
QUOTE:
you can change bar prices during strategy execution

How do you do that?
profile picture

Eugene

#6
It's in the FAQ | Strategies and WealthScript > Is there ChangeBar method in WL6?
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).