NexusFi: Find Your Edge


Home Menu

 





THINKorSWIM Scripting


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one StockT8er with 19 posts (0 thanks)
    2. looks_two kjhosken with 6 posts (3 thanks)
    3. looks_3 Skidboot with 1 posts (1 thanks)
    4. looks_4 masterelf1 with 1 posts (0 thanks)
    1. trending_up 6,611 views
    2. thumb_up 4 thanks given
    3. group 5 followers
    1. forum 24 posts
    2. attach_file 4 attachments




 
Search this Thread

THINKorSWIM Scripting

  #21 (permalink)
QUIKTDR1
ARMONK NEW YORK
 
Posts: 3 since Jan 2020
Thanks Given: 1
Thanks Received: 1

Question? Very simple new to TOS formula construction

How do you write C > 20sma ?

My attempt...

input price = close;
input length1 = 20;
input averageType1 = AverageType.Simple;
input averageType2 = AverageType.Simple;
input crossingType = {default above, below}

def avg1 = MovingAverage(averageType1, price, length1);
def SMA1 = MovingAverage (averageType.SIMPLE,close,20);

def avg1 = MovingAverage(averageType1, price, length1);
def Cros1 = crosses (SMA1,crossingDirection.ANY);


plot signal = Cros1;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
  #22 (permalink)
 
Skidboot's Avatar
 Skidboot 
Houston, TX
 
Posts: 202 since Dec 2010
Thanks Given: 203
Thanks Received: 299


QUIKTDR1 View Post
Question? Very simple new to TOS formula construction

How do you write C > 20sma ?

plot signal = Cros1;


plot signal = close is greater than SimpleMovingAvg("length" = 20)."SMA";

or

plot signal = close crosses above SimpleMovingAvg("length" = 20)."SMA";

Reply With Quote
Thanked by:
  #23 (permalink)
masterelf1
Roanoke
 
Posts: 5 since Apr 2017
Thanks Given: 0
Thanks Received: 11



StockT8er View Post
I do run my charts on a 2 min time factor
How ever this morning it's not show as much profit like on TSLA as other strats I have
TSLA on this is 180 Fri it was 2700
TSLA on my highest is 2542

I'm finding out NO Strategy will work always. Some days they make you good returns and others they lose big, and can change mid day.

You are sitting on a gold mine and don't recognize your opportunity! Find out WHY the returns degrade. Then you will be getting somewhere. I suspect adverse news events are working against you. But you need to filter through the scenarios and find
your gold.

I laughed at this advice when I got it, but then soon found out it was gospel.

Good Luck,
MIke

Reply With Quote
  #24 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

Well the advice I gave you has proved to be somewhat inaccurate, I now have developed a strategy that seams to profit on almost every stock, and everyday. However I am waiting to TEST it in simulation next week when I have a day off. will let you know. Just wish we could automate TOS, that way I could test it with the simulated account for sure.

Started this thread Reply With Quote
  #25 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

Ok I have set up Alerts, what coding do I need to add to the Alert to get the price at the time of the alert. to set as the price + a % to buy or sell at

Started this thread Reply With Quote




Last Updated on August 7, 2020


© 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