saving order as template?

optionizerSS

New member
So I have created a few order templates. Under the Trade tab I click 'Buy Custom' and select the one I want but when opening it to view it the script has changed and the time is set to Day instead of 15m like it should be. This means I have to re-create the orders every morning which basically means saving the template is worthless? I have used saved templates before and they have worked fine but for some reason this one doesn't.

Any ideas?

Thanks!
 
Solution
So I have created a few order templates. Under the Trade tab I click 'Buy Custom' and select the one I want but when opening it to view it the script has changed and the time is set to Day instead of 15m like it should be. This means I have to re-create the orders every morning which basically means saving the template is worthless? I have used saved templates before and they have worked fine but for some reason this one doesn't.

Any ideas?

Thanks!
Without a script or more information, it is not possible to say where you went astray.

Is it possible that you were working on a weekend when ToS does maintenance?
Did you try signing all the way out and back in?
Deleting your GUI library?

Last resort:
re-installing the ToS app?
So I have created a few order templates. Under the Trade tab I click 'Buy Custom' and select the one I want but when opening it to view it the script has changed and the time is set to Day instead of 15m like it should be. This means I have to re-create the orders every morning which basically means saving the template is worthless? I have used saved templates before and they have worked fine but for some reason this one doesn't.

Any ideas?

Thanks!
Without a script or more information, it is not possible to say where you went astray.

Is it possible that you were working on a weekend when ToS does maintenance?
Did you try signing all the way out and back in?
Deleting your GUI library?

Last resort:
re-installing the ToS app?
 
Solution
Without a script or more information, it is not possible to say where you went astray.

Is it possible that you were working on a weekend when ToS does maintenance?
Did you try signing all the way out and back in?
Deleting your GUI library?

Last resort:
re-installing the ToS app?
I have deleted and re-created it several times. I should say it is a conditional order that I saved as a template, not a 'script' per se. And yeah, I sign out of ToS every night. The order is based on a script I got from here and I added a little to it.

Here is the entry order:
HA_Trend_MA()."UpSig" from 1 bars ago is true and MovAvgExponential("length" = 10)."AvgExp" is greater than MovAvgExponential("length" = 30)."AvgExp"

and the exit order:
HA_Trend_MA("ha agg2" = "FIFTEEN_MIN")."UpSig" from 1 bars ago is false
 
For reference here is the strategy it points to:

#MTF Heiken Ashi Trend Moving Average
def haAgg1 = GetAggregationPeriod();
input haAgg2 = AggregationPeriod.THIRTY_MIN;
def fastEMA = movAvgExponential (10);
def slowEMA = movAvgExponential (30);
def Bullish = fastEMA is greater than slowEMA;
def Bearish = fastEMA is less than slowEMA;

input maLength = 20;
input averageType = AverageType.EXPONENTIAL;
input price = close;
input Alerts = yes; #Hint Alerts: BUY/SELL audio alerts

DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Bearish", Color.RED);
DefineGlobalColor("Neutral", Color.YELLOW);
#HAgg1
def o1 = open("period"= haAgg1);
def h1 = high("period"= haAgg1);
def l1 = low("period"= haAgg1);
def c1 = close("period"= haAgg1);
def HA1open;
def HA1high;
def HA1low;
def HA1close;
HA1open = CompoundValue(1, (HA1open[1] + HA1close[1]) / 2, (o1[1] + c1[1]) / 2);
HA1high = Max(Max(h1, HA1open), HA1close[1]);
HA1low = Min(Min(l1, HA1open), HA1close[1]);
HA1close = (o1 + h1 + l1 + c1) / 4;


#HAgg2
def o2 = open("period"= haAgg2);
def h2 = high("period"= haAgg2);
def l2 = low("period"= haAgg2);
def c2 = close("period"= haAgg2);
def HA2open;
def HA2high;
def HA2low;
def HA2close;
HA2open = CompoundValue(1, (HA2open[1] + HA2close[1]) / 2, (o2[1] + c2[1]) / 2);
HA2high = Max(Max(h2, HA2open), HA2close[1]);
HA2low = Min(Min(l2, HA2open), HA2close[1]);
HA2close = (o2 + h2 + l2 + c2) / 4;


def HA1 = HA1close > HA1open;
def HA2 = HA2close > HA2open;


AddLabel(1,"HA1", if HA1 then GlobalColor("Bullish") else GlobalColor("Bearish"));
AddLabel(1,"HA2", if HA2 then GlobalColor("Bullish") else GlobalColor("Bearish"));

plot MA = MovingAverage(AverageType, price, maLength);
MA.SetDefaultColor(Color.GRAY);
MA.SetLineWeight(2);
MA.AssignValueColor(if HA1 and HA2 then GlobalColor("Bullish") else if !HA1 and !HA2 then GlobalColor("Bearish") else GlobalColor("Neutral"));

def posHASig = HA1 and HA2;
def negHASig = !HA1 and !HA2;
plot UpSig = posHASig and !posHASig[1];
plot DownSig = negHASig and !negHASig[1];
UpSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSig.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
UpSig.AssignValueColor(GlobalColor("Bullish"));
DownSig.AssignValueColor(GlobalColor("Bearish"));

Alert(UpSig[1] and Alerts, "HA Long", Alert.BAR, Sound.Bell);
Alert(DownSig[1] and Alerts, "HA Short", Alert.BAR, Sound.Bell);

-----------------------------------------------------------------------------------------------------------------------------------

then i add the 10 EMA greater than 30 EMA for longs and the opposite for shorts
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
589 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top