NexusFi: Find Your Edge


Home Menu

 





Help need for support movingavg


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,806 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?
RTH vs ETH: when your chart and Volume Profile trading h …
NinjaTrader
Datafeed for Atas
Platforms and Indicators
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
My Rant with AMP Futures
Trading Reviews and Vendors
EA
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
TopStep Trader disappointment
2 thanks
Want your NinjaTrader indicator created, free?
1 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