"What if Close was different?" - Analysis
Author: wl64bit
Creation Date: 5/14/2012 9:01 AM

#### wl64bit

#1
Is there any way to check if signals would be generated if the Close of the last bar was different?
One of the options is to manually change the Close in the Dataset and run the script again. Is there any way to do it automatically?

#### Cone

#2
You just need to know what the signal "is" and what it "became". Save Alerts ("what it is") to a file and compare them later to "what they became". Exactly how you do all that will be a nice little project for a motivated programmer.

#### wl64bit

#3
How can I know the cutoff of the Close that generates the Buy or Sell signal if the signal is generated by combination of indicators and calculations?
It looks like the only way is to run the strategy several times on the data with different closing prices… but can Wealth Lab make an assumption that the Close of the last bar is different from the one in the Database and recalculate the script?

#### Cone

#4
You lost me. Why are historical closing prices changing so much for you? What's the practical purpose of all of this?

#### wl64bit

#5
What’s important is the moment (the Closing price of the last bar) when the Buy or Sell signal is generated. The practical purpose is very important since if you want to close or open a position on Close of the day, as an example, you need to know from what Closing price the signal is generated.
Let’s say your system generates a signal to buy a stock at close if it goes down. If it is closed at \$30 a share your system generates a buy signal, but if it is closed at \$30.5 it does not buy it. So you need to know the moment=Limit from where the System generates the Buy signal, let’s say you are looking for a \$30.22. The 30.22 is the cut off-if stock closes 30.23 and above it does not buy it but if it closes 30.22 and below it does buy it. So, knowing the cut off you may give an order to Buy-Limit at Close 30.22.

#### Eugene

#6
It might be possible to reverse-engineer an indicator formula. For example, RevEngSMA_TC demonstrates how to make an educated guess of tomorrow's close that would trigger an SMA crossover:

Reversing MACD
RevEngSMA_TC (Tomorrow's Close)
RevEngRSI

#### wl64bit

#7
How is it possible to get the Reverse-Engineer of StochRSI to the Close?

#### Eugene

#8
Only by manually decomposing the formula.

#### wl64bit

#9
I think a good feature would be adding an option to change the close of the last bar within the same bar range (High to Low) by one click as we change Strategy Parameters at the left lower corner of the screen.

After dragging or changing the Close of the last bar, the script is automatically recalculated and it would be easy to recognize the moment when signal is generated.

If programmers made possible to change Strategy Parameters from the screen, changing the Close also should be feasible to do the same way.

#### Cone

#10
It sure is possible to do that from a Strategy Window, and you already gave the solution... use a StrategyParameter!

CODE:
Please log in to see this code.
Instead of using the slider, click the parameter's link to enter the precise value.

#### wl64bit

#11
This is what I was asking for. Thank you so much!!!