Hi there,
how can i code the following indicator?
“Yesterdays 10pm close price = YesClose”
IF “the market reaches the closing price of yesterday 10pm between todays 2pm and 10pm” THEN RETURN 1
ELSE RETURN 0
ENDIF
thank you!
You need to store the Close value everyday at 10pm in a variable. Then test if the price were above and below the highest high and lowest low of today Close between 2pm and 10pm.
If you have trouble coding it, please ask gently 🙂
Merci Nicolas!
First of all: I was surfing through this forum and i really have to say that u r doing a great job helping everybody out! Thanks for your effort!
Well, how can i store a special market price at a certain time in the past in a variable?
all i know e.g. is: “VariableXY” = Close(10)
but that will store the close price of the 10th bar in the past….
should i count the bars till i will reach the 10pm bar of yesterday 😉
Cheers!
Maybe or maybe not ..!
Firstly, store your Close at 10pm:
if time=220000 then
xy = close
endif
Then, test if this price is met between the today’s high and low (from 7pm to 22pm):
if time>=140000 and time<220000 and xy>=Dlow(0) and xy<Dhigh(0) then
mytest = 1
else
mytest = 0
endif
and you are good.
Maybe or maybe not ..! – Haha…. 😉
thank you Nicolas!
i will try to move on from here….trying to implement my trading strategy that i am using manually into an automated one….
sorry for my newbie questions….i started coding with PRT yesterday….
if anybody has some mathematical / statistical questions just let me know about it….that is my metier….
once more: Thank you Nicolas!
Why is this code not buying/selling any shares?
if time = 220000 then
c = close
endif
if time>=220000 and time<=140000 and close <= c-20 then
buy 1 shares at market
set target pprofit 20
endif
if time>=220000 and time<=140000 and close >= c+20 then
sell 1 shares at market
set target pprofit 20
endif
What is c-20 and c+20? Your problem comes from this.
well, c-20 or c+20 do mean that the current market price is +-20 over/under the market price that we have saved in our variable calles “c” for 10pm
FYI: i have solved the problem:
This circumstance is not possible:
if time>=220000 and time<=140000 and close….
it has to be rewriten:
if ((time>=220000 and time<=240000) or (time<=140000)) and close….
Hi there!
How can i export price data to excel from PRT?
I would like to initiate some statistical analysis with them that seem to be impossible within PRT….
You can also drag and drop any results list from PRT to Excel or any text editor. There are some other topics about it in forums.
Aloha!
i am trying to upgrade teh indicator by declaring the exact hourly time frame in which the last days closed is reached (or not).
all i need to finish the job is a time function code for the last hours LOW and HIGH, could not find it in the manual…..and hhigh and hlow are not working out actually.
Would appreciate your help….thx
TC,
Gekko
What is the timeframe used?