| rcooper1 |
|
Member, Platinum User, TeleChart
|
| Registered User |
|
|
|
|
| Gender: |
|
| Friday, June 25, 2010 |
| Thursday, December 29, 2011 9:17:09 AM |
44 [0.01% of all post / 0.01 posts per day] |
|
|
I am trying to create a back-testing condition to trade at the open based on a profit target on the open. The existing function "add trade-based rule" will trade at the open, if that is selected, but based only on the profit at the closing price that day (look ahead and non-sensical). Can you show me how to create a condition that would allow a profit target measured by the opening price? Thanks, Richard
|
Thanks. My only question is, do I need to use an offset of 1 in order to set the time period of the moving average to the PRIOR n days? I don't want the indicator to use today's last price in the average. Ifr so, can you show me how to include the variable for offest?
Thanks again. Richard
|
Very specific coding request. I can't seem to make it work, though it should be fairly simple. Trying to create a pair of indicators, as follows:
(Low Price of Today) - (MA of closing price of prior V1 days)
--------------------------------------------------------------------------------- x 100
Low Price of Today
(High Price of Today) - (MA of closing price of prior V1 days)
--------------------------------------------------------------------------------- x 100
High Price of Today
Haven't coded up an indicator in a long time, so I am probably just missing a formatting issue somewhere.
Thanks,
Richard
|
|
Thanks, Bruce...the variable was part of this indicator at one point (you actually provided the code), but is not longer part of it. What you gave me works...thanks. richard
|
|
Bruce, I have the following code, mostly from you, with one modification:'# Variable = UserInput.Single = 1'# SMAperiod = UserInput.Integer = 10Plot = (( Price(0) - Price.AVGC(SMAperiod,1)) / Price (0)) *100All I want to do is to change the 1 day offset in SMA into a user defined variable on the dialog page. Also, will price(0) return the current price during the trading day prior to the close? If not, what is the correct price term? Thanks much,Richard
|
|
Can you create a realcode indicator for DIX lagged by one day? It would need all of the variables available now (type of MA, # days, etc) but lagged by one day. (Or you could create a user imput lag)thanks much,Richard
|
|
Specifically, when I am linked to my IB account, can you provide real code which says "account position (for the name being evaluated)is zero." This would be used for real time scans, not backscans. Thank you.
|
|
Here is an even simpler one...how would I code an indicator that was merely Constant/LastPrice. I am trying to create an indicator that will generate my order size, where Constant is the Dollar size of my orders. Thanks
|
|
I didn't even realize....thanks so much!
|
|
Thanks Bruce. But where should I set the variable? When I change the line'# Variable = UserInput.Single = 1 to read '# Variable = UserInput.Single = 1.02, I do not get a change in the indicator.Richard
|
|