In a IOB script running with hourly time resolution how can I get easily the high, close, low, open values for the previous hourly bars?
Thank you
Hourly bars values in IOG script [SOLVED]
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOB script
In a IOB script running with hourly time resolution how can I get easily the high, close, low, open values for the previous hourly bars?
Thank you
What is IOB?
Do you mean IOG?
Please go to wiki and read the definition again carefully.
If you need help interpreting any specific passage, please copy and paste the detail here.
Re: Hourly bars values in IOB script [SOLVED]
Sorry for the typo. Yes, I mean IOG.
On the chart my script thinks on the hourly bars to create some conditions but I also need to enable IOG. If I enable IOG, my script will begin to think on a tick basis and so, if I write (that means to intercept three consecutive decreasing High values for three consecutive hourly bars) I presume the scripts will intercept three consecutive decreasing High values for three consecutive ticks after IOB enabling.
The same for the statement
On the chart my script thinks on the hourly bars to create some conditions but I also need to enable IOG. If I enable IOG, my script will begin to think on a tick basis and so, if I write
Code: Select all
if h[1]<h[2] AND h<h[1] then Begin...
The same for the statement
I would like to think on the current hourly bar and not the current tick.if ((o-c)/o)<THR
Code: Select all
[IntrabarOrderGeneration=True]
if h[1]<h[2] AND h<h[1] then Begin
if ((o-c)/o)<THR AND time<1400 then Begin
sellshort next bar at market;
End;
End;
Last edited by auato on 22 Apr 2017, edited 1 time in total.
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOB script
Sorry for the typo. Yes, I mean IOG.
::
I would like to think on the current hourly bar and not the current tick.
I will say it again,
Please go to wiki and read the definition again carefully.
If you need help interpreting any specific passage, please copy and paste the passage here.
ie. which passage that says "tick" or "bar" that is bothering you?
Re: Hourly bars values in IOG script
I am doing it, TJ. There is no passage that is bothering me. I can't figure out a solution tailored or me.
In IOG script running on a hourly chart if I write High<High[1] what does it mean? Does it mean that the High value of the current hourly bar is lower than the High of previous hour or it means that the High value of the current tick is lower than the High of previous tick??
Maybe a good solution is to use currentbar and lastbaronchart if they refer to the real bar shown on the chart but it is not specified.
In IOG script running on a hourly chart if I write High<High[1] what does it mean? Does it mean that the High value of the current hourly bar is lower than the High of previous hour or it means that the High value of the current tick is lower than the High of previous tick??
Maybe a good solution is to use currentbar and lastbaronchart if they refer to the real bar shown on the chart but it is not specified.
Last edited by auato on 22 Apr 2017, edited 1 time in total.
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOB script
auato:
Let's go through the Wiki together
Let's get a few things straight:
1. The keyword is IntraBarOrderGeneration. ie as the name implies, it is for Order Generation, nothing else.
2. The first line in the definition:
THIS KEYWORD is for ORDER GENERATION ONLY
Nothing else applies.
Let's go through the Wiki together
Let's get a few things straight:
1. The keyword is IntraBarOrderGeneration. ie as the name implies, it is for Order Generation, nothing else.
2. The first line in the definition:
3. Keyword Usage:Toggles intra-bar order generation flag on or off.
4. Keyword Example:If set to True... Enable intra-bar order generation and calculation...
Will generate a buy order that is active for the next tick only.
THIS KEYWORD is for ORDER GENERATION ONLY
Nothing else applies.
Re: Hourly bars values in IOG script
oh Thank you @TJ. I was convinced that after IOG enabling all would become related to tick.
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOG script
oh Thank you @TJ. I was convinced that after IOG enabling all would become related to tick.
That's why I asked you to read AGAIN and read CAREFULLY.
Re: Hourly bars values in IOG script
Yes you are right but I have read a lot of times thinking wrong every time and only focusing on what my mind wanted to think.
Re: Hourly bars values in IOG script
One more thing... in my code I also have:
if ((o-c)/o)<THR
this means that the entry will be triggered only for the next tick of the next hourly bar as in the moment of the calculation I don't know the close of the current bar. Is it correct?
if ((o-c)/o)<THR
this means that the entry will be triggered only for the next tick of the next hourly bar as in the moment of the calculation I don't know the close of the current bar. Is it correct?
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOG script
Without IOG,
Your logic is evaluated at the end of the bar (EOB).
If the BUY/SELL condition is MET... the order will be generated at the NEXT bar.
With IOG,
Your logic is evaluated EVERY tick.
If the BUY/SELL condition is MET... the order will be generated at the NEXT tick.
IOG is about ORDER GENERATION.
If the condition is met, an oreder is generated.
Your logic is evaluated at the end of the bar (EOB).
If the BUY/SELL condition is MET... the order will be generated at the NEXT bar.
With IOG,
Your logic is evaluated EVERY tick.
If the BUY/SELL condition is MET... the order will be generated at the NEXT tick.
IOG is about ORDER GENERATION.
If the condition is met, an oreder is generated.
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: Hourly bars values in IOG script
One more thing... in my code I also have:
if ((o-c)/o)<THR
this means that the entry will be triggered only for the next tick of the next hourly bar as in the moment of the calculation I don't know the close of the current bar. Is it correct?
Please use a streaming papertrading account to test your logic thoroughly before trading.