NexusFi: Find Your Edge


Home Menu

 





Convert ToS code to Sierra


Discussion in Sierra Chart

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




 
Search this Thread

Convert ToS code to Sierra

  #1 (permalink)
 rmiller863 
Lake wales FL/ USA
 
Experience: Intermediate
Platform: TOS ,Tradestation, Sierra
Trading: Futures
Posts: 41 since Jul 2013
Thanks Given: 9
Thanks Received: 2

I'd like to get a ToS code converted to Sierra charts?

#Hint AlertsOn: Plot the arrows \nDefault = Yes
#Hint ShowTodayOnly: Plot only today's arrows\nDefault = Yes
#Hint ShowExtraDays: Add extra days to ShowTodayOnly \nDefault = 0
#Hint ShowMA_Curves:Show or Hide the MA plot \nDefault = Yes
#Hint BlenderKing_Short: Length of Short MA \nDefault = 4;
#Hint BlenderKing_Long: Length of Long MA \nDefault = 7


input ArrowsOn = yes;
input TracerLinesOn = no;
input PriceColorOn = Yes;

input ShowTodayOnly = no;
input ShowExtraDays = 0;
def Today =
if !ShowTodayOnly then 1 else
if GetDay() + ShowExtraDays >= GetLastDay() && GetYear() == GetLastYear() then 1 else 0;
input ArrowSpace = .233;
def space = Average(high - low) * ArrowSpace;

#Input AlertsOn = no;
def BuyIt = PPS().buysignal;
def SellIt = PPS().sellsignal;

plot ppsBuy = if !Today or !ArrowsOn then Double.NaN else BuyIt - space;
ppsBuy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
ppsBuy.SetDefaultColor(Color.WHITE);
ppsBuy.SetLineWeight(3);
Alert(ppsBuy, “PPS Buy Signal”, Alert.BAR, Sound.Ring);

plot ppsSell = if !Today or !ArrowsOn then Double.NaN else SellIt + space;
ppsSell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
ppsSell.SetDefaultColor(Color.WHITE);
ppsSell.SetLineWeight(3);
Alert(ppsSell, “PPS Sell Signal”, Alert.BAR, Sound.Ring);



rec PriceAtBuy = if barNumber() == 1 then close else if !IsNaN(BuyIt[0]) then open[0] else PriceAtBuy[1];
rec PriceAtSell = if barNumber() == 1 then close else if !IsNaN(SellIt[0]) then open[0] else PriceAtSell[1];


rec trigger = if PriceAtBuy <> PriceAtBuy[1] then -1 else if PriceAtSell <> PriceAtSell[1] then 1 else trigger[1];
plot BuyPrice = if TracerLinesOn && trigger == -1 then PriceAtBuy else Double.NaN;
BuyPrice.SetDefaultColor(Color.white);
BuyPrice.SetPaintingStrategy(PaintingStrategy.POINTS);
plot SellPrice = if TracerLinesOn && trigger == 1 then PriceAtSell else Double.NaN;
SellPrice.SetDefaultColor(Color.Black);
SellPrice.SetPaintingStrategy(PaintingStrategy.POINTS);

AssignPriceColor(if !PriceColorOn then Color.CURRENT else if trigger == 1 then Color.red else Color.GREEN);
# BlenderKing_R1R3

# Revision history:
# Rev Date Change Description
# ---- ---------- ------------------
#
# R1V1 2010.03.30 - KumoBob
# R1V2 2010.04.21 - KumoBob
# Made Arrows dependant upon SMA_4 direction
# R1V3 2010.11.17:21:43 - KumoBob
# Made Revision history compliant with current standard
# Removed signals
#
# Thanks to BlenderKing for sharing this formula with me!
# ____________________ BlenderKing _______________________;

declare upper;
input ShowMA_Curves = Yes;
input BlenderKing_Short = 4;
input BlenderKing_Long = 7;

def SMA_4 = Average(data = hlc3, length = BlenderKing_Short);
plot SMA_4plot = if Today && ShowMA_Curves then SMA_4 else Double.NaN;
SMA_4plot.SetDefaultColor(Color.YELLOW);
def SMA_7 = Average(data = close, length = BlenderKing_Long);
plot SMA_7plot = if Today && ShowMA_Curves then SMA_7 else Double.NaN;
SMA_7plot.SetDefaultColor(Color.CYAN);

AddCloud(SMA_4plot, SMA_7plot);
plot Data = close;

Started this thread Reply With Quote




Last Updated on September 29, 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