Stock option (NO Stop Loss) Buy.
It works on Stock 1 hour time frame, Critically I have used on SENSEX, 5 Minutes Time Frame in Trending Market.
Stock Options
Buy
No Stop Loss
Rules :
-
It works only on Stocks (Typically I have used on SENSEX STRIKE CHART with 5 Minute time Frames)
-
Time Frame : 1 hour (SENSEX strike chart 5 minutes)
-
It doesn't have STOP LOSS, so with options use with Cautions.
-
See Below Pine Code to add (name is 1 Hour Open vs Close Buy Strategy)
Code modified :
1. Overlay = true, defualt_qty_type=strategy.fixed,default_qty_value=1
2. Implement stop loss to execute (future developement)
//@version=6
// SWING Trading Strategy
// 1 Hour Time Frame
// © JayeshBoradia Youtube viratbharat
//---------------------------------
// default_qty_type (const string) Specifies the units used for default_qty_value. Possible values are:
// a. strategy.fixed for contracts/shares/lots
// b. strategy.cash for currency amounts
// c. strategy.percent_of_equity for a percentage of available equity.
// This setting can also be changed in the strategy's "Settings/Properties" tab. Optional. The default is strategy.fixed.
//---------------------------
// default_qty_value (const int/float) The default quantity to trade, in units determined by the argument used with the default_qty_type parameter. This setting can also be changed in the strategy's "Settings/Properties" tab.
// Optional. The default is 1.
//------------------
// strategy("1 Hour Open vs Close Buy Strategy", overlay=true,default_qty_type=strategy.percent_of_equity, default_qty_value=100)
strategy("1 Hour Open vs Close Buy Strategy", overlay=true,default_qty_type=strategy.fixed, default_qty_value=1)
// Define the buy condition: current open is higher than the previous close
buyCondition = open > close[1] and strategy.position_size == 0 // Only buy if there is no active position
// Execute the buy order and plot buy price
if (buyCondition)
strategy.entry("Buy", strategy.long)
label.new(x=bar_index, y=low, text="Buy at: " + str.tostring(open),style=label.style_label_up, color=color.green, size=size.normal, textcolor=color.white)
// Define the sell condition based on 3% profit target from the buy price
targetPrice = strategy.position_avg_price * 1.03
// Check if the current price has reached the target price and close the position
if (strategy.position_size > 0 and close >= targetPrice)
strategy.close("Buy")
label.new(x=bar_index, y=high, text="Sell at: " + str.tostring(close),style=label.style_label_down, color=color.red, size=size.normal, textcolor=color.white)
// Plotting to visualize entries and exits on the chart
plotshape(series=buyCondition, location=location.belowbar, color=color.green,style=shape.labelup, text="Buy")
plotshape(series=(strategy.position_size > 0 and close >= targetPrice),location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")

