shawnteoh

MA Emperor insiliconot Strategy

Converted EmperorBTC's EMA crossover indicator for easy backtesting and added ability to:
  • Specify time period for backtesting
  • Specify order quantity
  • Toggle original indicators (default off)

Quoting EmperorBTC:
Entry is to be made when the
1. Cross over gives a P(Positive Sign) and the candle completely closes above the cross-over
2. When the Heikin Ashi turns green and the next green HA candle goes above the previous green HA candle.
3. The price should be at-least above the 0.236 Level from the Swing high.

Kindly note that the strategy only attempts to do check number 1, where it ensures the entry opens above the cross-over.
Informacje o Wersji: Updated to Pine Script v4 and implemented more checks before buying/selling:
  • Candle closes above / below the cross
  • Candle closes above 0.236 Fib / below 0.764 Fib from the most recent swing high / swing low
  • Next Heikin Ashi candle is green / red
Informacje o Wersji: Updated formula for pivot points
Informacje o Wersji: The alert script was hidden due to TradingView's rules, they do not allow similar scripts to be published. Therefore in order to enable alert functionalities, kindly duplicate this script and comment/uncomment (i.e. adding/removing "//") the indicated rows marked as "//Comment for alert" or "//Uncomment for alert".

If my work helped you, ETH address: 0xF9538782fE92783346eB5f41150176D125ED7048
Informacje o Wersji: Missed out a line to comment out for alert
Informacje o Wersji:
  • Simplified backtest range input
  • Alternate background color for signals instead of using floating shapes
  • Remove order quantity input, can be done via TradingView's in-built strategy properties which are much more robust
Informacje o Wersji: Left the old floating shapes commented out in case anyone prefers them
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go dodać do ulubionych, żeby używać go na wykresie.

Chcesz użyć tego skryptu na wykresie?

Komentarze

Pls explain in simple way...m not able to understand the steps
Nd what does P N means
Odpowiedz
Hi Shawnteoh,

Thanks for the script. For alerts I have commented and uncommented as uncommented in the script as mentioned. :)
Now I am a novice in trading view and trying to see add alert in the trading view UI.
Is this right:
On the indicator on the chart > 3 dots(options) > Add alert on <Script name>.
Alert dialog opens..

Condition:
Dropdown 1 > <indicator name>
Dropdown 2 >Buy condition

Options:
selecting "Once per bar close"
Odpowiedz
shawnteoh jayeshvg88
Odpowiedz
jayeshvg88 shawnteoh
@shawnteoh, Awesome.. Thanks again.. :)
Odpowiedz
Hi Shawnteoh,
Thanks for the script.
What would be the right way to set up the position sizes to show the performance for, let's say, a 10.000USD investment?
So far I only managed to set a contract size, which results in different USD amounts depending on the stock price. If I leave the contracts at 1 at the properties tab, and play with the input numbers, no changes are made in the backtesting panels. Thanks!
Odpowiedz
shawnteoh sauriki
@sauriki, at row 5, add default_qty_type = strategy.cash for the orders to be in USD instead of unit size
Odpowiedz
Release Notes: The alert script was hidden due to TradingView's rules, they do not allow similar scripts to be published. Therefore in order to enable alert functionalities, kindly duplicate this script and comment/uncomment (i.e. adding/removing "//") the indicated rows marked as "//Comment for alert" or "//Uncomment for alert"..
I dont get the comment for alert.
Can you explain further?
Odpowiedz
shawnteoh moonstoned
@moonstoned, it basically means to uncomment the alert related lines and comment out the strategy related lines within the code, effectively converting this from a strategy to indicator.
Odpowiedz
Heatzer shawnteoh
@shawnteoh, Why am I getting this error after comment/uncomment? Appreciate your response to this

"You cannot use strategy functions (strategy.risk.allow_entry_in) in study script. Please replace 'study' with 'strategy'."
Odpowiedz