Sell message not send in telegram code is below i try to find solution

tg = GetScriptObject(); 
if (LastValue(ValueWhen(Buy,BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"buyAlert")==0)
{
tg.Telegram("#" + Name() + "  " + Date() + " " + " "
+ "\n" + " Good News to Buy Call" 
+ "\n" + " Buy: " + BuyPrice
+ "\n" + " Target 1: " + BuyTarget1
+ "\n" + " Target 2: " + BuyTarget2
+ "\n" + " Target 3: " + BuyTarget3
+ "\n" + " Stop Loss: " + BuyStopLoss
+ "\n" + " RSI: " + RSI(14)
+ "\n" + " MFI: " + MFI(14)
+ "\n" + " % PCR: " + (100*(C - Ref(C,-1)))/(Ref(C,-1)));
StaticVarSet(Name()+ GetChartID() + "buyAlertBar", LastValue(TimeNum()));

}
if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"buyAlertBar"))
StaticVarSet(Name()+GetChartID()+"buyAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"buyAlert",0); // new bar formed, and alerts can be trigered.


if (LastValue(ValueWhen(Sell,BarIndex())==BarIndex()) AND StaticVarGet(Name()+GetChartID()+"sellAlert")==0 )
{
tg.Telegram("#" + Name() + "  " + Date() + " " + " "
+ "\n" + " Good News to Sell Call" 
+ "\n" + " Buy: " - sellPrice
+ "\n" + " Target 1: " - SellTarget1
+ "\n" + " Target 2: " - SellTarget2
+ "\n" + " Target 3: " - SellTarget3
+ "\n" + " Stop Loss: " - SellStopLoss
+ "\n" + " RSI: " + RSI(14)
+ "\n" + " MFI: " + MFI(14)
+ "\n" + " % PCR: " + (100*(C - Ref(C,-1)))/(Ref(C,-1)));
StaticVarSet(Name()+ GetChartID() + "sellAlertBar", LastValue(TimeNum()));
}
if (LastValue(TimeNum()) == StaticVarGet(Name()+GetChartID()+"sellAlertBar"))
StaticVarSet(Name()+GetChartID()+"sellAlert",1); //alert was triggered, no more alerts on this bar
else
StaticVarSet(Name()+GetChartID()+"sellAlert",0); // new bar formed, and alerts can be trigered.

Try replacing "\n" with "%0A" and see if you get a "new line"

I try to send sell messages to Telegrame channel but buy message send correct but sell signal message not send

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.