//+------------------------------------------------------------------+ // AI Ichimoku…
- User
//+------------------------------------------------------------------+ //| AI Ichimoku Scalper.mq5 | //| Alfr5d | //| https://www.49design.co.za | //+------------------------------------------------------------------+
#property copyright "Copyright 2023, Alfred Mandala." #property description "www.billionairebulls.co.za\n" #property version "1.5" #property description "Ichimoku Scalping EA, TIMEFRAME = M5 \nLOW RISK SETTINGS"
#include <Trade/Trade.mqh>
// ---- INPUTS ---- input group "--- Trading Inputs ---"; input double Lots = 0.01; // Lot Size input int TpPoints = 50; // Take Profit in points [m5-50p, h1-200p] input ENUM_TIMEFRAMES IchimokuTimeFrame = PERIOD_CURRENT; // Timeframe (will use current timeframe)
// ---- Ichimoku Inputs ---- input int TenkanPeriod = 9; // Tenkan-sen Period input int KijunPeriod = 26; // Kijun-sen Period input int SenkouSpanBPeriod = 52; // Senkou Span B Period input int Displacement = 26; // Displacement
// ---- Stochastic Inputs ---- input int StochasticKPeriod = 14; // %K period input int StochasticDPeriod = 3; // %D period input int StochasticSlowing = 3; // Slowing for the Stochastic
// ---- Parabolic SAR Inputs ---- input double SARStep = 0.02; // Parabolic SAR Step input double SARMaximum = 0.2; // Parabolic SAR Maximum
// ---- GLOBAL VARIABLES ---- int handleIchimoku; int handleStochastic; int handleSAR; double Tenkan[], Kijun[], SenkouSpanA[], SenkouSpanB[], Chikou[]; double StochasticK[], StochasticD[]; double SAR[];
CTrade trade;
int barsTotal;
// ---- EXPERT INIT ----
int OnInit() { // Usando o timeframe atual handleIchimoku = iIchimoku(_Symbol, Period(), TenkanPeriod, KijunPeriod, SenkouSpanBPeriod); handleStochastic = iStochastic(_Symbol, Period(), StochasticKPeriod, StochasticDPeriod, StochasticSlowing, MODE_SMA, STO_LOWHIGH); handleSAR = iSAR(_Symbol, Period(), SARStep, SARMaximum);
return(INIT_SUCCEEDED); }
// ---- EXPERT DEINIT ----
void OnDeinit(const int reason) { IndicatorRelease(handleIchimoku); IndicatorRelease(handleStochastic); IndicatorRelease(handleSAR); }
// ---- ON TICK FUNCTION ----
void OnTick() { int bars = iBars(_Symbol, Period()); if(barsTotal != bars) { barsTotal = bars;
double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID); double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
// Copiar os dados do Ichimoku CopyBuffer(handleIchimoku, 0, 0, 1, Tenkan); // Tenkan-sen CopyBuffer(handleIchimoku, 1, 0, 1, Kijun); // Kijun-sen CopyBuffer(handleIchimoku, 2, 0, 1, SenkouSpanA); // Senkou Span A CopyBuffer(handleIchimoku, 3, 0, 1, SenkouSpanB); // Senkou Span B CopyBuffer(handleIchimoku, 4, 0, 1, Chikou); // Chikou Span
- Assistant
- User
- Assistant