Исходный код · ID 3655
ichimoku-chinkou-hyo_system_1.mq4
Вы автор или правообладатель?
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «ichimoku-chinkou-hyo_system_1.mq4» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
Поиск по коду файла
/*
Trades using Ichimoku Kinko Hyo indicator.
Implements Chinkou/Price cross strategy.
Chinkou crossing price (close) from below is a bullish signal.
Chinkou crossing price (close) from above is a bearish signal.
No SL/TP. Positions remain open from signal to signal.
Entry confirmed by current price above/below Kumo, latest Chinkou outside Kumo.
*/
input int kumoThreshold=300;//minimum size of kumo to open an order
input int failSafe=0;//0 is off, >0 sets the break even n pips above the entry price
input double failSafeCloserMultiplier=.1;//the amount of lots that are closed if failsafe is on
extern double orderStopLossRisk=.02;//stop loss %risk of account balance entered in decimal format
extern double Lots=0.1; // Basic lot size
extern bool MM=true; // If true - ATR-based position sizing
extern int ATR_Period=14;
extern double ATR_Multiplier=1;
extern double Risk=2; // Risk tolerance in percentage points
extern double FixedBalance=0; // If greater than 0, position size calculator will use it instead of actual account balance.
extern double MoneyRisk=0; // Risk tolerance in base currency
extern bool UseMoneyInsteadOfPercentage=false;
extern bool UseEquityInsteadOfBalance=false;
extern int LotDigits=2; // How many digits after dot supported in lot size. For example, 2 for 0.01, 1 for 0.1, 3 for 0.001, etc.
extern int Slippage=100; // Tolerated slippage in brokers' pips
int Magic=2130512104; // Order magic number
string OrderCommentary="Ichimoku-Chinkou-Hyo";
int Tenkan = 9; // Tenkan line period. The fast "moving average".
int Kijun = 26; // Kijun line period. The slow "moving average".
int Senkou= 52; // Senkou period. Used for Kumo (Cloud) spans.
int LastBars=0;
bool HaveLongPosition;
bool HaveShortPosition;
double StopLoss; // Not actual stop-loss - just a potential loss of MM estimation.
bool ChinkouPriceBull = false;
bool ChinkouPriceBear = false;
bool KumoBullConfirmation = false;
bool KumoBearConfirmation = false;
bool KumoChinkouBullConfirmation = false;
bool KumoChinkouBearConfirmation = false;
int init()
{
// код доступен только после оплаты
}
int deinit()
{
return(0);
}
int start()
{
// код доступен только после оплаты
}
if((!IsTradeAllowed()) || (IsTradeContextBusy()) || (!IsConnected()) || ((!MarketInfo(Symbol(), MODE_TRADEALLOWED)) && (!IsTesting()))) return(0);
if(LastBars!=Bars) LastBars=Bars;
else return(0);
if(MM)
{
StopLoss=iATR(NULL,0,ATR_Period,1)*ATR_Multiplier;
}
double ChinkouSpanLatest=iIchimoku(NULL,0,Tenkan,Kijun,Senkou,MODE_CHINKOUSPAN,Kijun+1); // Latest closed bar with Chinkou.
double ChinkouSpanPreLatest=iIchimoku(NULL,0,Tenkan,Kijun,Senkou,MODE_CHINKOUSPAN,Kijun+2); // Bar older than latest closed bar with Chinkou.
if((ChinkouSpanLatest>Close[Kijun+1]) && (ChinkouSpanPreLatest<=Close[Kijun+2]))
{
ChinkouPriceBull = true;
ChinkouPriceBear = false;
}
else if((ChinkouSpanLatest<Close[Kijun+1]) && (ChinkouSpanPreLatest>=Close[Kijun+2]))
{
ChinkouPriceBull = false;
ChinkouPriceBear = true;
}
else if(ChinkouSpanLatest==Close[Kijun+1]) // Voiding entry conditions if cross is ongoing.
{
ChinkouPriceBull = false;
ChinkouPriceBear = false;
}
double tenkanSen= iIchimoku(NULL,PERIOD_CURRENT,Tenkan,Kijun,Senkou,MODE_TENKANSEN,0);
double kijunSen = iIchimoku(NULL,PERIOD_CURRENT,Tenkan,Kijun,Senkou,MODE_KIJUNSEN,0);
double tenkanSenHist= iIchimoku(NULL,PERIOD_CURRENT,Tenkan,Kijun,Senkou,MODE_TENKANSEN,1);
double kijunSenHist = iIchimoku(NULL,PERIOD_CURRENT,Tenkan,Kijun,Senkou,MODE_KIJUNSEN,1);
double stopLoss1=0;
if(orderStopLossRisk>0) stopLoss1=NormalizeDouble((AccountBalance()*orderStopLossRisk)/LotsOptimized(),0);
double tenkanSen5=iIchimoku(NULL,PERIOD_CURRENT,Tenkan,Kijun,Senkou,MODE_TENKANSEN,1);
double slope=(tenkanSen-tenkanSen5)*1000;
int cnt;
int totally;
setLabel("Next lot size: "+LotsOptimized(),"Max Lot ",20,20,10,Black);
setLabel("Stop loss: "+stopLoss1,"stl ",20,40,10,Black);
setLabel("Risk: "+(orderStopLossRisk)*100+"% ","risk ",20,60,10,Black);
setLabel("Tenkan-Sen slope: "+slope,"tenkandigff ",20,120,10,Black);
setLabel("Chinkou Bull signal: "+ChinkouPriceBull,"chinkou bull sig ",200,20,10,Black);
setLabel("Chinkou Bear signal: "+ChinkouPriceBear,"chinkou bear sig ",200,40,10,Black);
setLabel("Kumo Bull Confirmation: "+KumoBullConfirmation,"kumo bull conf ",200,60,10,Black);
setLabel("Kumo Bear Confirmation: "+KumoBearConfirmation,"kumo bear conf ",200,80,10,Black);
setLabel("Kumo Chinkou Bull Confirmation: "+KumoChinkouBullConfirmation,"kumo chinkou bull conf ",200,100,10,Black);
setLabel("Kumo Chinkou Bear Confirmation: "+KumoChinkouBearConfirmation,"kumo chinkou bear conf ",200,120,10,Black);
if(failSafe>0) setLabel("Failsafe is ON ","failsafe ",20,80,10,Black);
else setLabel("Failsafe is OFF ","failsafe ",20,80,10,Black);
double SenkouSpanALatestByPrice = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANA, 1); // Senkou Span A at time of latest closed price bar.
double SenkouSpanBLatestByPrice = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANB, 1); // Senkou Span B at time of latest closed price bar.
if((Close[1]>SenkouSpanALatestByPrice) && (Close[1]>SenkouSpanBLatestByPrice)) KumoBullConfirmation=true;
else KumoBullConfirmation=false;
if((Close[1]<SenkouSpanALatestByPrice) && (Close[1]<SenkouSpanBLatestByPrice)) KumoBearConfirmation=true;
else KumoBearConfirmation=false;
double SenkouSpanALatestByChinkou = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANA, Kijun + 1); // Senkou Span A at time of latest closed bar of Chinkou span.
double SenkouSpanBLatestByChinkou = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANB, Kijun + 1); // Senkou Span B at time of latest closed bar of Chinkou span.
if((ChinkouSpanLatest>SenkouSpanALatestByChinkou) && (ChinkouSpanLatest>SenkouSpanBLatestByChinkou)) KumoChinkouBullConfirmation=true;
else KumoChinkouBullConfirmation=false;
if((ChinkouSpanLatest<SenkouSpanALatestByChinkou) && (ChinkouSpanLatest<SenkouSpanBLatestByChinkou)) KumoChinkouBearConfirmation=true;
else KumoChinkouBearConfirmation=false;
GetPositionStates();
double SenkouSpanALatestByPriceF = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANA, -25);
double SenkouSpanBLatestByPriceF = iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANB, -25);
double kumo=(SenkouSpanALatestByPriceF-SenkouSpanBLatestByPriceF)*1000;
setLabel("Kumo: "+kumo,"kumo label ",20,100,10,BПоказано первые 50% кода (символов: 10138)
Что вы получите после оплаты
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? Адрес передаётся вместе с заказом в магазин и сохраняется для связи заказа с оплатой. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.
Стоимость полного кода
1 014₽
≈ $11.91