Hello,
I am using simple RSI + BollingerBands to find reversal and take a trade. i am not using any Take Profit or StopLoss defined directly in Order or defined in Point/Pips instead i am using Indicator to calculate When to close trade in profit (Take Profit similar) but the problem is i am confused about when to close the trade in loss (Stop Loss Similar).
Entry :
Take Profit (With Indicator) :
Take profit working amazing.
StopLoss (With Indicator) : ??? - I am unable to understand this part. when should i close the trade at loss?. Need suggestion.
I am using simple RSI + BollingerBands to find reversal and take a trade. i am not using any Take Profit or StopLoss defined directly in Order or defined in Point/Pips instead i am using Indicator to calculate When to close trade in profit (Take Profit similar) but the problem is i am confused about when to close the trade in loss (Stop Loss Similar).
Entry :
MQL4:
//fRSI, fBands is seperate function double RSI_Value = fRSI(rSymbol, SelectedTimeFrame, RSI_Period, PRICE_CLOSE, 1); double BB_UpperBand_ResistanceLine = fBands(rSymbol, SelectedTimeFrame, BollingerBands_Period, BollingerBands_deviation, 0, PRICE_CLOSE, MODE_UPPER, 1); double BB_LowerBand_SupportLine = fBands(rSymbol, SelectedTimeFrame, BollingerBands_Period, BollingerBands_deviation, 0, PRICE_CLOSE, MODE_LOWER, 1); double HighPrice = iHigh(rSymbol, SelectedTimeFrame, 1); double LowPrice = iLow(rSymbol, SelectedTimeFrame, 1); if(RSI_Value < RSI_BelowLevel && LowPrice < BB_LowerBand_SupportLine) NewOrderSend(); else if(RSI_Value > RSI_AboveLevel && HighPrice > BB_UpperBand_ResistanceLine) NewOrderSend();
Take Profit (With Indicator) :
MQL4:
void TPClosing() { double BB_Upper_Resistance=0, BB_Lower_Support=0, BB_Middle=0; for(int i = OrdersTotal() - 1; i >= 0; i--) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderMagicNumber() == Magic) { ENUM_TIMEFRAMES CandlePeriod = GetTimeframeFromComment(OrderComment()); double fBID = SymbolInfoDouble(OrderSymbol(),SYMBOL_BID); //RSI Closing (Take Profit) if(RSI_Closing) { double RSI_Value = fRSI(OrderSymbol(), CandlePeriod, RSI_Period, PRICE_CLOSE, 1); if( (OrderType() == OP_BUY && fBID > OrderOpenPrice() && RSI_Value >= RSI_AboveLevel) || (OrderType() == OP_SELL && fBID < OrderOpenPrice() && RSI_Value <= RSI_BelowLevel) ) { ResetLastError(); if(!OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 3, clrNONE)) Print(__FUNCTION__, " => RSI => Order ", OrderTicket(), " Failed to Close. Error: ", GetLastError()); else { Print(__FUNCTION__, " => RSI => Order ", OrderTicket(), " Successfully Closed"); continue; } } } //BB Closing (Take Profit) if(BollingerBands_Closing != BB_Deactivated) { if(BollingerBands_Closing == BBBands) { BB_Upper_Resistance = fBands(OrderSymbol(), CandlePeriod, BollingerBands_Period, BollingerBands_deviation, 0, PRICE_CLOSE, MODE_UPPER, 1); BB_Lower_Support = fBands(OrderSymbol(), CandlePeriod, BollingerBands_Period, BollingerBands_deviation, 0, PRICE_CLOSE, MODE_LOWER, 1); } if(BollingerBands_Closing == MiddleBand) BB_Middle = fBands(OrderSymbol(), CandlePeriod, BollingerBands_Period, BollingerBands_deviation, 0, PRICE_CLOSE, MODE_MAIN, 1); if( (OrderType() == OP_BUY && fBID > OrderOpenPrice() && ((BollingerBands_Closing == BBBands && fBID >= BB_Upper_Resistance) || (BollingerBands_Closing == MiddleBand && fBID >= BB_Middle))) || (OrderType() == OP_SELL && fBID < OrderOpenPrice() && ((BollingerBands_Closing == BBBands && fBID <= BB_Lower_Support) || (BollingerBands_Closing == MiddleBand && fBID <= BB_Middle))) ) { ResetLastError(); if(!OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 3, clrNONE)) Print(__FUNCTION__, " => BB => Order ", OrderTicket(), " Failed to Close. Error: ", GetLastError()); else { Print(__FUNCTION__, " => BB => Order ", OrderTicket(), " Successfully Closed"); continue; } } } }
Take profit working amazing.
StopLoss (With Indicator) : ??? - I am unable to understand this part. when should i close the trade at loss?. Need suggestion.
Last edited by a moderator: