NexusFi: Find Your Edge


Home Menu

 





Functions and Scans?


Discussion in ThinkOrSwim

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




 
Search this Thread

Functions and Scans?

  #1 (permalink)
netarchitech
NY, NY
 
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19

Hi,

I'm trying to convert a large study into a workable scan. The portions which are proving difficult are the functions. Here is a sample:
 
Code
script isABCD {
    input _mode=0;
    input abc=0;
    input bcd=0;
    input d=0;
    input c=0;
    def _abc = abc >= 0.382 and abc <= 0.886;
    def _bcd = bcd >= 1.13 and bcd <= 2.618;
    def ret =_abc and _bcd and (if _mode == 1 then d < c else d > c);

}

def u_abcd2 = isABCD(1,abc,bcd,d,c) and isABCD(1,abc,bcd,d,c)[1]==0;

I've tried a myriad of different approaches to solve the issue, but nothing has worked. I'm hoping a fellow scripter might be able to provide some insight into how a function (script) might be rewritten to work within a scan...

Thanks in advance. Thanks also to Syracusepro for generously sharing the original study and BenTen at usethinkscript for posting it...

Reply With Quote




Last Updated on March 31, 2019


© 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