NexusFi: Find Your Edge


Home Menu

 





Help need for support movingavg


Discussion in ThinkOrSwim

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




 
Search this Thread
  #1 (permalink)
 joysync 
Toronto Canada
 
Experience: Intermediate
Platform: thinkorswim, NT
Trading: Emini ES NQ
Posts: 5 since Nov 2014
Thanks Given: 9
Thanks Received: 0

Hi ,
I am write a script for finding support moving average just below the Low value. But the simpleMovingavg(close,length) , it need "Length" must be constant.

Is there anybody have a way roundabout it?
below is code. thanks.

def Support = fold Ma=3 to 300 with found = double.nan while isnan(found) do
if between(Low, simpleMovingavg(close,Ma),simpleMovingavg(close,(Ma+1)) )
then Ma else double.nan;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
One Wallet Made $200K in Hours: AP Probes Polymarket Cea …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
CFTC Workforce Shrinks 24% to 15-Year Low While Predicti …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
brucehank
ottawa canada
 
Posts: 20 since Oct 2015
Thanks Given: 0
Thanks Received: 2

As far as I know, the loop function is not very friendly in TOS.
Why don't you try SUM?


Reply With Quote
  #3 (permalink)
 titanus2 
Tbilisi + Georgia
 
Experience: None
Trading: EUR/USD
Posts: 36 since Aug 2014
Thanks Given: 9
Thanks Received: 20


joysync

== GENERAL ADVICE ==
in FOLD you shouldnt use the function/constant names, but use : GetValue(). I dont know if you will get solution, but at first make corrections...


so,instead of i.e. low[3], in fold, you should use GetValue(low,3)

however, what you are saying, i have no solution. maybe contact thinkscript---at---thinkorswim.com
and remember,always share you solutions on web
i.e. post here , or create your own blogspot.com


Reply With Quote




Last Updated on November 13, 2015


© 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