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