Sequential Order Strategy

Mocnarf1

Member
I have been able to create a ThinkScript Buy-Sell Study . I use it to create
Conditional Orders. Nice thing about this study is that it allows me to view how
the Buy Sell routine would have performed on the Historical Chart.

The upper Chart shows SMA(9), SMI(200) , HeikenAshi CrossOverPoints
The Middle chart is Volume
The Lower Window Shows Up and Down Trend Lines and The Green and Red Spikes
shows potential BUY and SELL points. I am using a Sequential Conditional Order
which means that After the first BUY occurs any BUYs after it are ignored untill
a SELL has occur. I am using 3 full round trips in the Order.

Take a look at the Image below: This would be an example Historical testing.

The Red and Green Spikes indicate where my Sequenciel Conditional Order
will place Market Orders. My Sequencial Order currently just contains three
round trip Buy-Sell pairs. What do you think? It's a work in progress.


My chart setup includes MACDHistogram, SMA 9 and 20, TrendPeriods(), HeikenAshiCrossOverArrows, MyBuySell_HA_SMA Strategy and MyBuy_HA_SMA and MySell_HA_SMA which are put in their own window pane.
Any Suggestions?

I am trying to create a trading Strategy for use in a Sequential Conditional Order. This is what I have so far. It's a work in progress so any suggestions would be greatly appreciated. Here's the Script code:
Code:
#MyBuy_HA_SMA Study:
HeikinAshiDiff()[1] < 0 and HeikinAshiDiff() > 0
and  open < SimpleMovingAvg("length" = 9)."SMA"[0]
and MACDHistogram()."Diff" > MACDHistogram()."Diff"[1]
and TrendPeriods() > 0
;

#MySell_HA_SMA:
HeikinAshiDiff()[1] > 0 and HeikinAshiDiff() < 0
and MACDHistogram()."Diff" <  MACDHistogram()."Diff"[1]
and  open > SimpleMovingAvg("length" = 9)."SMA"[0]
and  close > SimpleMovingAvg("length" = 9)."SMA"[0]
;

#MyBuySell_HA_SMA Study:
def buy =
HeikinAshiDiff()[1] < 0 and HeikinAshiDiff() > 0
and  open < SimpleMovingAvg("length" = 9)."SMA"[0]
and MACDHistogram()."Diff" > MACDHistogram()."Diff"[1]
and TrendPeriods() >0
;

def sell =
HeikinAshiDiff()[1] > 0 and HeikinAshiDiff() < 0
and MACDHistogram()."Diff" <  MACDHistogram()."Diff"[1]
and  open > SimpleMovingAvg("length" = 9)."SMA"[0]
and  close > SimpleMovingAvg("length" = 9)."SMA"[0]
;

def buysignal = buy;
def sellsignal = sell;
AddOrder(OrderType.BUY_TO_OPEN, buysignal, name = "Buy", tickcolor = Color.DARK_RED, arrowcolor = Color.RED);
AddOrder(OrderType.SELL_TO_CLOSE, sellsignal, name = "Sell", tickcolor = Color.GREEN, arrowcolor = Color.GREEN);
 
Last edited by a moderator:
Need help to Buy High and Sell Low (No Really)

I want a strategy that will Buy high and Sell low. Not as easy as you might think. Let me explain.
I have some dividend paying stock that pay a nice monthly dividend. But as the market is sinking
so has value per share of these stocks. So I have this idea to sell some these holdings at the highest
current price and buy back at lower price in a few bars. I want set up Sequential Conditional Orders
to do this in a semi-bot way. So as to lower my average cost per share while retaining the same
number of shares and not miss out on the dividends. I am finding writing a Strategy that will
consistently do this is not as easy as you think.
Is this a bonehead Idea, or does it have some merit? And do you have any ideas to try.
 
You can stack up to 5 round trips (Buy-Sell) into 1 Sequential Conditional Order. I've been doing just that. I base my conditional order on a Buy Study and a Sell Study. You can test your Buy and Sell studies using a Strategy which I build from my Buy and Sell Study. It works pretty good. But it is still a work in progress. You can Save your Sequential Conditional Order as a template for when you want/need to re-initiate the sequence.
 
Last edited by a moderator:

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