Hello everyone, if I work in the 1 second time frame, how can I query the price before 24 hours? According to the manual, a maximum of 5000 PreLoadBars are possible, I need 86400. Does anyone know a trick to achieve this?
Hello Teddy,
Maximum PreLoadBars is 10000.
But looking at your text, to me it seems that you are looking for something else, – or that there just is no problem;
86400 is obviously one day (assumed the instrument of concern is trading the full day) and asking for the price/bars prior to one day is a matter of looking back more days. However, for PRT Complete this is 200000 bars, in practice ~ 3 days. For PRT Premium you’d have 1M bars, thus 15 (working) days.
Whether you’d still need PreLoadBars depends on what you want to calculate. Thus, if you need to calculate an average etc. which you actively use the full last day, and the math of that average requires 2 days more prior to that last day, then it would still work. If you require more, it would be best to slowly increase your TimeFrame length. Like 2 seconds. Still not enough ? then 3. And so on.
I hope this helps ?
Regards,
Peter
Hello Peter, I would like to ask whether the previous day was positive or negative overall, and whether the period from 2:30 p.m. to 10 p.m. was positive or negative. That is the real task that needs to be solved. The position must be closed exactly at 090005, hence the time frame 1 sec. Best regards Peter 🙂
Your posts are a lot easier to read (for us) if you do not click on Quote before you type, or you not do whatever else you are doing which puts your posts inside that panel all stretched out etc?
To tell whether the day before was either Bullish or Bearish, you can use these two lines:
Bullish = Dclose(1) > Dopen(1)
Bearish = Dclose(1) < Dopen(1)
to tell whether the time from 2:30 p.m. to 10 p.m was either Bullish or Bearish:
IF Time = 143000 THEN
Open230pm = open
ENDIF
IF Time = 220000 THEN
Close10pm = close
ENDIF
BullishPM = Close10pm > Open230pm
BearishPM = Close10pm < Open230pm
JSParticipant
Senior
If you want to know whether this period 14:30 – 22:00 was positive or negative yesterday, you can use the following…
//Calculate if previous period between PM 02:30 and PM 10:00 is positive or negative
If OpenTime=143000 then
PrevPM0230=PM0230
PM0230=Close
EndIf
If OpenTime=220000 then
PrevPM1000=PM1000
PM1000=Close
EndIf
If PrevPM1000>PrevPM0230 then
PrevPeriodPos=1
else
PrevPeriodPos=0
EndIf