MnQInvestmentDevelopment/MnQInvestment/04_Tutorials/HiLoAveragePrice.mq5

35 lines
799 B
MQL5
Raw Permalink Normal View History

2025-05-30 15:08:44 +02:00
void OnTick()
{
int HighestCandle, LowestCandle;
double High[], Low[];
ArraySetAsSeries(High,true);
ArraySetAsSeries(Low,true);
CopyHigh(_Symbol,PERIOD_CURRENT,0,10,High);
CopyLow(_Symbol,PERIOD_CURRENT,0,10,Low);
HighestCandle = ArrayMaximum(High,0,WHOLE_ARRAY);
LowestCandle = ArrayMinimum(Low,0,WHOLE_ARRAY);
//create Array for Prices
MqlRates Priceinformation[];
//sort it from current to oldest candle
ArraySetAsSeries(Priceinformation, true);
//copy data into array
int Data = CopyRates(_Symbol, PERIOD_CURRENT, 0, Bars(_Symbol,PERIOD_CURRENT),Priceinformation);
//tutorial nicht gefinnished, ab hier wirds dann normal mit variablen und so ausgerechnet
}