Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (MadJack, AndrewAMD, Quad), 540 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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