diff --git a/.gitignore b/.gitignore index 4e8aed930..f2b32336d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,3 @@ logs/ # Ignores Finder metadata files on Mac .DS_Store - diff --git a/BasicTrade.mqh b/BasicTrade.mqh old mode 100755 new mode 100644 diff --git a/Buffer.mqh b/Buffer.mqh index f38b8d588..cf943578b 100644 --- a/Buffer.mqh +++ b/Buffer.mqh @@ -107,4 +107,4 @@ class Buffer : public Dict { return (T)median; } }; -#endif // BUFFER_MQH \ No newline at end of file +#endif // BUFFER_MQH diff --git a/BufferStruct.mqh b/BufferStruct.mqh index 2b0134d27..dd6dcdfe8 100644 --- a/BufferStruct.mqh +++ b/BufferStruct.mqh @@ -92,4 +92,4 @@ class BufferStruct : public DictStruct { } }; -#endif // BUFFER_STRUCT_MQH \ No newline at end of file +#endif // BUFFER_STRUCT_MQH diff --git a/Chart.mqh b/Chart.mqh index f5deb9176..d36532483 100644 --- a/Chart.mqh +++ b/Chart.mqh @@ -229,10 +229,10 @@ class Chart : public Market { // Variables. datetime last_bar_time; - + // Current tick index (incremented every OnTick()). int tick_index; - + // Current bar index (incremented every OnTick() if IsNewBar() is true). int bar_index; @@ -277,7 +277,7 @@ class Chart : public Market { */ ~Chart() { } - + long GetId() { return ChartID(); } @@ -549,7 +549,7 @@ class Chart : public Market { case PRICE_WEIGHTED: return (h + l + c + c) / 4; } - + return EMPTY_VALUE; } @@ -1061,18 +1061,18 @@ class Chart : public Market { bool IsPeak() { return IsPeak(cparams.tf, symbol); } - + /** * Acknowledges chart that new tick happened. */ virtual void OnTick() { ++tick_index; - + if (GetLastBarTime() != GetBarTime()) { ++bar_index; } } - + /** * Returns current tick index (incremented every OnTick()). */ diff --git a/Condition.mqh b/Condition.mqh index 8184ef082..cb644d373 100644 --- a/Condition.mqh +++ b/Condition.mqh @@ -377,4 +377,4 @@ class Condition { /* Setters */ }; -#endif // CONDITION_MQH \ No newline at end of file +#endif // CONDITION_MQH diff --git a/Config.mqh b/Config.mqh index dd472e37c..ba680cc16 100644 --- a/Config.mqh +++ b/Config.mqh @@ -42,7 +42,7 @@ enum CONFIG_FORMAT { string ToJSON(const MqlParam& param, bool, int) { switch (param.type) { case TYPE_BOOL: - //boolean + //boolean return JSON::ValueToString((bool)param.integer_value); case TYPE_INT: return JSON::ValueToString((int)param.integer_value); @@ -81,12 +81,12 @@ public: bool operator== (const ConfigEntry& _s) { return type == _s.type && double_value == _s.double_value && integer_value == _s.integer_value && string_value == _s.string_value; } - + JsonNodeType Serialize(JsonSerializer& s) { s.PassEnum(this, "type", type); - + string aux_string; - + switch (type) { case TYPE_BOOL: case TYPE_UCHAR: @@ -99,15 +99,15 @@ public: case TYPE_LONG: s.Pass(this, "value", integer_value); break; - + case TYPE_DOUBLE: s.Pass(this, "value", double_value); break; - + case TYPE_STRING: s.Pass(this, "value", string_value); break; - + case TYPE_DATETIME: if (s.IsWriting()) { aux_string = TimeToString(integer_value); @@ -119,7 +119,7 @@ public: } break; } - + return JsonNodeObject; } }; @@ -130,7 +130,7 @@ class Config : public DictStruct { File *file; public: - + /** * Class constructor. */ @@ -139,7 +139,7 @@ class Config : public DictStruct { file = new File(); } } - + bool Set(string key, bool value) { ConfigEntry param = {TYPE_BOOL, 0, 0, ""}; param.integer_value = value; @@ -205,13 +205,13 @@ class Config : public DictStruct { } string data = ""; - + while (!FileIsEnding(handle)) { data += FileReadString(handle) + "\n"; } - + FileClose(handle); - + if (format == CONFIG_FORMAT_JSON || format == CONFIG_FORMAT_JSON_NO_WHITESPACES) { if (!JSON::Parse(data, this)) { Print("Cannot parse JSON!"); @@ -219,11 +219,11 @@ class Config : public DictStruct { } } else if (format == CONFIG_FORMAT_INI) { // @todo - } + } return true; } - + /** * Save config into the file. */ @@ -231,7 +231,7 @@ class Config : public DictStruct { ResetLastError(); int handle = FileOpen(path, FILE_WRITE | FILE_ANSI); - + if (handle == INVALID_HANDLE) { string terminalDataPath = TerminalInfoString(TERMINAL_DATA_PATH); #ifdef __MQL5__ @@ -242,7 +242,7 @@ class Config : public DictStruct { Print("Cannot open file \"", path , "\" for writing. Error code: ", GetLastError(), ". Consider using path relative to \"" + terminalDataPath + "\\" + terminalSubfolder + "\\Files\\\" as absolute paths may not work."); return false; } - + string text = JSON::Stringify(this); FileWriteString(handle, text); diff --git a/Convert.mqh b/Convert.mqh index 997bd3067..ec7521568 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -302,12 +302,12 @@ public: ArrayResize(output, len/4); } for (i = 0, j = 0; j < len; i++, j += 4) { - output[i] = (StringGetCharacter(in, j)) | ((StringGetCharacter(in, j + 1)) << 8) + output[i] = (StringGetCharacter(in, j)) | ((StringGetCharacter(in, j + 1)) << 8) | ((StringGetCharacter(in, j+2)) << 16) | ((StringGetCharacter(in, j + 3)) << 24); } return (len / 4); } - + static void StringToType(string value, bool& out) { out = value != "" && value != NULL && value != "0" && value != "false"; } @@ -327,7 +327,7 @@ public: static void StringToType(string value, string& out) { out = value; } - + /** * Converts MqlParam struct to double. */ diff --git a/Dict.mqh b/Dict.mqh index 58a63149b..db33e1a79 100644 --- a/Dict.mqh +++ b/Dict.mqh @@ -71,14 +71,14 @@ class Dict : public DictBase { _current_id = right._current_id; _mode = right._mode; } - + void operator=(const Dict& right) { Resize(right.GetSlotCount()); for (unsigned int i = 0; i < (unsigned int)ArraySize(right._DictSlots_ref.DictSlots); ++i) { _DictSlots_ref.DictSlots[i] = right._DictSlots_ref.DictSlots[i]; } _current_id = right._current_id; - _mode = right._mode; + _mode = right._mode; } /** diff --git a/DictBase.mqh b/DictBase.mqh index 5757cf033..e8c4ae557 100644 --- a/DictBase.mqh +++ b/DictBase.mqh @@ -130,7 +130,7 @@ struct DictSlotsRef { // Incremental index for dict operating in list mode. unsigned int _list_index; - + unsigned int _num_used; DictSlotsRef() { _list_index = 0; _num_used = 0; } @@ -246,7 +246,7 @@ class DictBase { // Nothing to unset. return; } - + unsigned int position = Hash(key) % ArraySize(_DictSlots_ref.DictSlots); unsigned int tries_left = ArraySize(_DictSlots_ref.DictSlots); @@ -368,4 +368,4 @@ class DictBase { unsigned int Hash(float x) { return (unsigned int)((unsigned long)x * 10000 % 10000); } }; -#endif \ No newline at end of file +#endif diff --git a/DictObject.mqh b/DictObject.mqh index e11bf2c47..314dc1229 100644 --- a/DictObject.mqh +++ b/DictObject.mqh @@ -81,7 +81,7 @@ class DictObject : public DictBase { _DictSlots_ref.DictSlots[i] = right._DictSlots_ref.DictSlots[i]; } _current_id = right._current_id; - _mode = right._mode; + _mode = right._mode; } /** @@ -271,4 +271,4 @@ class DictObject : public DictBase { } }; -#endif \ No newline at end of file +#endif diff --git a/DictStruct.mqh b/DictStruct.mqh index 1201a8c32..c83905e57 100644 --- a/DictStruct.mqh +++ b/DictStruct.mqh @@ -56,14 +56,14 @@ class DictStruct : public DictBase { _current_id = right._current_id; _mode = right._mode; } - + void operator=(const DictStruct& right) { Resize(right.GetSlotCount()); for (unsigned int i = 0; i < (unsigned int)ArraySize(right._DictSlots_ref.DictSlots); ++i) { _DictSlots_ref.DictSlots[i] = right._DictSlots_ref.DictSlots[i]; } _current_id = right._current_id; - _mode = right._mode; + _mode = right._mode; } DictStructIterator Begin() { @@ -293,4 +293,4 @@ class DictStruct : public DictBase { } }; -#endif \ No newline at end of file +#endif diff --git a/EA.mqh b/EA.mqh index 479f9fbcd..f22f48032 100644 --- a/EA.mqh +++ b/EA.mqh @@ -206,7 +206,7 @@ class EA { Object::Delete(trade); for (DictObjectIterator> iter1 = strats.Begin(); iter1.IsValid(); ++iter1) { - for (DictIterator iter2 = iter1.Value().Begin(); iter2.IsValid(); ++iter2) { + for (DictIterator iter2 = iter1.Value().Begin(); iter2.IsValid(); ++iter2) { Object::Delete(iter2.Value()); } } diff --git a/Indicators/Indi_Bands.mqh b/Indicators/Indi_Bands.mqh index 6e5729f8c..6bc73c7bd 100644 --- a/Indicators/Indi_Bands.mqh +++ b/Indicators/Indi_Bands.mqh @@ -118,14 +118,14 @@ class Indi_Bands : public Indicator { /** * Calculates Bands on another indicator. * - * When _applied_price is set to -1, method will + * When _applied_price is set to -1, method will */ static double iBandsOnIndicator( Indicator *_indi, string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, double _deviation, int _bands_shift, ENUM_BANDS_LINE _mode = BAND_BASE, // (MT4/MT5): 0 - MODE_MAIN/BASE_LINE, 1 - // MODE_UPPER/UPPER_BAND, 2 - MODE_LOWER/LOWER_BAND int _shift = 0, Indicator *_obj = NULL) { - + double _indi_value_buffer[]; double _std_dev; double _line_value; @@ -135,12 +135,12 @@ class Indi_Bands : public Indicator { for (int i = _bands_shift; i < (int)_period; i++) { int current_shift = _shift + (i - _bands_shift); // Getting current indicator value. - _indi_value_buffer[i - _bands_shift] = _indi[i - _bands_shift].value.GetValueDbl(_indi.GetIDataType()); + _indi_value_buffer[i - _bands_shift] = _indi[i - _bands_shift].value.GetValueDbl(_indi.GetIDataType()); } // Base band. _line_value = Indi_MA::SimpleMA(_shift, _period, _indi_value_buffer); - + // Standard deviation. _std_dev = Indi_StdDev::iStdDevOnArray(_indi_value_buffer, _line_value, _period); @@ -156,39 +156,39 @@ class Indi_Bands : public Indicator { return EMPTY_VALUE; } - + static double iBandsOnArray(double& array[], int total, int period, double deviation, int bands_shift, int mode, int shift) { - #ifdef __MQL5__ + #ifdef __MQL5__ Indi_PriceFeeder price_feeder(array); return iBandsOnIndicator(&price_feeder, NULL, NULL, period, deviation, bands_shift, (ENUM_BANDS_LINE)mode, shift); #else return ::iBandsOnArray(array, total, period, deviation, bands_shift, mode, shift); #endif } - + static double iBandsOnArray2(double& array[], int total, int period, double deviation, int bands_shift, int mode, int shift) { - #ifdef __MQL5__ + #ifdef __MQL5__ // Calculates bollinger bands indicator from array data int size = ArraySize(array); if (size < period) return false; if (period <= 0) return false; - + double ma = Indi_MA::iMAOnArray(array, total, period, 0, MODE_SMA, 0); - + double sum = 0.0, val; int i; - + for (i = 0; i < period; i++) { val = array[size - i - 1] - ma; sum += val * val; } - + double dev = deviation * MathSqrt(sum / period); - + switch (mode) { case BAND_BASE: return ma; diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 8b27c9c8c..e153d76e0 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -105,7 +105,7 @@ class Indi_CCI : public Indicator { for (i = _shift; i < (int)_shift + (int)_period; i++) { if (!_indi.GetValueDouble4(i, o, h, c, l)) return 0; - + _indi_value_buffer[i - _shift] = Chart::GetAppliedPrice(_applied_price, o, h, c, l); } diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index e369a769f..988e77e4e 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -104,7 +104,7 @@ class Indi_StdDev : public Indicator { return _res[0]; #endif } - + /** * Note that this method operates on current price (set by _applied_price). */ @@ -121,7 +121,7 @@ class Indi_StdDev : public Indicator { // the graph, so we need to take that shift into consideration. _indi_value_buffer[i - _shift] = _indi.GetValueDouble(i + _ma_shift, _obj != NULL ? _obj.GetParams().indi_mode : NULL); } - + double _ma = Indi_MA::SimpleMA(_shift, _ma_period, _indi_value_buffer); // Standard deviation. diff --git a/JSON.mqh b/JSON.mqh index 1b19b4fcd..380197b68 100644 --- a/JSON.mqh +++ b/JSON.mqh @@ -344,4 +344,4 @@ class JSON { } }; -#endif \ No newline at end of file +#endif diff --git a/JsonIterator.mqh b/JsonIterator.mqh index 2a4529799..423eba50d 100644 --- a/JsonIterator.mqh +++ b/JsonIterator.mqh @@ -104,4 +104,4 @@ class JsonIterator { JsonNodeType ParentNodeType() { return _collection.GetType(); } }; -#endif \ No newline at end of file +#endif diff --git a/JsonNode.mqh b/JsonNode.mqh index 054a052a0..0a4be04cb 100644 --- a/JsonNode.mqh +++ b/JsonNode.mqh @@ -190,4 +190,4 @@ class JsonNode { } }; -#endif \ No newline at end of file +#endif diff --git a/JsonParam.mqh b/JsonParam.mqh index ecc0f6d57..b2bb681d1 100644 --- a/JsonParam.mqh +++ b/JsonParam.mqh @@ -140,4 +140,4 @@ class JsonParam { JsonParamType GetType() { return _type; } }; -#endif \ No newline at end of file +#endif diff --git a/JsonSerializer.mqh b/JsonSerializer.mqh index 284b0f299..1ffc676d7 100644 --- a/JsonSerializer.mqh +++ b/JsonSerializer.mqh @@ -239,4 +239,4 @@ class JsonSerializer { } }; -#endif \ No newline at end of file +#endif diff --git a/MD5.mqh b/MD5.mqh index a8c310956..626fd1617 100644 --- a/MD5.mqh +++ b/MD5.mqh @@ -72,7 +72,7 @@ class MD5 { } for (k = 0; k < last_num; k++) { - last_char[k] = StringGetCharacter(str, i * 64 + count + k); + last_char[k] = StringGetCharacter(str, i * 64 + count + k); } } last_char[k] = 0x80; @@ -89,19 +89,19 @@ class MD5 { return result; } - static long F(long x, long y, long z) { - return ((x & y) | ((~x) & z)); + static long F(long x, long y, long z) { + return ((x & y) | ((~x) & z)); } - static long G(long x, long y, long z) { - return ((x & z) | (y & (~z))); + static long G(long x, long y, long z) { + return ((x & z) | (y & (~z))); } - static long H(long x, long y, long z) { + static long H(long x, long y, long z) { return ((x ^ y ^ z)); } - static long I(long x, long y, long z) { + static long I(long x, long y, long z) { return ((y ^ (x | (~z)))); } @@ -134,7 +134,7 @@ class MD5 { * Implementation of right shift operation for unsigned int. * See: http://www.cnblogs.com/niniwzw/archive/2009/12/04/1617130.html */ - static long RotateLeft(long lValue, int iShiftBits) { + static long RotateLeft(long lValue, int iShiftBits) { if (iShiftBits == 32) return (lValue); long result = (lValue << iShiftBits) | (((lValue >> 1) & 0x7fffffff) >> (31 - iShiftBits)); return (result); diff --git a/Market.mqh b/Market.mqh index 2aad14ea2..29cf54161 100644 --- a/Market.mqh +++ b/Market.mqh @@ -618,4 +618,4 @@ public: } }; -#endif // MARKET_MQH \ No newline at end of file +#endif // MARKET_MQH diff --git a/Orders.mqh b/Orders.mqh index 5ee422441..40992edea 100644 --- a/Orders.mqh +++ b/Orders.mqh @@ -106,7 +106,7 @@ class Orders { */ ~Orders() { delete logger; - + for (int i = 0; i < ArraySize(orders); ++i) delete orders[i]; } diff --git a/SVG.mqh b/SVG.mqh index c200e5f80..521a40937 100644 --- a/SVG.mqh +++ b/SVG.mqh @@ -44,6 +44,6 @@ public: else Print("File open failed, error ",GetLastError()); } - + }; diff --git a/Strategy.mqh b/Strategy.mqh index 6f2241b3a..426b2c096 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -230,7 +230,7 @@ class Strategy : public Object { EA_STATS_TOTAL, FINAL_ENUM_STRATEGY_STATS_PERIOD }; - + // Structs. protected: diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index e35ec11c5..0a1d35cf5 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -159,7 +159,7 @@ class SymbolInfo : public Terminal { // @todo? // Overriding Ask variable to become a function call. - // #ifdef __MQL5__ #define Ask Market::Ask() #endif // @fixme + // #ifdef __MQL5__ #define Ask Market::Ask() #endif // @fixme } /** diff --git a/Task.mqh b/Task.mqh index 319193a33..ab0f99362 100644 --- a/Task.mqh +++ b/Task.mqh @@ -319,4 +319,4 @@ class Task { /* Other methods */ }; -#endif // TASK_MQH \ No newline at end of file +#endif // TASK_MQH diff --git a/tests/ActionTest.mq4 b/tests/ActionTest.mq4 index ec52d1fa6..15f69b690 100644 --- a/tests/ActionTest.mq4 +++ b/tests/ActionTest.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "ActionTest.mq5" \ No newline at end of file +#include "ActionTest.mq5" diff --git a/tests/ActionTest.mq5 b/tests/ActionTest.mq5 index 580344f05..f214fca58 100644 --- a/tests/ActionTest.mq5 +++ b/tests/ActionTest.mq5 @@ -85,7 +85,7 @@ int OnInit() { assertTrueOrReturnFalse(ea.Condition(EA_COND_IS_ENABLED), "Wrong condition: EA_COND_IS_ENABLED!"); delete action2; _result &= GetLastError() == ERR_NO_ERROR; - + return (_result ? INIT_SUCCEEDED : INIT_FAILED); } @@ -112,4 +112,4 @@ void OnTick() { /** * Implements Deinit event handler. */ -void OnDeinit(const int reason) { delete chart; delete ea; } \ No newline at end of file +void OnDeinit(const int reason) { delete chart; delete ea; } diff --git a/tests/BufferStructTest.mq5 b/tests/BufferStructTest.mq5 index acd932e49..c7b545fbd 100644 --- a/tests/BufferStructTest.mq5 +++ b/tests/BufferStructTest.mq5 @@ -69,4 +69,4 @@ void OnTick() {} /** * Implements OnDeinit(). */ -void OnDeinit(const int reason) {} \ No newline at end of file +void OnDeinit(const int reason) {} diff --git a/tests/BufferTest.mq4 b/tests/BufferTest.mq4 index 6bab98da2..63710218c 100644 --- a/tests/BufferTest.mq4 +++ b/tests/BufferTest.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "BufferTest.mq5" \ No newline at end of file +#include "BufferTest.mq5" diff --git a/tests/BufferTest.mq5 b/tests/BufferTest.mq5 index 1f42a2ab3..cc89d0dd4 100644 --- a/tests/BufferTest.mq5 +++ b/tests/BufferTest.mq5 @@ -69,4 +69,4 @@ void OnTick() {} /** * Implements OnDeinit(). */ -void OnDeinit(const int reason) {} \ No newline at end of file +void OnDeinit(const int reason) {} diff --git a/tests/ConditionTest.mq4 b/tests/ConditionTest.mq4 index fc7b18bbd..932f64e21 100644 --- a/tests/ConditionTest.mq4 +++ b/tests/ConditionTest.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "ConditionTest.mq5" \ No newline at end of file +#include "ConditionTest.mq5" diff --git a/tests/ConditionTest.mq5 b/tests/ConditionTest.mq5 index c47f88968..e86b44b00 100644 --- a/tests/ConditionTest.mq5 +++ b/tests/ConditionTest.mq5 @@ -189,4 +189,4 @@ bool TestTradeConditions() { delete _cond; delete _trade; return _result; -} \ No newline at end of file +} diff --git a/tests/DictTest.mq5 b/tests/DictTest.mq5 index ff020ee41..8f1fa1398 100644 --- a/tests/DictTest.mq5 +++ b/tests/DictTest.mq5 @@ -210,9 +210,9 @@ int OnInit() { assertTrueOrFail(dict10.Set(i, i), "Cannot insert value into Dict (by Set()). Probably a bug in Resize() method!"); } Print("dict10: ", JSON::Stringify(dict10)); - + assertTrueOrFail(dict10.Size() == 100, "Wrong values count!"); - + for (i = 0; i < 100; ++i) { assertTrueOrFail(dict10.GetByKey(i) == i, "Wrong value found!"); } @@ -223,7 +223,7 @@ int OnInit() { assertTrueOrFail(dict11.Push(i), "Cannot insert value into Dict (by Set()). Probably a bug in Resize() method!"); } Print("dict11: ", JSON::Stringify(dict11)); - + assertTrueOrFail(dict11.Size() == 100, "Wrong values count!"); for (i = 0; i < 100; ++i) { diff --git a/tests/IndicatorDataTest.mq4 b/tests/IndicatorDataTest.mq4 index c1e232207..fc48cafe4 100644 --- a/tests/IndicatorDataTest.mq4 +++ b/tests/IndicatorDataTest.mq4 @@ -216,4 +216,3 @@ int OnCalculate(const int rates_total, return(rates_total); } - diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index b0f54dc4c..9864ef4db 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -91,7 +91,7 @@ int OnInit() { _result &= PrintIndicators(__FUNCTION__); assertTrueOrFail(GetLastError() == ERR_NO_ERROR, StringFormat("Error: %d", GetLastError())); bar_processed = 0; - + return (_result && _LastError == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED); } @@ -100,7 +100,7 @@ int OnInit() { */ void OnTick() { chart.OnTick(); - + if (chart.IsNewBar()) { bar_processed++; if (indis.Size() == 0) { @@ -111,7 +111,7 @@ void OnTick() { // Indicator is already tested, skipping. continue; } - + Indicator *_indi = iter.Value(); _indi.OnTick(); IndicatorDataEntry _entry = _indi.GetEntry(); @@ -139,7 +139,7 @@ void OnDeinit(const int reason) { assertTrueOrExit(num_not_tested == 0, "Not all indicators has been tested!"); delete chart; - + for (DictIterator iter = indis.Begin(); iter.IsValid(); ++iter) { delete iter.Value(); } @@ -162,7 +162,7 @@ bool InitIndicators() { ADXParams adx_params(14, PRICE_HIGH); indis.Set(INDI_ADX, new Indi_ADX(adx_params)); - // ADX by Welles Wilder (ADXW + // ADX by Welles Wilder (ADXW // @todo INDI_ADXW // Alligator. @@ -328,7 +328,7 @@ bool InitIndicators() { stddev_params_on_ma_sma.SetDraw(true, 1); stddev_params_on_ma_sma.SetIndicatorData(indi_ma_sma_for_stddev); stddev_params_on_ma_sma.SetIndicatorMode(0); - indis.Set(INDI_STDDEV_ON_MA_SMA, new Indi_StdDev(stddev_params_on_ma_sma)); + indis.Set(INDI_STDDEV_ON_MA_SMA, new Indi_StdDev(stddev_params_on_ma_sma)); // Standard Deviation (StdDev) in SMA mode over Price. PriceIndiParams price_params_for_stddev_sma(); @@ -377,7 +377,7 @@ bool InitIndicators() { mom_on_price_params.SetIndicatorData(indi_price_4_momentum); mom_on_price_params.SetDraw(clrDarkCyan); indis.Set(INDI_MOMENTUM_ON_PRICE, new Indi_Momentum(mom_on_price_params)); - + // Relative Strength Index (RSI) over Price indicator. PriceIndiParams price_params_4_rsi(); Indicator* indi_price_4_rsi = new Indi_Price(price_params_4_rsi); @@ -392,7 +392,7 @@ bool InitIndicators() { if (iter.Key() != INDI_RSI && iter.Key() != INDI_RSI_ON_PRICE) tested.Set(iter.Key(), false); } - + return GetLastError() == ERR_NO_ERROR; } @@ -729,16 +729,16 @@ bool TestCCI() { cci.SetPeriod(cci.GetPeriod()+1); // Clean up. delete cci; - + double cci_on_array_1 = Indi_CCI::iCCIOnArray(test_values, 0, 13, 2); - + assertTrueOrReturn( cci_on_array_1 >= 233.5937 && cci_on_array_1 < 233.5938, "Wrong result of iCCIOnArray. Expected ~233.5937!", false); - + double cci_on_array_2 = Indi_CCI::iCCIOnArray(test_values, 0, 13, 0); - + assertTrueOrReturn( cci_on_array_2 >= 155.7825 && cci_on_array_2 < 155.7826, "Wrong result of iCCIOnArray. Expected ~155.7825, got " + DoubleToString(cci_on_array_2) + "!", @@ -810,7 +810,7 @@ bool TestEnvelopes() { _entry.value.GetValueDbl(params.idvtype, LINE_UPPER) == env_value, "Envelopes value does not match!", false); - + assertTrueOrReturn( _entry.value.GetValueDbl(params.idvtype, LINE_LOWER) == env.GetValue(LINE_LOWER), "Envelopes LINE_LOWER value does not match!", diff --git a/tests/OrderTest.mq5 b/tests/OrderTest.mq5 index d054b4236..6403a6a6c 100644 --- a/tests/OrderTest.mq5 +++ b/tests/OrderTest.mq5 @@ -159,4 +159,4 @@ void OnDeinit(const int reason) { delete orders_dummy[i]; } } -} \ No newline at end of file +} diff --git a/tests/StrategyTest.mq5 b/tests/StrategyTest.mq5 index 634381e08..6eded8c0e 100644 --- a/tests/StrategyTest.mq5 +++ b/tests/StrategyTest.mq5 @@ -151,4 +151,4 @@ void OnTick() {} void OnDeinit(const int reason) { delete strat1; delete strat2; -} \ No newline at end of file +} diff --git a/tests/SummaryReportTest.mq5 b/tests/SummaryReportTest.mq5 index 769eb9e28..f8e62e489 100644 --- a/tests/SummaryReportTest.mq5 +++ b/tests/SummaryReportTest.mq5 @@ -53,4 +53,3 @@ void OnDeinit(const int reason) { Print(report.GetReport()); CleanUp(); } - diff --git a/tests/TaskTest.mq4 b/tests/TaskTest.mq4 index ac3245d85..eb534635e 100644 --- a/tests/TaskTest.mq4 +++ b/tests/TaskTest.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "TaskTest.mq5" \ No newline at end of file +#include "TaskTest.mq5"