NexusFi: Find Your Edge


Home Menu

 





ZigZagHighLow of ThinkSwim to EasyLanguage of TradeStation


Discussion in EasyLanguage Programming

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




 
Search this Thread

ZigZagHighLow of ThinkSwim to EasyLanguage of TradeStation

  #1 (permalink)
trader929
Alpharetta
 
Posts: 3 since Jul 2020
Thanks Given: 0
Thanks Received: 0

How to convert the following ThinkScript to EasyLanguage?

====
def EI = ZigZagHighLow("price h" = high, "price l" = low, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = 2.0);
def EISave = if !IsNaN(EI) then EI else GetValue(EISave, 1);
def chg = (if EISave == high then high else low) - GetValue(EISave, 1);
def isUp = chg >= 0;
def EIL = if !IsNaN(EI) and !isUp then low else GetValue(EIL, 1);
def EIH = if !IsNaN(EI) and isUp then high else GetValue(EIH, 1);
def dir = if EIL != EIL[1] or low == EIL[1] and low == EISave then 1 else if EIH != EIH[1] or high == EIH[1] and high == EISave then -1 else dir[1] ;
def signal = if dir > 0 and low > EIL then if signal[1] <= 0 then 1 else signal[1] else if dir < 0 and high < EIH then if signal[1] >= 0 then -1 else signal[1] else signal[1];
plot upArrow = signal > 0 and signal[1] <= 0;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot downArrow = signal < 0 and signal[1] >= 0;
downArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

===
The big problem is ZigZagHighLow, I guess. I see the code for EasyLanguage zigzag code here at traders.com/Documentation/FEEDbk_docs/2019/03/TradersTips.html

but, I cant put together. Any pointer would be highly appreciated.. Thanks!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
 
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


trader929 View Post
How to convert the following ThinkScript to EasyLanguage?

====
def EI = ZigZagHighLow("price h" = high, "price l" = low, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = 2.0);
def EISave = if !IsNaN(EI) then EI else GetValue(EISave, 1);
def chg = (if EISave == high then high else low) - GetValue(EISave, 1);
def isUp = chg >= 0;
def EIL = if !IsNaN(EI) and !isUp then low else GetValue(EIL, 1);
def EIH = if !IsNaN(EI) and isUp then high else GetValue(EIH, 1);
def dir = if EIL != EIL[1] or low == EIL[1] and low == EISave then 1 else if EIH != EIH[1] or high == EIH[1] and high == EISave then -1 else dir[1] ;
def signal = if dir > 0 and low > EIL then if signal[1] <= 0 then 1 else signal[1] else if dir < 0 and high < EIH then if signal[1] >= 0 then -1 else signal[1] else signal[1];
plot upArrow = signal > 0 and signal[1] <= 0;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot downArrow = signal < 0 and signal[1] >= 0;
downArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

===
The big problem is ZigZagHighLow, I guess. I see the code for EasyLanguage zigzag code here at traders.com/Documentation/FEEDbk_docs/2019/03/TradersTips.html

but, I cant put together. Any pointer would be highly appreciated.. Thanks!

Are you asking the opposite? The EasyLanguage code is there. Do you want to convert to ThinkScript?

If so, this should be posted over in the ThinkScript section.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
trader929
Alpharetta
 
Posts: 3 since Jul 2020
Thanks Given: 0
Thanks Received: 0


Well, I see the zigzag code as posted in the previous URL, but I cant plug that into a strategy/indicator.. basically buy and sell points should be identified in zigzag code. Thanks!

Reply With Quote
  #4 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


trader929 View Post
Well, I see the zigzag code as posted in the previous URL, but I cant plug that into a strategy/indicator.. basically buy and sell points should be identified in zigzag code. Thanks!

Okay, understood. I don't think you can write a strategy for zigzag, at least one that can be properly backtested. I looked at this last year for a little bit, but threw it away. When watching a live chart, you will see how the zigs and zags are formed.

Maybe someone else has a different perspective.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on July 13, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts