NexusFi: Find Your Edge


Home Menu

 





CCI_CLOUDS for TOS


Discussion in ThinkOrSwim

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




 
Search this Thread

CCI_CLOUDS for TOS

  #1 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88

#CCI_CLOUDS
declare lower;
input cciLength2 = 5;
input cciAvgLength2 = 3;

input over_Sold = 20;
input over_Bought = 80;

plot OverBought = over_Bought;
OverBought.SetStyle(Curve.LONG_DASH);
plot OverSold = over_Sold;
OverSold.SetStyle(Curve.LONG_DASH);
#--------------------------------------------

plot CCI2 = .5 * CCI(length = cciLength2) + 50;
plot CCIAvg2 = Average(CCI2, cciAvgLength2);
plot CCI3 = ExpAverage(CCI2);
CCI2.SetStyle(Curve.SHORT_DASH);
CCI2.SetDefaultColor(GetColor(6));
CCIAvg2.SetDefaultColor(Color.RED);
CCI3.setDefaultColor(color.yellow);

AddCloud(CCI2, CCIAvg2, Color.GREEN, Color.RED);
AddCloud(CCI2, CCIAvg2, Color.GREEN, Color.RED);
AddCloud(CCIAvg2, CCI3, Color.GREEN, Color.RED);

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #2 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
Posts: 81 since Apr 2020
Thanks Given: 11
Thanks Received: 6

This plots out great. What would be the proper scripting to change it to a Strategy?

Reply With Quote
  #3 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88


i have no idea!

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

I figured it out
THANKS

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

Is there a way to get it to trigger at condition, or will it always wait til next bar

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

Seams to be a profitable strategy

#CCI_CLOUDS

input cciLength2 = 5;
input cciAvgLength2 = 3;
input over_Sold = 20;
input over_Bought = 80;

#--------------------------------------------

def CCI2 = .5 * CCI(length = cciLength2) + 50;
def CCIAvg2 = Average(CCI2, cciAvgLength2);
def CCI3 = ExpAverage(CCI2);
input usetimefilter = yes;

#positioning
input rthopen = 0930;
input rthclose = 2000;
def RTH = if usetimefilter == yes then if SecondsFromTime(rthopen) >= 0 and
SecondstillTime(rthclose) >= 0
then 1
else 0 else 1;

AddOrder(OrderType.BUY_TO_OPEN, rth == 1 and CCI2 crosses above CCI3,
tickcolor = GetColor(0), arrowcolor = GetColor(0), name = "CCI_LE");
AddOrder(OrderType.SELL_TO_CLOSE, rth -- 1 and CCI2 crosses below CCI3,
tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "CCI_SE");

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

I did add a Trailing Stop


input trailStop = .3;
input offsetType = {default percent, value, tick};

def entryPrice = entryPrice();
def price = if IsNaN(entryPrice[1]) then entryPrice else if !IsNaN(entryPrice) then Max(high, price[1]) else entryPrice;

def mult;
switch (offsetType) {
case percent:
mult = price / 100;
case value:
mult = 1;
case tick:
mult = tickSize();
}

def trailStopPrice = price - trailStop * mult;

addOrder(OrderType.SELL_TO_CLOSE, low <= trailStopPrice, tickColor = GetColor(0), arrowColor = GetColor(0))

Reply With Quote
Thanked by:
  #8 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88

good job.

Reply With Quote
  #9 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88

i have installed the new mod with the add order code but i see nothing on the chart.
i am not familiarized with this add order script.
can you explain, please!

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


Interesting It did not work for me at first either. Not sure what I did. I did log off and back on, not sure if that did it or not
Are you using ThinkorSwim

Try this correction

AddOrder(OrderType.BUY_TO_OPEN, rth == 1 and CCI2 crosses above CCI3,
tickcolor = GetColor(0), arrowcolor = GetColor(0), name = "CCI_LE");
AddOrder(OrderType.SELL_TO_CLOSE, rth == 1 and CCI2 crosses below CCI3,
tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "CCI_SE");

Reply With Quote




Last Updated on May 17, 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