Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 945 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Chikou does not shift 26 bars backward #477742
07/26/19 07:15
07/26/19 07:15
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
I get this weird behavior where chikou does not lag 26 price behind when running on a live account but it works properly when running in backtest

Here is the snippet of my Ichimoku

Code
Ichimoku(9, 26, 53, 0);
vars Chikou = series(Chikou(-26));


As you can see the shift of chikou is set to -26 since I used PEEK flag because on the manual the chikou description:

Quote

The traditional Ichimoku requires a future peeking Chikou line (Shift = -26); this can be achieved by setting Shift = 0 and moving the rest of the Ichimoku forward by Offset = 26.


by setting the Shift = 0 of chikou the line will just plot on the priceClose() since the souce code of chikou from indicators.c is a priceClose(Shift) so following the description above would mess up the chart.
I compared the chart from Zorro and TWS and everything match except the Chikou line

Did i miss anything using the Chikou?

Attached Files backtest.pngchikou live.png
Last edited by marr; 07/26/19 07:17.
Re: Chikou does not shift 26 bars backward [Re: marr] #477747
07/26/19 10:20
07/26/19 10:20
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Chikou is simply the close price just with a fancy name. You cannot shift an indicator backwards in live trading, only forwards. I dont know anyway why Zorro has such nonsense indicators in its library. Another advice, dont give a variable the same name as a function.

Re: Chikou does not shift 26 bars backward [Re: marr] #477749
07/26/19 12:50
07/26/19 12:50
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
can i shift the price backward in live trade? i tried a workaround where:

Code
vars Close = series(priceClose(26));


when i plot the Lag it shows a shift forward the price, I should expect backward shift since series starts on the last 26 bar of the price. Did i miss something?

Last edited by marr; 07/26/19 12:58.
Re: Chikou does not shift 26 bars backward [Re: marr] #477751
07/26/19 13:06
07/26/19 13:06
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
You can shift anything forwards, but not backwards because that would be future peeking. priceClose(26) is forwards, -26 would be backwards.


Re: Chikou does not shift 26 bars backward [Re: marr] #477753
07/26/19 13:35
07/26/19 13:35
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
is this the right way to do the ichimoku?

Code
Ichimoku(9, 26, 53, 26);

vars Lagging_Span = series(Chikou(0));

vars Close = series(priceClose(26));


I shifted forward the ichimoku and price then the chikou will be 26 bars behind the price
when I plot the result, the trades are triggered on the chikou span

or im wrong?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1