I find yet another gross error.
There are 2 similar EAs - one embedded in Pi and other on EA page on zerodha,com
In them the Buy and Sell codes are completely reversed.
EA in Pi:
Name: Golden Crossover
Buy: crossover(sma(close,50),sma(close,200))
Sell: crossover(sma(close,200),sma(close,50))
But
EA on https://zerodha.com/expert-advisors/code/death-cross-and-golden-cross
Name: Death Cross & Golden Cross
Buy: CROSSOVER(SMA(CLOSE,200),SMA(CLOSE,50))
Sell: CROSSOVER(SMA(CLOSE,50),SMA(CLOSE,200))
This is the Correct Condition.