Modified Silver B For ThinkOrSwim

Bingy

Member
Hey Guys,

As a way to give back to this super helpful community I have made a modified SilverBullet strategy.
The original strategy doesn't use indicators, but this one takes the overall concept and incorporates indicators, as well as the time of day for entries and exits.

Works best on Futures with the 15 min time frame. As always use at your own risk.

Anyway, check it out if you want. Peace!
Code:
#TIME LABEL CODE
input showlabels = yes;
input showverticals = yes;




#New York Silver Bullet 
AddLabel(showlabels and SecondsFromTime(1045) >= 0 and SecondsTillTime(1130) > 0, "Zone 4", Color.GRAY);

AddVerticalLine(showverticals and SecondsFromTime(1045) == 0, "NYC SB", Color.GRAY);

AddVerticalLine(showverticals and SecondsFromTime(1130) == 0, "End", Color.GRAY);

#RSI CODE
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input Strike_Up_1 = 70.00;
input Strike_Up_2 = 55.55;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
def OverSold = over_Sold;
def OverBought = over_Bought;



#New York Longs
def NYLongPosition_1 = RSI crosses above Strike_Up_1 and
                    SecondsFromTime(1030) >= 0 and
                    SecondsTillTime(1100) >= 0;

def NYLongPosition_2 = RSI crosses above Strike_Up_2 and
                    SecondsFromTime(1030) >= 0 and
                    SecondsTillTime(1100) >= 0;

def NYLongPosition_3 =  RSI crosses above over_Sold and
                    SecondsFromTime(1030) >= 0 and
                    SecondsTillTime(1100) >= 0;




#NEW YORK POSITION ENTRY


AddOrder(OrderType.BUY_TO_OPEN, NyLongPosition_2, open[-1], 4, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "Enter Long");


#EXIT LONG POSITION

def NYExitPosition = if NYLongPosition_1 or NYLongPosition_2 or  NYLongPosition_3 then SecondsFromTime(1145) >= 0 else SecondsFromTime(1145) >= 0;





AddOrder(OrderType.SELL_TO_CLOSE, NYExitPosition , open[-1], 4, tickcolor = Color.RED, arrowcolor = Color.RED);



#STOP LOSS

######################
#STOP LOSS
######################
# Find the lowest low of the last 4 bars from the BuySignal
def Stop_loss = if 


#NEW YORK



NYLongPosition_2





then Lowest(low, 0) else Stop_loss[1];

# Check if the current close is below the stop loss level
def isStopTriggered = close < Stop_loss;
 
Last edited:
Hey Guys,

As a way to give back to this super helpful community I have made a modified SilverBullet strategy.
The original strategy doesn't use indicators, but this one takes the overall concept and incorporates indicators, as well as the time of day for entries and exits.

Works best on Futures with the 15 min time frame. As always use at your own risk.

Anyway, check it out if you want. Peace!
Code:
#TIME LABEL CODE
input showlabels = yes;
input showverticals = yes;




#New York Silver Bullet
AddLabel(showlabels and SecondsFromTime(1045) >= 0 and SecondsTillTime(1130) > 0, "Zone 4", Color.GRAY);
AddVerticalLine(showverticals and SecondsFromTime(1045) == 0, "NYC SB", Color.GRAY);
AddVerticalLine(showverticals and SecondsFromTime(1130) == 0, "End", Color.GRAY);

#RSI CODE
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input Strike_Up_1 = 70.00;
input Strike_Up_2 = 55.55;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
def OverSold = over_Sold;
def OverBought = over_Bought;



#New York Longs
def NYLongPosition_2 = RSI crosses above Strike_Up_2 and
                    SecondsFromTime(1030) >= 0 and
                    SecondsTillTime(1100) >= 0;

#NEW YORK POSITION ENTRY
AddOrder(OrderType.BUY_TO_OPEN, NyLongPosition_2, open[-1], 4, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "Enter Long");


#EXIT LONG POSITION
def NYExitPosition = if NYLongPosition_1 or NYLongPosition_2 or  NYLongPosition_3 then SecondsFromTime(1145) >= 0 else SecondsFromTime(1145) >= 0;

AddOrder(OrderType.SELL_TO_CLOSE, NYExitPosition , open[-1], 4, tickcolor = Color.RED, arrowcolor = Color.RED);




#STOP LOSS
######################
#STOP LOSS
######################
# Find the lowest low of the last 4 bars from the BuySignal
#NEW YORK
def Stop_loss = if NYLongPosition_1 or NYLongPosition_2  or NYLongPosition_3
then Lowest(low, 0) else Stop_loss[1];

# Check if the current close is below the stop loss level
def isStopTriggered = close < Stop_loss;
code is not right. better post link to it
 
code is not right. better post link to it
I fixed it above. Sorry for the confusion, it should work perfectly now. The code is slightly bloated because NY position #2 works the best, but feel free to experiment with the others.
 
Last edited:
can someone fix this, looks like it would be good if we can get it to work. thanks





#TIME LABEL CODE
input showlabels = yes;
input showverticals = yes;




#New York Silver Bullet
AddLabel(showlabels and SecondsFromTime(1045) >= 0 and SecondsTillTime(1130) > 0, "Zone 4", Color.GRAY);
AddVerticalLine(showverticals and SecondsFromTime(1045) == 0, "NYC SB", Color.GRAY);
AddVerticalLine(showverticals and SecondsFromTime(1130) == 0, "End", Color.GRAY);

#RSI CODE
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input Strike_Up_1 = 70.00;
input Strike_Up_2 = 55.55;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
def OverSold = over_Sold;
def OverBought = over_Bought;



#New York Longs
def NYLongPosition_2 = RSI crosses above Strike_Up_2 and
SecondsFromTime(1030) >= 0 and
SecondsTillTime(1100) >= 0;

#NEW YORK POSITION ENTRY
AddOrder(OrderType.BUY_TO_OPEN, NyLongPosition_2, open[-1], 4, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "Enter Long");


#EXIT LONG POSITION
def NYExitPosition = if NYLongPosition_1 or NYLongPosition_2 or NYLongPosition_3 then SecondsFromTime(1145) >= 0 else SecondsFromTime(1145) >= 0;

AddOrder(OrderType.SELL_TO_CLOSE, NYExitPosition , open[-1], 4, tickcolor = Color.RED, arrowcolor = Color.RED);




#STOP LOSS
######################
#STOP LOSS
######################
# Find the lowest low of the last 4 bars from the BuySignal
#NEW YORK
def Stop_loss = if NYLongPosition_1 or NYLongPosition_2 or NYLongPosition_3
then Lowest(low, 0) else Stop_loss[1];

# Check if the current close is below the stop loss level
def isStopTriggered = close < Stop_loss;
 

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
410 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