ZigZag indicator up and down arrows - futures io
futures io



ZigZag indicator up and down arrows


Discussion in MultiCharts

Updated
    1. trending_up 241 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

ZigZag indicator up and down arrows

(login for full post details)
  #1 (permalink)
 ptcm 
Taiwan
 
Experience: Intermediate
Platform: MC
 
Posts: 69 since Jun 2010
Thanks: 8 given, 13 received

Need some help on ZigZag indicator up and down arrows.

I have the ZigZag signals triggered at the right places except that now the indicators are showing "both" red down and blue up signal simultaneously.

I want to have only blue up when the reversal are turning back up at the bottom and vice versa (show down red at the tops).

I also want to get ride of the red Zigzag line.

Can someone please tell me how I could fix the code to achieve that ?

Thanks a lot in advance.




inputs:
Price( Close ),
RetracePnts( 5 ),
LineColor( Yellow ),
LineWidth( 1 ) ;

variables:
var0( 0 ),
var1( Price ),
var2( Date ),
var3( Time ),
var4( 0 ),
var5( false ),
var6( false ),
var7( false ),
var8( 0 ) ;



var0 = SwingHigh( 1, Price, 1, 2 ) ;
if var0 <> -1 then
begin
condition1 = var4 <= 0 and var0 >= var1 + RetracePnts ;
if condition1 then
begin
var5 = true ;
var6 = true ;
var4 = 1 ;
end
else
begin
condition1 = var4 = 1 and var0 >= var1 ;
if condition1 then
begin
var5 = true ;
var7 = true ;
end;
end ;
end
else
begin
var0 = SwingLow( 1, Price, 1, 2 ) ;
if var0 <> -1 then
begin
condition1 = var4 >= 0 and var0 <= var1 - RetracePnts ;
if condition1 then
begin
var5 = true ;
var6 = true ;
var4 = -1 ;
end
else
begin
condition1 = var4 = -1 and var0 <= var1 ;
if condition1 then
begin
var5 = true;
var7 = true ;
end ;
end;
end ;
end ;

if var5 then

begin
var1 = var0 ;
var2 = Date[1] ;
var3 = Time[1] ;
var5 = false ;
end ;

if var6 then

begin
var8 = TL_New( var2, var3, var1, var2[1], var3[1],
var1[1] ) ;
TL_SetExtLeft( var8, false ) ;
TL_SetExtRight( var8, false ) ;
{TL_SetSize( var8, LineWidth ) ;}
{TL_SetColor( var8, LineColor ) ;}
Value1=Arw_New(Date,Time,High,True);
Value1=Arw_New(Date,Time,Low,False);

var6 = false ;
end
else if var7 then

begin
TL_SetEnd( var8, var2, var3, var1 ) ;
var7 = false ;
end ;

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Tradenlernen martin popov
Trading Reviews and Vendors
EasyLanguage: fetch option price using Stock ticker
EasyLanguage Programming
Does the Rithmic bridge connect in plugin mode?
Sierra Chart
PowerLanguage: change bars types, size and number of min …
MultiCharts
Power Meter for Ninjatrader (like Jigsaw or similar)
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
How much do you know about Bitcoin?
113 thanks
I finally blew up an account
39 thanks
FIO Journal Challenge - April 2021 w/Jigsaw Trading
38 thanks
Big Mike in Ecuador
27 thanks
The tiyfTradePlanFactory indicator
23 thanks
 
(login for full post details)
  #2 (permalink)
Shaban
Turin + Italy
 
 
Posts: 93 since Feb 2020
Thanks: 11 given, 62 received

Here is the code for the ZigZag % indicator for Tradestation but I think it can work also for MultiCharts:

Traders' Tips - November 2003



Reply With Quote
 
(login for full post details)
  #3 (permalink)
Shaban
Turin + Italy
 
 
Posts: 93 since Feb 2020
Thanks: 11 given, 62 received


Here is the code for the ZigZag Pnts - indicator for Tradestation:

{ZigZag Pnts: Indicator}

inputs:
Price( Close ),
RetracePnts( 5 ),
LineColor( Yellow ),
LineWidth( 1 ) ;

variables:
NewSwingPrice( 0 ),
SwingPrice( Price ), { used as a convenient 2-element array }
SwingDate( Date ), { used as a convenient 2-element array }
SwingTime( Time ), { used as a convenient 2-element array }
TLDir( 0 ), { TLDir = -1 implies prev TL dn, +1 implies prev TL up }
SaveSwing( false ),
AddTL( false ),
UpdateTL( false ),
TLRef( 0 ) ;

{ Candidate swings are just-confirmed, 3-bar (Str=1), SwingHi's and SwingLo's }

NewSwingPrice = SwingHigh( 1, Price, 1, 2 ) ;
if NewSwingPrice <> -1 then
begin
if TLDir <= 0 and NewSwingPrice >= SwingPrice + RetracePnts then
{ prepare to add new up TL }
begin
SaveSwing = true ;
AddTL = true ;
TLDir = 1 ;
end
else if TLDir = 1 and NewSwingPrice >= SwingPrice then
{ prepare to update prev up TL }
begin
SaveSwing = true ;
UpdateTL = true ;
end ;
end
else
begin
NewSwingPrice = SwingLow( 1, Price, 1, 2 ) ;
if NewSwingPrice <> -1 then
begin
if TLDir >= 0 and NewSwingPrice <= SwingPrice - RetracePnts then
{ prepare to add new dn TL }
begin
SaveSwing = true ;
AddTL = true ;
TLDir = -1 ;
end
else if TLDir = -1 and NewSwingPrice <= SwingPrice then
{ prepare to update prev dn TL }
begin
SaveSwing = true;
UpdateTL = true ;
end ;
end ;
end ;

