Hi @Ghs,Hi @Christopher84
Thank you adding SL and TP levels to the strategy. I have a couple of questions:
1. I am not getting the same P/L amount that you are getting for 15min 180days charts. I am not sure if any settings need to be changed. Could you please share your settings?
2. How do you calculate profit or loss of a trade? The highlighted short trade did not reach the TP1 and hit the SL. Would the P/L amount be calculated based on the SL only? or PL amount is considered until the next long trade is taken?
Thanks!
Thank you @Christopher84! P/L is showing same as your for 15min tf. What is your atr period and factor for 3mins tf?Hi @Ghs,
Please reload the code from pg.1. I noted a small issue with the atr factor (now corrected).
1. Make sure your after market hours are turned off. For the 15 min /es chart, I use an atr period of 5 (default) and atr period of 3.0.
2. The floating p/l is calculated based on the entire strategy not the targets or stoploss. The profits shown on the targets are calculated from the order entry (green line for long trades, red line for short trades). Hope this helps!
For the 3 min /es chart, I'm using an atr period of 9 and atr factor of 2.3. These setting are doing well, but I am sure it can be optimized further.Thank you @Christopher84! P/L is showing same as your for 15min tf. What is your atr period and factor for 3mins tf?
Chris,Really liking this indicator!
Hi @hotwins!Chris,
I read thru this forum, it looks promising & very much appreciated for the times you had given in. what's that blue on this chart. thanks.
Is their a tos link for this chart setup.Really liking this indicator!
Hi @Madhu,
My notes above the code on pg.1 of the thread were to address this. It can be used on stocks and other futures, but the "mult" will need to be changed to 1 for stocks and for other futures mult will need to be changed to the appropriate multiplier.
######################################################
## Create Signals -
## FILL IN THIS SECTION
## replace 0>0 with your conditions for signals
######################################################
def PLBuySignal = if MarketOpen AND (upsignal) then 1 else 0 ; # insert condition to create long position in place of the 0>0
def PLSellSignal = if MarketOpen AND (downsignal) then 1 else 0; # insert condition to create short position in place of the 0>0
def PLBuyStop = if !useStops then 0 else if (0>0) then 1 else 0 ; # insert condition to stop in place of the 0<0
def PLSellStop = if !useStops then 0 else if (0>0) then 1 else 0 ; # insert condition to stop in place of the 0>0
click edit studies, last line in the setting below timeframe. Multi change to 1.My questions are trivial, hope they don't waste your much time:
1. Where to change the default setting mult from 50 to 1? I searched code, but did not find
2. Could you give an example of condition 0>0 I need to set?
Code:###################################################### ## Create Signals - ## FILL IN THIS SECTION ## replace 0>0 with your conditions for signals ###################################################### def PLBuySignal = if MarketOpen AND (upsignal) then 1 else 0 ; # insert condition to create long position in place of the 0>0 def PLSellSignal = if MarketOpen AND (downsignal) then 1 else 0; # insert condition to create short position in place of the 0>0 def PLBuyStop = if !useStops then 0 else if (0>0) then 1 else 0 ; # insert condition to stop in place of the 0<0 def PLSellStop = if !useStops then 0 else if (0>0) then 1 else 0 ; # insert condition to stop in place of the 0>0
Appreciate it.
thank you.!!!Hi @hotwins!
The blue line is Ehler’s Distant Coefficient Filter.
Sorry, I still did not get it. You mean click edit studies on the UI? I only got the list of studies. I tried other gear, but still did not find it. I looked at the code again, not find it either. Is it possible to have a screenshot? Thank you.click edit studies, last line in the setting below timeframe. Multi change to 1.
Click on the flask icon, this brings up your "Added studies and strategies" pane, then click the gear icon next to your saved named study for all the adjustable inputs and options.Sorry, I still did not get it. You mean click edit studies on the UI? I only got the list of studies. I tried other gear, but still did not find it. I looked at the code again, not find it either. Is it possible to have a screenshot? Thank you.
scroll down the bar on the right... all the way bottom...
You don't seem to have v8 source code loaded, those options look like v3, check page 1 against your code.I actually did, no such option.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.