NexusFi: Find Your Edge


Home Menu

 





Help need for support movingavg


Discussion in ThinkOrSwim

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




 
Search this Thread

Help need for support movingavg

  #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?
MC PL editor upgrade
MultiCharts
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
26 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
20 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)
 selnomeria 
Tbilisi + Georgia
 
Experience: None
Platform: ThinkScript,Tradestation
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

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on November 13, 2015


© 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