Author Topic: Trying to get 2Hour TF values in 5Min time frame  (Read 8077 times)

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Trying to get 2Hour TF values in 5Min time frame
« on: October 10, 2013, 03:45:00 am »
I need the Stochastic K and D values from the 2 hour TimeFrame for plotting in 5 Minute Chart. I know it sounds retarded. The TimeFrameExpand and compress and expand will give the values at the end of the 2 hour interval but I need them for every tick. I have come with formula but its not perfect I want another pair of eyes to get this right.

Code: [Select]
TF=24;//for 5min TF=1 hence for 2Hours TF=24
periods=15;//15 period lookback
K=MA((C-LLV(L,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360)))
/((HHV(H,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360))-LLV(L,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360))))*100,96);
D=MA(K,72);



Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #1 on: October 10, 2013, 11:43:07 am »
The TimeFrameExpand and compress and expand will give the values at the end of the 2 hour interval

Then use expandfirst instead of expandlast. But don't use expandfirst for backtesting.

expandLast - the compressed value is expanded starting from last bar within given period (so for example weekly close/high/low is available on Friday's bar)
expandFirst - the compressed value is expanded starting from first bar within given period (so for example weekly open is available from Monday's bar)


Your code is really bad, BTW.

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #2 on: October 10, 2013, 11:57:02 am »
I am presently using expandfirst that is not going to help at all. What I want is the stochD, stochK (from 120 minutes TF) for every tick. I don't think you get it. Let me explain by an example. Open a chart in 2 hour time frame and pull the stochastic %K and %D in the lower pane. Now for every new tick the stochK and stochD value change. I want to capture these values. Replay is what I want. Do you get it?
 

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #3 on: October 10, 2013, 12:32:28 pm »
Let me give you a better example. Consider this.
1. Open a chart in 120min TF. Add a lower pane. Pull Stochastic %K and %D.
2. Now Tools-->Bar Replay. Set Step interval=5 Mins, Speed=1. Replay
3. Note the %K and %D values on the lower pane right hand side. The value changes for every step (every 5 minutes).

I want to capture all these values. Is that possible?

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #4 on: October 10, 2013, 03:13:42 pm »
You don't get it. If you set to 5 minute timeframe and use

TimeFrameset( inhourly * 2);
myarray =...
Timeframerestore();

myarray  = TimeFrameExpand( myarray, inhourly * 2, expandfirst);

then it is exactly doing the same what bar replay is doing/showing for each new 5 minute bar.

If you wanna argue then argue with AmiBroker support because you don't seem to get another thing that is that this is not AmiBroker here but a 3rd party forum.

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #5 on: October 10, 2013, 03:59:29 pm »
WRONG, you still didn't get it. If we go by your suggestion 24 consecutive 5 minute bars will have the same K and D values. Understand the question before you answer.

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #6 on: October 10, 2013, 04:20:15 pm »
forget it, its beyond you.

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #7 on: October 10, 2013, 04:53:19 pm »
If we go by your suggestion 24 consecutive 5 minute bars will have the same K and D values.

Yeah and now what?  Of course they have, you genius, since it shows higher time frame on lower one. But now go to the quote editor and delete 5 minute bars if you have 5 minute data there. What will happen? The value of those last 2 hour bar's flat line changes to the same value as in bar replay if set to 1 step of 5 min step-interval.

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #8 on: October 10, 2013, 05:04:49 pm »
So you wanna store all values that happened in between higher TF's Open and Close? Yeah, kinda retarded since on original TF each indicator value is calculated on bar close

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #9 on: October 11, 2013, 01:54:11 am »
So you wanna store all values that happened in between higher TF's Open and Close? Yeah, kinda retarded since on original TF each indicator value is calculated on bar close
yes, and that's not very hard to understand.

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #10 on: October 11, 2013, 06:43:52 am »
Then call AmiBroker. Because again this here is not AmiBroker. Have you even bought it? Because if I would have bought it then I would go to support directly instead of some 3rd party forums.

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #11 on: October 11, 2013, 08:40:24 am »
What business is it of yours to ask me if I have bought it or not? Who the heck do you think you are? the amibroker police. You should hang a sign on your neck with the amibroker license number on it so that the whole world knows that you actually spent your year's allowance on it and they will revere you for it. If you can't contribute then just buzz-off. Let the admin of the site decide where to post to where not to. Now beat it.
« Last Edit: October 11, 2013, 09:57:05 am by joshua »

Aminerd

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #12 on: October 13, 2013, 01:37:40 pm »
So you haven't bought it then. Thanks for info but it was clear to me right from the start.
No one in his right mind would use this nearly dead 3rd party forum here since there is an official AB user forum plus support channel. So why would anyone waste time here helping jerks like you. There is no one except maybe me and 1 or 2 others. All others are info leechers mainly from eastern part of the world.

« Last Edit: October 13, 2013, 01:49:08 pm by Aminerd »

joshua

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to get 2Hour TF values in 5Min time frame
« Reply #13 on: October 14, 2013, 03:28:30 am »
You are easily the most obnoxious person I have met online. I read some of your other posts and it seems there is something wrong with you. I wonder how the admin of this site tolerates you. You should really retrospect because with this attitude your life isn't going to get any better. I know it must be pretty hard for you losing money not having  a job not having enough even to buy two square meals a day but you can't take that out on others. You might think that you haven't hit rock bottom yet and there's more to go before you start picking up pieces but life may not tag along till then and you may be booted out before you know it. Have you thought about quitting trading, that may be the only solution for you.