NexusFi: Find Your Edge


Home Menu

 





FX Scan / Thinkscript


Discussion in ThinkOrSwim

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




 
Search this Thread
  #1 (permalink)
atxrocks121
Austin Texas
 
Posts: 5 since Jun 2015
Thanks Given: 1
Thanks Received: 2

Hi there...I have this scan in ToS that works well in scanning stocks and etfs. But when I apply it to FX, I get very strange results. My theory is that is has to do with the time length concept. This scan is pulling the high/low for the last 20 days and also using the close (for stocks & etf's). However, in FX there obviously is no close during the week and is ToS smart enough to be using the 20 days, or is the scan using the last 20 weeks?

If this theory is correct, how do I tell ToS to scan the last 24 hours (or whatever the appropriate FX item is)?

My scan:
def Upper = Highest(high, 20);
def Lower = Lowest(low, 20);
def UpperPrev = Upper[5];

def ma20 = MovingAverage(AverageType.EXPONENTIAL, close, 20);
def ma50 = MovingAverage(AverageType.EXPONENTIAL, close, 50);
def ma20Prev = ma20[5];
def PercentageMove = (((ma20 - ma20Prev) / ma20Prev) * 100);

def VF = ((Upper - Lower) / close) * 100;
def VFavg = MovingAverage(AverageType.EXPONENTIAL, VF, 20);

def c1 = ma20 >= ma50;
def c2 = PercentageMove >= 1 and PercentageMove <= 50;
def c3 = Upper >= UpperPrev;
def c5 = (((Close-ma50) / ma50) < 0.50);

plot signal = c1 and c2 and c3 and c5;


Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
Commodities
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
HaydenP
Carthage Texas Usa
 
Posts: 15 since Jun 2015
Thanks Given: 0
Thanks Received: 2


atxrocks121 View Post
Hi there...I have this scan in ToS that works well in scanning stocks and etfs. But when I apply it to FX, I get very strange results. My theory is that is has to do with the time length concept. This scan is pulling the high/low for the last 20 days and also using the close (for stocks & etf's). However, in FX there obviously is no close during the week and is ToS smart enough to be using the 20 days, or is the scan using the last 20 weeks?

If this theory is correct, how do I tell ToS to scan the last 24 hours (or whatever the appropriate FX item is)?

My scan:
def Upper = Highest(high, 20);
def Lower = Lowest(low, 20);
def UpperPrev = Upper[5];

def ma20 = MovingAverage(AverageType.EXPONENTIAL, close, 20);
def ma50 = MovingAverage(AverageType.EXPONENTIAL, close, 50);
def ma20Prev = ma20[5];
def PercentageMove = (((ma20 - ma20Prev) / ma20Prev) * 100);

def VF = ((Upper - Lower) / close) * 100;
def VFavg = MovingAverage(AverageType.EXPONENTIAL, VF, 20);

def c1 = ma20 >= ma50;
def c2 = PercentageMove >= 1 and PercentageMove <= 50;
def c3 = Upper >= UpperPrev;
def c5 = (((Close-ma50) / ma50) < 0.50);

plot signal = c1 and c2 and c3 and c5;

You are correct with your assumption. You will need to use a secondary aggregation. If you need instructions let me know


Reply With Quote
  #3 (permalink)
atxrocks121
Austin Texas
 
Posts: 5 since Jun 2015
Thanks Given: 1
Thanks Received: 2


Hi Hayden,
Yes, I need help as I have yet to figure this out...feel free to PM me.


Reply With Quote
  #4 (permalink)
 NGtrader 
Vancouver, BC Canada
 
Experience: Advanced
Platform: Ninjatrader
Broker: Ironbeam, Kinetick
Trading: ES, CL
Posts: 237 since Apr 2014
Thanks Given: 760
Thanks Received: 206

Hi,

Did you ever figure out a way to scan currencies in TOS?


Follow me on X Reply With Quote




Last Updated on September 19, 2017


© 2026 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 - Downloads - Top
no new posts