if SaveSwing then
{ save new swing and reset SaveSwing }
begin
SwingPrice = NewSwingPrice ;
SwingDate = Date[1] ;
SwingTime = Time[1] ;
SaveSwing = false ;
end ;

if AddTL then
{ add new TL and reset AddTL }
begin
TLRef = TL_New( SwingDate, SwingTime, SwingPrice, SwingDate[1], SwingTime[1],
SwingPrice[1] ) ;
TL_SetExtLeft( TLRef, false ) ;
TL_SetExtRight( TLRef, false ) ;
TL_SetSize( TLRef, LineWidth ) ;
TL_SetColor( TLRef, LineColor ) ;
AddTL = false ;
end
else if UpdateTL then
{ update prev TL and reset UpdateTL }
begin
TL_SetEnd( TLRef, SwingDate, SwingTime, SwingPrice ) ;
UpdateTL = false ;
end ;
-------------------------------------------------------------------------------------


Reply With Quote
 
(login for full post details)
  #4 (permalink)
 ptcm 
Taiwan
 
Experience: Intermediate
Platform: MC
 
Posts: 69 since Jun 2010
Thanks: 8 given, 13 received

Thanks for the code. Any idea how I could modify it in such a way that the indicator can show up and down arrows at the turning points instead of lines ?

Thanks again.



Shaban View Post
Here is the code for the ZigZag Pnts - indicator for Tradestation:

{ZigZag Pnts: Indicator}

inputs:
Price( Close ),
RetracePnts( 5 ),
LineColor( Yellow ),
LineWidth( 1 ) ;

variables:
NewSwingPrice( 0 ),
SwingPrice( Price ), { used as a convenient 2-element array }
SwingDate( Date ), { used as a convenient 2-element array }
SwingTime( Time ), { used as a convenient 2-element array }
TLDir( 0 ), { TLDir = -1 implies prev TL dn, +1 implies prev TL up }
SaveSwing( false ),
AddTL( false ),
UpdateTL( false ),
TLRef( 0 ) ;

{ Candidate swings are just-confirmed, 3-bar (Str=1), SwingHi's and SwingLo's }

NewSwingPrice = SwingHigh( 1, Price, 1, 2 ) ;
if NewSwingPrice <> -1 then
begin
if TLDir <= 0 and NewSwingPrice >= SwingPrice + RetracePnts then
{ prepare to add new up TL }
begin
SaveSwing = true ;
AddTL = true ;
TLDir = 1 ;
end
else if TLDir = 1 and NewSwingPrice >= SwingPrice then
{ prepare to update prev up TL }
begin
SaveSwing = true ;
UpdateTL = true ;
end ;
end
else
begin
NewSwingPrice = SwingLow( 1, Price, 1, 2 ) ;
if NewSwingPrice <> -1 then
begin
if TLDir >= 0 and NewSwingPrice <= SwingPrice - RetracePnts then
{ prepare to add new dn TL }
begin
SaveSwing = true ;
AddTL = true ;
TLDir = -1 ;
end
else if TLDir = -1 and NewSwingPrice <= SwingPrice then
{ prepare to update prev dn TL }
begin
SaveSwing = true;
UpdateTL = true ;
end ;
end ;
end ;

if SaveSwing then
{ save new swing and reset SaveSwing }
begin
SwingPrice = NewSwingPrice ;
SwingDate = Date[1] ;
SwingTime = Time[1] ;
SaveSwing = false ;
end ;

if AddTL then
{ add new TL and reset AddTL }
begin
TLRef = TL_New( SwingDate, SwingTime, SwingPrice, SwingDate[1], SwingTime[1],
SwingPrice[1] ) ;
TL_SetExtLeft( TLRef, false ) ;
TL_SetExtRight( TLRef, false ) ;
TL_SetSize( TLRef, LineWidth ) ;
TL_SetColor( TLRef, LineColor ) ;
AddTL = false ;
end
else if UpdateTL then
{ update prev TL and reset UpdateTL }
begin
TL_SetEnd( TLRef, SwingDate, SwingTime, SwingPrice ) ;
UpdateTL = false ;
end ;
-------------------------------------------------------------------------------------



Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Shaban
Turin + Italy
 
 
Posts: 93 since Feb 2020
Thanks: 11 given, 62 received

Unfortunately I do not know how to insert arrows instead of lines, but the ZigZag indicator is not very reliable, because it often modifies the previous signal, it is as if a trader went back in time and could modify the signals: they would all be rich.

It's explained here:

https://www.multicharts.com/support/base/swing-identificator-gt-ziz-zag/

"Since the Zig Zag indicator can adjust its values based on subsequent changes in the underlying plot, it has perfect hindsight into what prices have done. Please don't try to create a trading system based on the Zig Zag indicator - its hindsight is much better than its foresight!"

Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > ZigZag indicator up and down arrows


Last Updated on May 5, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing

NEW BlackBird Features + FOREX Support w/Jeremy Tang @ SharkIndicators

Elite only
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

June
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts