if (Thunder_1 == TRUE)
{
RefreshRates();
l_irsi_0 = iRSI (NULL, PERIOD_M15, 6, PRICE_CLOSE, 0);
l_irsi_8 = iRSI (NULL, PERIOD_M1, 20, PRICE_CLOSE, 0);
ld_16 = NormalizeDouble (iMA (NULL, 0, 8, 0, MODE_SMA, PRICE_WEIGHTED, 1), 4);
if (l_irsi_0 < 30.0 || l_irsi_8 < 36.0 && ld_16 >= Bid + 2.0 * SetPoint() * SetBroker())
{
if (g_count_SELL_MN1 > 0)
{CloseSell_1();}
if (gi_520 && Sell_Only() == 0 && g_count_BUY_MN1 < 1 && g_count_BUY_All < gi_544 && TimeForNextOPBuy() && Damiani_Filter())
{
g_ticket_1316 = OrderSend (Symbol(), OP_BUY, GetLotsSessionA(), Ask, slp_X(), GetSL_Buy(), GetTP_Buy(), f_comment(myOrderComment + "_1 " + Symbol()), f_MagicNumber(3, 0, MagicNumber1), 0, Green);
if (Paranoid && g_ticket_1316 > 0)
{
f_MagicNumber (1, g_ticket_1316, MagicNumber1);
Print ("Save magick:", MagicNumber1, " Get:", f_MagicNumber (0, g_ticket_1316, 0));
}
gi_520 = FALSE;
gi_524 = TRUE;
}
}
if (l_irsi_0 > 70.0 || l_irsi_8 > 64.0 && ld_16 <= Bid - 2.0 * SetPoint() * SetBroker())
{
if (g_count_BUY_MN1 > 0)
{CloseBuy_1();}
if (gi_524 && Buy_Only() == 0 && g_count_SELL_MN1 < 1 && g_count_SELL_All < gi_544 && TimeForNextOPSell() && Damiani_Filter())
{
g_ticket_1316 = OrderSend (Symbol(), OP_SELL, GetLotsSessionA(), Bid, slp_X(), GetSL_Sell(), GetTP_Sell(), f_comment(myOrderComment + "_1 " + Symbol()), f_MagicNumber(3, 0, MagicNumber1), 0, Red);
if (Paranoid && g_ticket_1316 > 0)
{
f_MagicNumber (1, g_ticket_1316, MagicNumber1);
Print ("Save magick:", MagicNumber1, " Get:", f_MagicNumber (0, g_ticket_1316, 0));
}
gi_524 = FALSE;
gi_520 = TRUE;
}
}
if (l_irsi_0 < 60.0 && l_irsi_0 > 40.0)
{
gi_524 = TRUE;
gi_520 = TRUE;
}
}