0% found this document useful (1 vote)
205 views2 pages

ICTBOT

turtle soup bot mt5

Uploaded by

Erion
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
205 views2 pages

ICTBOT

turtle soup bot mt5

Uploaded by

Erion
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//+------------------------------------------------------------------+

//| TurtleSoup.mq5|
//| Copyright 2024, MetaQuotes Software Corp. |
//| ICT Strategy|
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
CTrade trade;

// Input parameters
input double LotSize = 1.0; // Lot size
input double RiskRewardRatio = 5.0; // Risk-Reward Ratio
input int LookBackPeriod = 20; // Look-back period for support/resistance

// Global variables
double stopLoss;
double takeProfit;

//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// Initialization code
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
// Cleanup code
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// Check for new bar
static datetime lastTime = 0;
if (lastTime == iTime(Symbol(), PERIOD_M5, 0))
return;
lastTime = iTime(Symbol(), PERIOD_M5, 0);

// Define Bid and Ask if not predefined


double Bid = SymbolInfoDouble(Symbol(), SYMBOL_BID);
double Ask = SymbolInfoDouble(Symbol(), SYMBOL_ASK);

// Identify key levels


double supportLevel = iLow(Symbol(), PERIOD_M5, iLowest(Symbol(), PERIOD_M5,
MODE_LOW, LookBackPeriod, 1));
double resistanceLevel = iHigh(Symbol(), PERIOD_M5, iHighest(Symbol(),
PERIOD_M5, MODE_HIGH, LookBackPeriod, 1));

// Check for false breakout and trade entry conditions


if (iHigh(Symbol(), PERIOD_M5, 1) > resistanceLevel && iClose(Symbol(),
PERIOD_M5, 1) < resistanceLevel)
{
// False breakout above resistance - enter sell trade
stopLoss = resistanceLevel + 10 * _Point;
takeProfit = Bid - (RiskRewardRatio * (stopLoss - Bid));
trade.Sell(LotSize, Symbol(), Bid, stopLoss, takeProfit, NULL);
}
else if (iLow(Symbol(), PERIOD_M5, 1) < supportLevel && iClose(Symbol(),
PERIOD_M5, 1) > supportLevel)
{
// False breakout below support - enter buy trade
stopLoss = supportLevel - 10 * _Point;
takeProfit = Ask + (RiskRewardRatio * (Ask - stopLoss));
trade.Buy(LotSize, Symbol(), Ask, stopLoss, takeProfit, NULL);
}
}
//+------------------------------------------------------------------+

You might also like