Disliked{image} sorry Jackson, it is already available . . {image} clrBUY1, clrSELL1, related to many items . . that usually should be GREEN/RED colors . .Ignored
1
TMA-RSI-Bands (RSI Of TMA Centered + Bands) 28 replies
Need small modification on my RSI cross/touch RSI alert 0 replies
RSI cross indicator when rsi=50 19 replies
RSI (Fast) above/below RSI (Slow) displayed as a Histogram 5 replies
Disliked{image} sorry Jackson, it is already available . . {image} clrBUY1, clrSELL1, related to many items . . that usually should be GREEN/RED colors . .Ignored
Dislikedbuddies-lab-quiz: from csv file, modify chart background color to be red permenantly . . {image} -Ignored
Disliked{image}line 204, 203 save then recall AVERAGE_BUY_COLOR=C'0,111,0' AVERAGE_SELL_COLOR=C'111,0,44' change it to: (just an example) AVERAGE_BUY_COLOR=C'255,255,255' AVERAGE_SELL_COLOR=C'255,255,144'Ignored
Disliked{quote} I didn't expect playing with colors to be so much funbut I can't change the dollar icon
{image}
Ignored
Disliked{quote} Just trying to help (but might be fumbling in the dark) Maybe to consider into the mix could also be; 2. ERR_133 (ERR_TRADE_PROHIBITED) -- break loop entirely (no trades can be executed across any symbol) 3. ERR_135 (ERR_PRICE_CHANGED) — retry with RefreshRates()(common in fast markets; not fatal) 4. ERR_136 (ERR_OFF_QUOTES) — wait for new tick, then retry (temporary; may resolve on next price update) 5. ERR_146 (ERR_TRADE_CONTEXT_BUSY) — sleep & retry (common under high load; resolves quickly) 6. ERR_4 (ERR_TRADE_SERVER) / ERR_137...
Ignored
Disliked10. ERR_4755 (ERR_INVALID_STOPS) or Slippage-related — adjust slippage dynamicallyIgnored
void p_OnTradeTransaction(int tkt, double entry_price,string deal_comment,int type)
{
cTransct++;
int spread_points = (int)SymbolInfoInteger(_Symbol, SYMBOL_SPREAD); // Spread in points
int stops_level = (int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL);
double min_distance = stops_level * point;
double sl_price = 0;
double tp_price = 0;
bool is_buy = (type == 0);
bool is_sell = (type == 1);
bool has_BU = (StringFind(deal_comment, "/BU/") != -1);
bool has_SU = (StringFind(deal_comment, "/SU/") != -1);
double choose_sl = MathMax(stops_level,spread_points);
// === TAKE PROFIT - always based on actual entry price ===
if(TAKE_PROFIT_PIPS > 0.01)
{
// Ensure TP is far enough from entry (broker safety)
double safe_tp_distance = MathMax(TAKE_PROFIT_PIPS*dig, stops_level);
if(is_buy)
tp_price = NormalizeDouble(entry_price + safe_tp_distance * point, digitsO);
else
tp_price = NormalizeDouble(entry_price - safe_tp_distance * point, digitsO);
}
// === STOP LOSS LOGIC ===
if(has_BU && is_buy && priceBL_ST > 0.01)
{
// Use fixed SL for /BU/ (BUY)
sl_price = NormalizeDouble(priceBL_ST, digitsO);
// Safety check: SL must be below entry for BUY
if(sl_price >= entry_price - min_distance)
{
//Print("Fixed SL (/BU/) invalid: too close or above entry price. Skipping SL.");
sl_price = 0;
}
}
else if(has_SU && is_sell && priceSL_ST > 0.01)
{
// Use fixed SL for /SU/ (SELL)
sl_price = NormalizeDouble(priceSL_ST, digitsO);
// Safety check: SL must be above entry for SELL
if(sl_price <= entry_price + min_distance)
{
//Print("Fixed SL (/SU/) invalid: too close or below entry price. Skipping SL.");
sl_price = 0;
}
}
else
{
// Normal points-based SL (no special tag)
if(STOP_LOSS_PIPS > 0.01)
{
int safe_sl_distance = int(MathMax(STOP_LOSS_PIPS*dig, choose_sl+2*dig));
if(is_buy)
sl_price = NormalizeDouble(entry_price - safe_sl_distance * point, digitsO);
else if(is_sell)
sl_price = NormalizeDouble(entry_price + safe_sl_distance * point, digitsO);
}
}
if(sl_price != 0 || tp_price != 0)
{
// First attempt
if(!OrderModify(tkt,entry_price,sl_price,tp_price,0,clrBlue))
{
abc_error=GetLastError();
}
}
} Dislikedi add these things for mates with bad brokers . . i never face it with swissQuote . . expect busy during hectic hours{image} so please if yoy face any error, posted here, for the sake of you, and the sake of all . .Ignored