Sma Tenken Sell
Sma Tenken Sell
Sma Tenken Sell
Tenkan-sen chizig'i asosida sell savdo signaliga asoslangan avtomat robot (Expert
Advisor) yaratish uchun MQL4 dasturlash tilidan foydalanish kerak. Quyidagi
kodni o'z ichiga olgan faylni yaratib, MT4 platformasiga yuklashingiz mumkin:
cpp
Копировать код
//+------------------------------------------------------------------+
//| SellRobot.mq4|
//| Copyright 2024, MetaQuotes Software Corp. |
//| https://www.metaquotes.net|
//+------------------------------------------------------------------+
#property strict
// Input parameters
input double Lots = 0.1; // Lot size
input int Slippage = 3; // Maximum slippage
input double StopLoss = 50; // Stop loss in points
input double TakeProfit = 100; // Take profit in points
// Indicator parameters
input int SMA_Period = 200; // Period for SMA
input int TenkanSen_Period = 9; // Period for Tenkan-sen
int OnInit()
{
//--- SMA initialization
SetIndexBuffer(0, SMA);
ArraySetAsSeries(SMA, true);
IndicatorBuffers(1);
IndicatorShortName("SMA 200");
return(INIT_SUCCEEDED);
}
return(rates_total);
}
void OnTick()
{
// Check if we have enough bars
if (Bars < SMA_Period || Bars < TenkanSen_Period)
return;
Our AI sidebar -- Sider assists you skim through papers 10X faster using its
10+ one-click research tools like deep reader, advanced search, ChatPDF, and
context selection.
Get ready for a smarter academic experience!