TradingView
joylay83
2022년 1월 2일 오후 10시 3분

Chimpanzee V2.5 part A by joylay83 

Bitcoin / TetherUSBinance

설명

Hi everyone, I am an amateur pinecoder. I would like to share my script which is coded with the intention of generating signals to send to 3commas webhook. It is still in development and revision.



This collection of indicators use:
Chart: 15m.
Inverse Fisher Transformation of the RSI to detect dips in the 15m timeframe.
Bollinger band (4H) to filter out false signals.
Triple EMA 21: to mimic price action for easier coding alerts. Currently not involved in generating signals. will be incorporated in the future.
StochRSI: As a visual filter. Currently not involved in generating signals. will be incorporated in the future.
Background will be green if stochRSI is low and red if stockRSI is high.
Candlesticks will be marked with a flag is TEMA breached BB.

One would need to play around with timeframes, BB settings and IFTRSI threshold for different signals.

There are 2 Signal Modes (with regards to IFTRSI):
Threshold: When price action falls below BB and IFTRSI hits buy threshold, a buy/sell signal is generated. Eg if IFTRSI buy threshold is set to -0.9, the buy signal will remain continuously positive as long as IFTRSI is < 0.9.
Cross: When price action falls below BB and IFTRSI hits threshold, nothing happens. It will wait until the IFTRSI cross back over the threshold before firing a signal.



There is another identical set of indicators running on a higher time frame (IFTRSI: 4H, BB: D or 3D, TEMA 21 4H) but on the same chart. This tend to generate less signals but are more reliable. A usage example would be to send a larger buy order if the signal comes from this higher time frame, or execute a sell order after multiple buys from the lower time frame.

It comes in 2 parts:
Part A: Contains overlay display. This displays BB, Triple EMA, buy/sell and StochRSI in labels. the labels are self explanatory.
Part B (please search for it): which is actually the same code but contain non-overlay display. You may also put part B overlay=true but scale to LEFT. The advantage of using overlay=true is that you can move the signal right over the candlesticks (mainly for troubleshooting/debugging). This part contains Inverse Fisher RSI, %B, Signal Line. %B is supposedly idential to Bollinger Bands in Part A.

By default, when there is a buy/sell signal:
lower time frame 15m: Signal Line in Part B will turn blue with a value 1 or -1 which corresponds to a buy or sell label in Part A
higher time frame 4H: Signal Line in Part B will turn red with a value 2 or -2 which corresponds to a HTF buy or sell label in Part A

Part A or B may be used to send signal to the webhook. You have to make sure that the settings of Part A and B are identical.
You may choose to un-display some items to reduce clutter.


Current problems:
1. Still too many buy signals
Although many times it will generate excellent buy signal at many swing lows, but there are many buy signals prior to a major swing low. This can be observed in the picture above. It also generate a couple of buy signals prior to the swing lows. I am currently experimenting with 20m and hourly timeframe to address this issue. More filters are needed eg an oscillator or detecting candlestick patterns.

2. Premature sell signals.
The sell signal is often generated at the beginning of a major bull run. My idea to solve this problem is to move to a higher timeframe and sell only when TEMA crossunder the upper bollinger band.

3. Lack of a backtester that can test multiple concurrent deals.
Buy -> Buy (average down) -> Buy (average down) -> Buy (average down) -> Sell

4. Lack of the ability to calculate average purchase price
Probably have to code it as a strategy

5. Display lag
As the browser is running 2 copies of the idential script, it tends to lag when you drag your chart around. So far there are no timeouts or delay in firing alerts to 3commas.


I do welcome any suggestion for improvement and constructive criticism. tqvm.


Credits : Thank you for doing an awesome job. I learnt a lot from your codes and tutorials.
Credits not listed in any order. If your code is used here and did not receive due credit, kindly drop me a note. tq.
Blessing 3 by JTA Today
@ZenAndTheArtOfTrading (extremely-easy-to-understand tutorials eg fixing repainting)
@LazyBear (various codes)
@Galactus-B Argo I
@TheTradingParrot (Inverse Fisher RSI and Gavin's backtester)
@zendog123 (backtester and various codes)
@ydeniz2000 (Bollinger Bands)
TradingView built-in scripts







릴리즈 노트

Update:
1. code cleanup
2. BB can now have different upper and lower SD. you may use EMA or SMA.
3. HTF can be enabled/disabled as a whole or indivdual Indis.
4. Main vs companion plotting mode. Part B of this script have been hidden by mods because it was to similar to this script (Part A). so I hav included a script that you can easily switch from main to companion mode without altering too much codes. if you use companion mode: you need to set the overlay to false, or overlay to true and scale to scale.left..
5. Added smoothing for HTF but it somehow interferes with the BG color and also the trade signals. suggest to leave it disabled for now.

there is no strategy version yet for now. also no inbuilt backtester for now. might be included in the future.

Please let me know if you found any bugs. tq
코멘트
BTO_mg
Great work man! I really like it and I think it has a lot of potential! I know the script is still in development, but is there a way to conect it to 3commas in this stage?
joylay83
@BTO_mg, HI! Glad that you like it.

Yes I am currently actively running this copy of the script via webhook to 3commas on multiple pairs without leverage. Due to the premature selling problem (which might incur a loss), I am now only buying and sell manually.

Just copy your bot message from 3commas and paste it at the buy/sell under the 'Alerts' section. Note that there are 2 Buys and 2 Sells. this enables you to run 2 strategies concurrently. It will be left to your creativity. for example: you might want to scalp at the lower timeframes: so you paste your Buy command at Buy, set 3commas to TP at 2% or so, leave Sell empty because its done by 3commas. when the higher time frame gives a buy signal, you might want to do a top up or position trade. you may then copy the top up msg from 3commas and paste at the HTF Buy signal. then when the HTF issues a sell signal, you might want to activate a short bot: copy and paste the short bot command at the HTF Sell column. You can also join the JSON and carry out 2 simultaneous commands. you can refer to 3commas documentation for this.

Unfortunately part B of this script is hidden because it is too similar to part A (to which i definitely agree, but I did not realise that you can't publish 2 similar script - sorry Mods for this). Therefore, you will have to 'recreate' Part B by uncommenting the Overlay Plots and deleting the slashes for non-overlay plots. then set overlay to False.
nicholastirion
Love it, might add some of this to my script! I automate mine through oanda maybe I can help you!
joylay83
@nicholastirion, ya sure. You can add them. Glad that u liked the script. Im in the midst of some code cleaning. If you could give me a few days time, i'll publish the updated version of it. I'll definitely need some1 to test it :)
더보기