EveryDayBetter
Pine Script Master
Pine Script Master
Posts: 27
Joined: February 16th, 2022

How can we create an easy turnaround Tuesday strategy?

My idea is to buy on Monday before stock market close and sell

a.) to Take Profit at 2 Percent or
b.) on Tuesday before stock market is closing.

//@version=5
strategy("id", overlay=true)

//Defining Monday evening

id = ???[This is the point I need help]

//Preparing exit condition

if id
strategy.entry("long",strategy.long)

//Declaring percentage numbers
SL = 0.05
TP = 0.03

//Calculating the esit price for sl and tp
longstop=strategy.position_avg_price*(1-SL)
longprofit=strategy.position_avg_price*(1+TP)

if strategy.position_size>0
strategy.exit(id = "close", stop=longstop, limit=longprofit, timestop on Thuesday evening)

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: How can we create an easy turnaround Tuesday strategy?

Please have a look at
https://www.tradingview.com/script/dT5b ... ke-Profit/

I created a strategy to enter long on near Monday close and than exit at either stoploss, takeprofit or before Tuesday close.

:long: :long:
  • This runs strategy on entering by weekday name and also by session time.
  • Implemented are also Take Profit and Stop Loss to exit position using custom inputs.
  • Added stoploss and take profit plot lines
https://www.tradingview.com/script/dT5b ... ke-Profit/

:coffee:

EveryDayBetter
Pine Script Master
Pine Script Master
Posts: 27
Joined: February 16th, 2022

Re: How can we create an easy turnaround Tuesday strategy?

processingclouds wrote:
Fri Feb 18, 2022 1:41 pm
Please have a look at
https://www.tradingview.com/script/dT5b ... ke-Profit/

I created a strategy to enter long on near Monday close and than exit at either stoploss, takeprofit or before Tuesday close.

:long: :long:
  • This runs strategy on entering by weekday name and also by session time.
  • Implemented are also Take Profit and Stop Loss to exit position using custom inputs.
  • Added stoploss and take profit plot lines
https://www.tradingview.com/script/dT5b ... ke-Profit/

:coffee:

Many thanks to you.

Return to “Pine Script Q&A”