From dac3101466f6e5227764147926664ed84c54120f Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 25 Jan 2024 04:05:58 +0330 Subject: [PATCH] Initial Commit ... --- .gitignore | 44 + .gitkeep | 0 .vscode/settings.json | 5 + .vscode/vscode-kanban.json | 16 + Bkp/BTCUSD-15M/Experts/x-saherelm.ea.mq4 | 1038 ++++++ Bkp/BTCUSD-15M/Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.xrange.mq4 | 294 ++ .../Indicators/x-saherelm.xtpow.mq4 | 275 ++ .../Libraries/x-saherelm.draw.lib.mq4 | 2010 +++++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 450 +++ Bkp/BTCUSD-15M/Libraries/x-saherelm.lib.mq4 | 1662 +++++++++ .../Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 154 + .../Libraries/x-saherelm.signal.lib.mq4 | 1756 +++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 1063 ++++++ .../Libraries/x-saherelm.xr.signal.lib.mq4 | 1142 ++++++ .../Libraries/x-saherelm.xtpw.signal.lib.mq4 | 1251 +++++++ Bkp/UnUsed/Experts/x-saherelm.osc.1.ea.mq4 | 733 ++++ Bkp/UnUsed/Experts/x-saherelm.xma.ea.mq4 | 700 ++++ Bkp/UnUsed/Indicators/ParabolicSar.mq4 | 333 ++ .../Indicators/SimplePanel/PanelDialog.mqh | 359 ++ .../Indicators/SimplePanel/SimplePanel.mq4 | 65 + .../Indicators/x-saherelm.osc.panel.mq4 | 147 + Bkp/UnUsed/Indicators/x-saherelm.psar.mq4 | 215 ++ Bkp/UnUsed/Indicators/x-saherelm.shpd.mq4 | 533 +++ Bkp/UnUsed/Indicators/x-saherelm.sl.mq4 | 154 + Bkp/UnUsed/Indicators/x-saherelm.tp.mq4 | 221 ++ Bkp/UnUsed/Indicators/x-saherelm.volume.mq4 | 270 ++ Bkp/UnUsed/Indicators/x-saherelm.xma.1.mq4 | 337 ++ Bkp/UnUsed/Indicators/x-saherelm.xmma.mq4 | 408 +++ .../Indicators/x-saherelm.xmma.signalling.mq4 | 249 ++ Bkp/UnUsed/Libs/x-saherelm.lib.1.mq4 | 203 ++ Bkp/UnUsed/Libs/x-saherelm.models.lib.mq4 | 271 ++ Bkp/UnUsed/Libs/x-saherelm.signal.lib.mq4 | 1467 ++++++++ Bkp/UnUsed/Libs/x-saherelm.xma.models.lib.mq4 | 138 + Bkp/UnUsed/Libs/x-saherelm.xma.signal.lib.mq4 | 1855 ++++++++++ .../Libs/x-saherelm.xmma.models.lib.mq4 | 84 + .../Libs/x-saherelm.xmma.signal.lib.mq4 | 1045 ++++++ Bkp/Used/14020419/x-saherelm.ea.mq4 | 1444 ++++++++ Bkp/Used/14020419/x-saherelm.signal.lib.mq4 | 2522 +++++++++++++ Bkp/Used/14020420/x-saherelm.cci.ea.mq4 | 532 +++ Bkp/Used/14020420/x-saherelm.ea.mq4 | 1277 +++++++ Bkp/Used/14020420/x-saherelm.models.lib.mq4 | 100 + Bkp/Used/14020420/x-saherelm.osc.mq4 | 330 ++ Bkp/Used/14020420/x-saherelm.x.hl.mq4 | 412 +++ .../14020420/x-saherelm.x.trend.power.mq4 | 265 ++ .../14020420/x-saherelm.x.trend.power.v2.mq4 | 291 ++ Bkp/Used/14020420/x-saherelm.x.xma.mq4 | 395 ++ .../14020425/21-00/Experts/x-saherelm.ea.mq4 | 790 ++++ .../21-00/Indicators/x-saherelm.adx.mq4 | 220 ++ .../21-00/Indicators/x-saherelm.ma.mq4 | 173 + .../21-00/Indicators/x-saherelm.momentum.mq4 | 160 + .../21-00/Indicators/x-saherelm.osc.mq4 | 257 ++ .../21-00/Indicators/x-saherelm.rma.mq4 | 141 + .../21-00/Indicators/x-saherelm.rsi.mq4 | 234 ++ .../21-00/Indicators/x-saherelm.shpd.mq4 | 402 +++ .../21-00/Indicators/x-saherelm.trend.mq4 | 250 ++ .../21-00/Indicators/x-saherelm.xbnd.mq4 | 425 +++ .../21-00/Indicators/x-saherelm.xhh.mq4 | 410 +++ .../21-00/Indicators/x-saherelm.xma.mq4 | 695 ++++ .../21-00/Indicators/x-saherelm.xmarket.mq4 | 394 ++ .../21-00/Indicators/x-saherelm.xmtrend.mq4 | 221 ++ .../21-00/Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../Libraries/x-saherelm.cci.signal.lib.mq4 | 472 +++ .../21-00/Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 948 +++++ .../21-00/Libraries/x-saherelm.lib.mq4 | 1502 ++++++++ .../21-00/Libraries/x-saherelm.log.lib.mq4 | 91 + .../21-00/Libraries/x-saherelm.models.lib.mq4 | 225 ++ .../Libraries/x-saherelm.osc.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.rma.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.shp.signal.lib.mq4 | 391 ++ .../21-00/Libraries/x-saherelm.signal.lib.mq4 | 1456 ++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 676 ++++ .../x-saherelm.xma.mc.signal.lib.mq4 | 490 +++ .../x-saherelm.xma.mm.signal.lib.mq4 | 338 ++ .../x-saherelm.xma.sc.signal.lib.mq4 | 360 ++ Bkp/Used/14020425/Experts/x-saherelm.ea.mq4 | 780 ++++ .../14020425/Indicators/x-saherelm.adx.mq4 | 220 ++ .../14020425/Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.momentum.mq4 | 160 + .../14020425/Indicators/x-saherelm.osc.mq4 | 257 ++ .../14020425/Indicators/x-saherelm.rma.mq4 | 141 + .../14020425/Indicators/x-saherelm.rsi.mq4 | 234 ++ .../14020425/Indicators/x-saherelm.shpd.mq4 | 402 +++ .../14020425/Indicators/x-saherelm.trend.mq4 | 250 ++ .../14020425/Indicators/x-saherelm.xbnd.mq4 | 422 +++ .../14020425/Indicators/x-saherelm.xma.mq4 | 695 ++++ .../Indicators/x-saherelm.xmarket.mq4 | 394 ++ .../Indicators/x-saherelm.xmtrend.mq4 | 221 ++ .../14020425/Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../Libraries/x-saherelm.cci.signal.lib.mq4 | 472 +++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 941 +++++ .../14020425/Libraries/x-saherelm.lib.mq4 | 1502 ++++++++ .../14020425/Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 222 ++ .../Libraries/x-saherelm.osc.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.rma.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.shp.signal.lib.mq4 | 391 ++ .../Libraries/x-saherelm.signal.lib.mq4 | 1463 ++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 592 +++ .../x-saherelm.xma.mc.signal.lib.mq4 | 490 +++ .../x-saherelm.xma.mm.signal.lib.mq4 | 338 ++ .../x-saherelm.xma.sc.signal.lib.mq4 | 360 ++ Bkp/Used/14020425/x-saherelm.ea.mq4 | 1130 ++++++ Bkp/Used/14020425/x-saherelm.signal.lib.mq4 | 1478 ++++++++ Bkp/Used/14020428/Experts/x-saherelm.ea.mq4 | 790 ++++ Bkp/Used/14020428/Indicators/ROCv2.2.mq4 | 335 ++ Bkp/Used/14020428/Indicators/roc2.mq4 | 62 + Bkp/Used/14020428/Indicators/roc_smoothed.mq4 | 190 + .../14020428/Indicators/x-saherelm.adx.mq4 | 220 ++ .../14020428/Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.momentum.mq4 | 160 + .../14020428/Indicators/x-saherelm.osc.mq4 | 257 ++ .../14020428/Indicators/x-saherelm.rma.mq4 | 141 + .../14020428/Indicators/x-saherelm.rsi.mq4 | 234 ++ .../14020428/Indicators/x-saherelm.shpd.mq4 | 402 +++ .../14020428/Indicators/x-saherelm.trend.mq4 | 250 ++ .../14020428/Indicators/x-saherelm.x.hl.mq4 | 412 +++ .../14020428/Indicators/x-saherelm.x.xma.mq4 | 355 ++ .../14020428/Indicators/x-saherelm.xbnd.mq4 | 425 +++ .../14020428/Indicators/x-saherelm.xhh.mq4 | 410 +++ .../14020428/Indicators/x-saherelm.xma.mq4 | 695 ++++ .../Indicators/x-saherelm.xmarket.mq4 | 394 ++ .../Indicators/x-saherelm.xmtrend.mq4 | 221 ++ .../14020428/Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../Libraries/x-saherelm.cci.signal.lib.mq4 | 472 +++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 948 +++++ .../14020428/Libraries/x-saherelm.lib.mq4 | 1502 ++++++++ .../14020428/Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 225 ++ .../Libraries/x-saherelm.osc.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.rma.signal.lib.mq4 | 363 ++ .../Libraries/x-saherelm.shp.signal.lib.mq4 | 391 ++ .../Libraries/x-saherelm.signal.lib.mq4 | 1456 ++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 678 ++++ .../x-saherelm.xma.mc.signal.lib.mq4 | 490 +++ .../x-saherelm.xma.mm.signal.lib.mq4 | 338 ++ .../x-saherelm.xma.sc.signal.lib.mq4 | 360 ++ .../14020430/Indicators/x-saherelm.rma.mq4 | 141 + .../14020430/Indicators/x-saherelm.volume.mq4 | 270 ++ .../Indicators/x-saherelm.xmarket.mq4 | 394 ++ .../14020430/Indicators/x-saherelm.zigzag.mq4 | 476 +++ Bkp/Used/14020431/Experts/x-saherelm.ea.mq4 | 839 +++++ .../14020431/Experts/x-saherelm.xr.ea.mq4 | 720 ++++ .../14020431/Indicators/x-saherelm.ma.mq4 | 173 + .../14020431/Indicators/x-saherelm.x.hl.mq4 | 412 +++ .../Indicators/x-saherelm.x.range.mq4 | 294 ++ .../14020431/Indicators/x-saherelm.x.xma.mq4 | 395 ++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 535 +++ .../14020431/Libraries/x-saherelm.lib.mq4 | 1604 +++++++++ .../14020431/Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 152 + .../Libraries/x-saherelm.signal.lib.mq4 | 1518 ++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 778 ++++ .../Libraries/x-saherelm.xr.signal.lib.mq4 | 732 ++++ .../Only OSC/StrategyTester_1.gif | Bin 0 -> 10178 bytes .../Only OSC/StrategyTester_1.htm | 762 ++++ .../Only XMA/StrategyTester_1.gif | Bin 0 -> 9079 bytes .../Only XMA/StrategyTester_1.htm | 222 ++ .../Reports/14020427/StrategyTester 1.gif | Bin 0 -> 7328 bytes .../Reports/14020427/StrategyTester 1.htm | 77 + .../Reports/14020427/StrategyTester 2.gif | Bin 0 -> 7581 bytes .../Reports/14020427/StrategyTester 2.htm | 81 + .../Reports/14020427/StrategyTester 3.gif | Bin 0 -> 7362 bytes .../Reports/14020427/StrategyTester 3.htm | 81 + .../Reports/14020427/StrategyTester 4.gif | Bin 0 -> 7446 bytes .../Reports/14020427/StrategyTester 4.htm | 87 + .../Reports/14020427/StrategyTester 5.gif | Bin 0 -> 7769 bytes .../Reports/14020427/StrategyTester 5.htm | 99 + .../Reports/14020427/StrategyTester 6.gif | Bin 0 -> 8177 bytes .../Reports/14020427/StrategyTester 6.htm | 127 + .../14020427/Whole StrategyTester 1.gif | Bin 0 -> 8822 bytes .../14020427/Whole StrategyTester 1.htm | 321 ++ .../Whole StrategyTester 2 - 1 Max Trade.gif | Bin 0 -> 8393 bytes .../Whole StrategyTester 2 - 1 Max Trade.htm | 273 ++ .../14020427/Whole StrategyTester 3.gif | Bin 0 -> 8795 bytes .../14020427/Whole StrategyTester 3.htm | 321 ++ .../Reports/14020427/Whole StrategyTester.gif | Bin 0 -> 9194 bytes .../Reports/14020427/Whole StrategyTester.htm | 333 ++ .../Reports/14020427/XR Strategy Test 1.gif | Bin 0 -> 7402 bytes .../Reports/14020427/XR Strategy Test 1.htm | 138 + .../Reports/14020427/XR Strategy Test 2.gif | Bin 0 -> 8409 bytes .../Reports/14020427/XR Strategy Test 2.htm | 241 ++ .../14020502/Docs/Reports/14020427/test 1.gif | Bin 0 -> 9949 bytes .../14020502/Docs/Reports/14020427/test 1.htm | 299 ++ .../Docs/Reports/X/StrategyTester 1.gif | Bin 0 -> 7239 bytes .../Docs/Reports/X/StrategyTester 1.htm | 95 + .../Docs/Reports/X/StrategyTester 2.gif | Bin 0 -> 7247 bytes .../Docs/Reports/X/StrategyTester 2.htm | 84 + .../Reports/X/StrategyTester 3 - Short.gif | Bin 0 -> 7740 bytes .../Reports/X/StrategyTester 3 - Short.htm | 130 + .../StrategyTester 4 - Short Long 0.3 0.4.gif | Bin 0 -> 7697 bytes .../StrategyTester 4 - Short Long 0.3 0.4.htm | 162 + .../Docs/Reports/XR/StrategyTester 1.gif | Bin 0 -> 8424 bytes .../Docs/Reports/XR/StrategyTester 1.htm | 183 + .../Docs/Reports/XR/StrategyTester 2.gif | Bin 0 -> 8400 bytes .../Docs/Reports/XR/StrategyTester 2.htm | 172 + .../Docs/Reports/XR/StrategyTester 3.gif | Bin 0 -> 8417 bytes .../Docs/Reports/XR/StrategyTester 3.htm | 183 + .../Docs/Reports/XR/StrategyTester 4.gif | Bin 0 -> 8374 bytes .../Docs/Reports/XR/StrategyTester 4.htm | 183 + .../Docs/Reports/XR/StrategyTester 5.gif | Bin 0 -> 8582 bytes .../Docs/Reports/XR/StrategyTester 5.htm | 213 ++ .../14020502/Docs/Signalling Conditions.md | 501 +++ Bkp/Used/14020502/Experts/x-saherelm.ea.mq4 | 710 ++++ .../14020502/Indicators/x-saherelm.ma.mq4 | 173 + .../14020502/Indicators/x-saherelm.xtpow.mq4 | 267 ++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 350 ++ .../14020502/Libraries/x-saherelm.lib.mq4 | 1604 +++++++++ .../14020502/Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 137 + .../Libraries/x-saherelm.signal.lib.mq4 | 1525 ++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 1033 ++++++ .../Libraries/x-saherelm.xr.signal.lib.mq4 | 654 ++++ .../14020510/read-conditions.tpw.long.mq4 | 1074 ++++++ Bkp/Used/14020512/Experts/x-saherelm.ea.mq4 | 1004 ++++++ .../14020512/Indicators/x-saherelm.ma.mq4 | 173 + .../14020512/Indicators/x-saherelm.xrange.mq4 | 294 ++ .../14020512/Indicators/x-saherelm.xtpow.mq4 | 275 ++ .../Libraries/x-saherelm.draw.lib.mq4 | 2010 +++++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 375 ++ .../14020512/Libraries/x-saherelm.lib.mq4 | 1662 +++++++++ .../14020512/Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 138 + .../Libraries/x-saherelm.signal.lib.mq4 | 1755 +++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 1063 ++++++ .../Libraries/x-saherelm.xr.signal.lib.mq4 | 695 ++++ .../Libraries/x-saherelm.xtpw.signal.lib.mq4 | 1332 +++++++ .../14020512/x-saherelm.xr.signal.lib.mq4 | 695 ++++ .../Experts/x-saherelm.osc.ea.mq4 | 884 +++++ .../Indicators/x-saherelm.adx.mq4 | 220 ++ .../Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.momentum.mq4 | 160 + .../Indicators/x-saherelm.osc.mq4 | 330 ++ .../Indicators/x-saherelm.rma.mq4 | 141 + .../Indicators/x-saherelm.rsi.mq4 | 234 ++ .../Indicators/x-saherelm.xma.mq4 | 643 ++++ .../Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.lib.mq4 | 1129 ++++++ .../Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.osc.models.lib.mq4 | 217 ++ .../Libraries/x-saherelm.osc.signal.lib.mq4 | 3195 +++++++++++++++++ .../Experts/x-saherelm.osc.ea.mq4 | 695 ++++ .../Indicators/ParabolicSar.mq4 | 333 ++ .../Indicators/x-saherelm.adx.mq4 | 220 ++ .../Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.momentum.mq4 | 160 + .../Indicators/x-saherelm.osc.mq4 | 330 ++ .../Indicators/x-saherelm.psar.mq4 | 215 ++ .../Indicators/x-saherelm.rma.mq4 | 141 + .../Indicators/x-saherelm.rsi.mq4 | 234 ++ .../Indicators/x-saherelm.xma.mq4 | 688 ++++ .../Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ .../Libraries/x-saherelm.lib.mq4 | 1129 ++++++ .../Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.osc.models.lib.mq4 | 127 + .../Libraries/x-saherelm.osc.signal.lib.mq4 | 3124 ++++++++++++++++ Bkp/Used/OSC EA/Experts/x-saherelm.osc.ea.mq4 | 784 ++++ Bkp/Used/OSC EA/Indicators/x-saherelm.adx.mq4 | 220 ++ Bkp/Used/OSC EA/Indicators/x-saherelm.ma.mq4 | 173 + .../OSC EA/Indicators/x-saherelm.momentum.mq4 | 160 + Bkp/Used/OSC EA/Indicators/x-saherelm.osc.mq4 | 330 ++ Bkp/Used/OSC EA/Indicators/x-saherelm.rma.mq4 | 141 + Bkp/Used/OSC EA/Indicators/x-saherelm.rsi.mq4 | 234 ++ Bkp/Used/OSC EA/Indicators/x-saherelm.xma.mq4 | 643 ++++ .../OSC EA/Indicators/x-saherelm.zigzag.mq4 | 476 +++ .../OSC EA/Libraries/x-saherelm.draw.lib.mq4 | 1670 +++++++++ Bkp/Used/OSC EA/Libraries/x-saherelm.lib.mq4 | 968 +++++ .../OSC EA/Libraries/x-saherelm.log.lib.mq4 | 47 + .../Libraries/x-saherelm.osc.models.lib.mq4 | 194 + .../Libraries/x-saherelm.osc.signal.lib.mq4 | 2641 ++++++++++++++ .../Parabolic SAR EA/parabolic.sar.ea.mq4 | 117 + Bkp/Used/x-saherelm.xTEMP.signal.lib.mq4 | 720 ++++ Bkp/XAUUSD-15M/Experts/x-saherelm.ea.mq4 | 1038 ++++++ Bkp/XAUUSD-15M/Indicators/x-saherelm.ma.mq4 | 173 + .../Indicators/x-saherelm.xrange.mq4 | 294 ++ .../Indicators/x-saherelm.xtpow.mq4 | 275 ++ .../Libraries/x-saherelm.draw.lib.mq4 | 2010 +++++++++++ .../Libraries/x-saherelm.indicator.lib.mq4 | 450 +++ Bkp/XAUUSD-15M/Libraries/x-saherelm.lib.mq4 | 1662 +++++++++ .../Libraries/x-saherelm.log.lib.mq4 | 91 + .../Libraries/x-saherelm.models.lib.mq4 | 154 + .../Libraries/x-saherelm.signal.lib.mq4 | 1756 +++++++++ .../Libraries/x-saherelm.x.signal.lib.mq4 | 1063 ++++++ .../Libraries/x-saherelm.xr.signal.lib.mq4 | 1142 ++++++ .../Libraries/x-saherelm.xtpw.signal.lib.mq4 | 1332 +++++++ .../Only OSC/StrategyTester_1.gif | Bin 0 -> 10178 bytes .../Only OSC/StrategyTester_1.htm | 762 ++++ .../Only XMA/StrategyTester_1.gif | Bin 0 -> 9079 bytes .../Only XMA/StrategyTester_1.htm | 222 ++ Docs/Reports/14020427/StrategyTester 1.gif | Bin 0 -> 7328 bytes Docs/Reports/14020427/StrategyTester 1.htm | 77 + Docs/Reports/14020427/StrategyTester 2.gif | Bin 0 -> 7581 bytes Docs/Reports/14020427/StrategyTester 2.htm | 81 + Docs/Reports/14020427/StrategyTester 3.gif | Bin 0 -> 7362 bytes Docs/Reports/14020427/StrategyTester 3.htm | 81 + Docs/Reports/14020427/StrategyTester 4.gif | Bin 0 -> 7446 bytes Docs/Reports/14020427/StrategyTester 4.htm | 87 + Docs/Reports/14020427/StrategyTester 5.gif | Bin 0 -> 7769 bytes Docs/Reports/14020427/StrategyTester 5.htm | 99 + Docs/Reports/14020427/StrategyTester 6.gif | Bin 0 -> 8177 bytes Docs/Reports/14020427/StrategyTester 6.htm | 127 + .../14020427/Whole StrategyTester 1.gif | Bin 0 -> 8822 bytes .../14020427/Whole StrategyTester 1.htm | 321 ++ .../Whole StrategyTester 2 - 1 Max Trade.gif | Bin 0 -> 8393 bytes .../Whole StrategyTester 2 - 1 Max Trade.htm | 273 ++ .../14020427/Whole StrategyTester 3.gif | Bin 0 -> 8795 bytes .../14020427/Whole StrategyTester 3.htm | 321 ++ .../Reports/14020427/Whole StrategyTester.gif | Bin 0 -> 9194 bytes .../Reports/14020427/Whole StrategyTester.htm | 333 ++ Docs/Reports/14020427/XR Strategy Test 1.gif | Bin 0 -> 7402 bytes Docs/Reports/14020427/XR Strategy Test 1.htm | 138 + Docs/Reports/14020427/XR Strategy Test 2.gif | Bin 0 -> 8409 bytes Docs/Reports/14020427/XR Strategy Test 2.htm | 241 ++ Docs/Reports/14020427/test 1.gif | Bin 0 -> 9949 bytes Docs/Reports/14020427/test 1.htm | 299 ++ Docs/Reports/EURUSD-15M/StrategyTester 1.gif | Bin 0 -> 8736 bytes Docs/Reports/EURUSD-15M/StrategyTester 1.htm | 199 + Docs/Reports/Screenshot 2023-08-03 202922.png | Bin 0 -> 107106 bytes Docs/Reports/Screenshot 2023-08-08 174923.png | Bin 0 -> 106894 bytes ...r X (XR and XXX and XTPW) - 0.2 - Full.gif | Bin 0 -> 8569 bytes ...r X (XR and XXX and XTPW) - 0.2 - Full.htm | 445 +++ ...tegyTester X (XXX and XTPW) Full - 0.2.gif | Bin 0 -> 7548 bytes ...tegyTester X (XXX and XTPW) Full - 0.2.htm | 223 ++ .../StrategyTester X (XXX and XTPW) Full.gif | Bin 0 -> 7566 bytes .../StrategyTester X (XXX and XTPW) Full.htm | 227 ++ ... lots 0.00001 - maxd 0.015 - r2r 3 - 1.gif | Bin 0 -> 7581 bytes ... lots 0.00001 - maxd 0.015 - r2r 3 - 1.htm | 159 + ...er - lots 0.00001 - maxd 0.015 - r2r 3.gif | Bin 0 -> 7649 bytes ...er - lots 0.00001 - maxd 0.015 - r2r 3.htm | 173 + ...tegyTester - lots 0.00001 - maxd 0.015.gif | Bin 0 -> 7693 bytes ...tegyTester - lots 0.00001 - maxd 0.015.htm | 173 + Docs/Reports/Tests/X/StrategyTester 1.gif | Bin 0 -> 7224 bytes Docs/Reports/Tests/X/StrategyTester 1.htm | 98 + Docs/Reports/Tests/X/StrategyTester 2.gif | Bin 0 -> 7247 bytes Docs/Reports/Tests/X/StrategyTester 2.htm | 84 + .../Tests/X/StrategyTester 3 - Short.gif | Bin 0 -> 7740 bytes .../Tests/X/StrategyTester 3 - Short.htm | 130 + .../StrategyTester 4 - Short Long 0.3 0.4.gif | Bin 0 -> 7697 bytes .../StrategyTester 4 - Short Long 0.3 0.4.htm | 162 + .../Tests/X/StrategyTester Short 1.gif | Bin 0 -> 8031 bytes .../Tests/X/StrategyTester Short 1.htm | 95 + Docs/Reports/Tests/XR/StrategyTester 1.gif | Bin 0 -> 8424 bytes Docs/Reports/Tests/XR/StrategyTester 1.htm | 183 + Docs/Reports/Tests/XR/StrategyTester 2.gif | Bin 0 -> 8400 bytes Docs/Reports/Tests/XR/StrategyTester 2.htm | 172 + Docs/Reports/Tests/XR/StrategyTester 3.gif | Bin 0 -> 8417 bytes Docs/Reports/Tests/XR/StrategyTester 3.htm | 183 + Docs/Reports/Tests/XR/StrategyTester 4.gif | Bin 0 -> 8374 bytes Docs/Reports/Tests/XR/StrategyTester 4.htm | 183 + Docs/Reports/Tests/XR/StrategyTester 5.gif | Bin 0 -> 8582 bytes Docs/Reports/Tests/XR/StrategyTester 5.htm | 213 ++ .../Tests/XTPW/Full/StrategyTester 1.gif | Bin 0 -> 7717 bytes .../Tests/XTPW/Full/StrategyTester 1.htm | 169 + .../Tests/XTPW/In Test/StrategyTester 1.gif | Bin 0 -> 5941 bytes .../Tests/XTPW/In Test/StrategyTester 1.htm | 75 + .../Tests/XTPW/In Test/StrategyTester 2.gif | Bin 0 -> 8537 bytes .../Tests/XTPW/In Test/StrategyTester 2.htm | 357 ++ .../Tests/XTPW/In Test/StrategyTester 3.gif | Bin 0 -> 8256 bytes .../Tests/XTPW/In Test/StrategyTester 3.htm | 359 ++ .../Tests/XTPW/In Test/StrategyTester 4.gif | Bin 0 -> 8156 bytes .../Tests/XTPW/In Test/StrategyTester 4.htm | 111 + .../Tests/XTPW/In Test/StrategyTester 5.gif | Bin 0 -> 9238 bytes .../Tests/XTPW/In Test/StrategyTester 5.htm | 443 +++ .../Tests/XTPW/In Test/StrategyTester 6.gif | Bin 0 -> 7534 bytes .../Tests/XTPW/In Test/StrategyTester 6.htm | 81 + .../Tests/XTPW/In Test/StrategyTester 7.gif | Bin 0 -> 7375 bytes .../Tests/XTPW/In Test/StrategyTester 7.htm | 81 + .../Tests/XTPW/In Test/StrategyTester 8.gif | Bin 0 -> 6777 bytes .../Tests/XTPW/In Test/StrategyTester 8.htm | 70 + .../Tests/XTPW/In Test/StrategyTester.gif | Bin 0 -> 7633 bytes .../Tests/XTPW/In Test/StrategyTester.htm | 81 + .../Tests/XTPW/Long/StrategyTester Long 1.gif | Bin 0 -> 7384 bytes .../Tests/XTPW/Long/StrategyTester Long 1.htm | 103 + .../XTPW/Long/StrategyTester Long 10.gif | Bin 0 -> 7949 bytes .../XTPW/Long/StrategyTester Long 10.htm | 95 + .../XTPW/Long/StrategyTester Long 11.gif | Bin 0 -> 6467 bytes .../XTPW/Long/StrategyTester Long 11.htm | 75 + .../XTPW/Long/StrategyTester Long 12.gif | Bin 0 -> 7327 bytes .../XTPW/Long/StrategyTester Long 12.htm | 103 + .../XTPW/Long/StrategyTester Long 13.gif | Bin 0 -> 7329 bytes .../XTPW/Long/StrategyTester Long 13.htm | 103 + .../Tests/XTPW/Long/StrategyTester Long 2.gif | Bin 0 -> 8811 bytes .../Tests/XTPW/Long/StrategyTester Long 2.htm | 127 + .../Tests/XTPW/Long/StrategyTester Long 3.gif | Bin 0 -> 8425 bytes .../Tests/XTPW/Long/StrategyTester Long 3.htm | 102 + .../Tests/XTPW/Long/StrategyTester Long 4.gif | Bin 0 -> 8442 bytes .../Tests/XTPW/Long/StrategyTester Long 4.htm | 102 + .../Tests/XTPW/Long/StrategyTester Long 5.gif | Bin 0 -> 8489 bytes .../Tests/XTPW/Long/StrategyTester Long 5.htm | 115 + .../Tests/XTPW/Long/StrategyTester Long 6.gif | Bin 0 -> 8170 bytes .../Tests/XTPW/Long/StrategyTester Long 6.htm | 109 + .../Tests/XTPW/Long/StrategyTester Long 7.gif | Bin 0 -> 8008 bytes .../Tests/XTPW/Long/StrategyTester Long 7.htm | 143 + .../Tests/XTPW/Long/StrategyTester Long 8.gif | Bin 0 -> 8190 bytes .../Tests/XTPW/Long/StrategyTester Long 8.htm | 175 + .../Tests/XTPW/Long/StrategyTester Long 9.gif | Bin 0 -> 8429 bytes .../Tests/XTPW/Long/StrategyTester Long 9.htm | 205 ++ .../Tests/XTPW/Short/StrategyTester 1.gif | Bin 0 -> 8847 bytes .../Tests/XTPW/Short/StrategyTester 1.htm | 131 + .../Tests/XTPW/Short/StrategyTester 10.gif | Bin 0 -> 8433 bytes .../Tests/XTPW/Short/StrategyTester 10.htm | 115 + .../Tests/XTPW/Short/StrategyTester 11.gif | Bin 0 -> 8082 bytes .../Tests/XTPW/Short/StrategyTester 11.htm | 91 + .../Tests/XTPW/Short/StrategyTester 12.gif | Bin 0 -> 7335 bytes .../Tests/XTPW/Short/StrategyTester 12.htm | 81 + .../Tests/XTPW/Short/StrategyTester 13.gif | Bin 0 -> 7848 bytes .../Tests/XTPW/Short/StrategyTester 13.htm | 139 + .../Tests/XTPW/Short/StrategyTester 2.gif | Bin 0 -> 8878 bytes .../Tests/XTPW/Short/StrategyTester 2.htm | 129 + .../Tests/XTPW/Short/StrategyTester 3.gif | Bin 0 -> 9102 bytes .../Tests/XTPW/Short/StrategyTester 3.htm | 141 + .../Tests/XTPW/Short/StrategyTester 4.gif | Bin 0 -> 8498 bytes .../Tests/XTPW/Short/StrategyTester 4.htm | 115 + .../Tests/XTPW/Short/StrategyTester 5.gif | Bin 0 -> 8306 bytes .../Tests/XTPW/Short/StrategyTester 5.htm | 105 + .../Tests/XTPW/Short/StrategyTester 6.gif | Bin 0 -> 8063 bytes .../Tests/XTPW/Short/StrategyTester 6.htm | 105 + .../Tests/XTPW/Short/StrategyTester 7.gif | Bin 0 -> 9227 bytes .../Tests/XTPW/Short/StrategyTester 7.htm | 178 + .../Tests/XTPW/Short/StrategyTester 8.gif | Bin 0 -> 8486 bytes .../Tests/XTPW/Short/StrategyTester 8.htm | 101 + .../Tests/XTPW/Short/StrategyTester 9.gif | Bin 0 -> 7496 bytes .../Tests/XTPW/Short/StrategyTester 9.htm | 89 + .../Tests/XTPW/Test/StrategyTester 1.gif | Bin 0 -> 7394 bytes .../Tests/XTPW/Test/StrategyTester 1.htm | 79 + .../Tests/XTPW/Test/StrategyTester 2.gif | Bin 0 -> 8687 bytes .../Tests/XTPW/Test/StrategyTester 2.htm | 171 + .../Tests/XTPW/Test/StrategyTester 3.gif | Bin 0 -> 8303 bytes .../Tests/XTPW/Test/StrategyTester 3.htm | 189 + .../Tests/XTPW/Test/StrategyTester 4.gif | Bin 0 -> 6675 bytes .../Tests/XTPW/Test/StrategyTester 4.htm | 85 + .../Tests/XTPW/Test/StrategyTester Long 1.gif | Bin 0 -> 8037 bytes .../Tests/XTPW/Test/StrategyTester Long 1.htm | 123 + .../Tests/XTPW/Test/StrategyTester Long 2.gif | Bin 0 -> 8039 bytes .../Tests/XTPW/Test/StrategyTester Long 2.htm | 115 + Docs/Reports/X/Full/StrategyTester 1 Full.gif | Bin 0 -> 7271 bytes Docs/Reports/X/Full/StrategyTester 1 Full.htm | 127 + Docs/Reports/X/Long/StrategyTester.gif | Bin 0 -> 7287 bytes Docs/Reports/X/Long/StrategyTester.htm | 111 + .../X/Short/StrategyTester Short 1.gif | Bin 0 -> 7421 bytes .../X/Short/StrategyTester Short 1.htm | 95 + .../X/Short/StrategyTester Short 2.gif | Bin 0 -> 6993 bytes .../X/Short/StrategyTester Short 2.htm | 85 + Docs/Reports/XR/Long/StrategyTester 1.gif | Bin 0 -> 8518 bytes Docs/Reports/XR/Long/StrategyTester 1.htm | 217 ++ Docs/Reports/XR/Long/StrategyTester 10.gif | Bin 0 -> 7435 bytes Docs/Reports/XR/Long/StrategyTester 10.htm | 89 + Docs/Reports/XR/Long/StrategyTester 11.gif | Bin 0 -> 9361 bytes Docs/Reports/XR/Long/StrategyTester 11.htm | 167 + Docs/Reports/XR/Long/StrategyTester 2.gif | Bin 0 -> 8102 bytes Docs/Reports/XR/Long/StrategyTester 2.htm | 91 + Docs/Reports/XR/Long/StrategyTester 3.gif | Bin 0 -> 8185 bytes Docs/Reports/XR/Long/StrategyTester 3.htm | 87 + Docs/Reports/XR/Long/StrategyTester 4.gif | Bin 0 -> 7696 bytes Docs/Reports/XR/Long/StrategyTester 4.htm | 85 + Docs/Reports/XR/Long/StrategyTester 5.gif | Bin 0 -> 8130 bytes Docs/Reports/XR/Long/StrategyTester 5.htm | 103 + Docs/Reports/XR/Long/StrategyTester 6.gif | Bin 0 -> 6488 bytes Docs/Reports/XR/Long/StrategyTester 6.htm | 89 + Docs/Reports/XR/Long/StrategyTester 7.gif | Bin 0 -> 8765 bytes Docs/Reports/XR/Long/StrategyTester 7.htm | 143 + Docs/Reports/XR/Long/StrategyTester 8.gif | Bin 0 -> 7827 bytes Docs/Reports/XR/Long/StrategyTester 8.htm | 97 + Docs/Reports/XR/Long/StrategyTester 9.gif | Bin 0 -> 8847 bytes Docs/Reports/XR/Long/StrategyTester 9.htm | 123 + Docs/Reports/XR/Short/StrategyTester 1.gif | Bin 0 -> 9417 bytes Docs/Reports/XR/Short/StrategyTester 1.htm | 283 ++ Docs/Reports/XR/Short/StrategyTester 2.gif | Bin 0 -> 8153 bytes Docs/Reports/XR/Short/StrategyTester 2.htm | 97 + Docs/Reports/XR/Short/StrategyTester 3.gif | Bin 0 -> 7795 bytes Docs/Reports/XR/Short/StrategyTester 3.htm | 95 + Docs/Reports/XR/Short/StrategyTester 4.gif | Bin 0 -> 9432 bytes Docs/Reports/XR/Short/StrategyTester 4.htm | 174 + Docs/Reports/XR/StrategyTester 1 - Full.gif | Bin 0 -> 9202 bytes Docs/Reports/XR/StrategyTester 1 - Full.htm | 297 ++ .../XR/StrategyTester 2 - 0.2 - Full.gif | Bin 0 -> 9133 bytes .../XR/StrategyTester 2 - 0.2 - Full.htm | 301 ++ Docs/Reports/XTPW/Full/StrategyTester 1.gif | Bin 0 -> 7717 bytes Docs/Reports/XTPW/Full/StrategyTester 1.htm | 169 + .../XTPW/Long/StrategyTester Long 13.gif | Bin 0 -> 7329 bytes .../XTPW/Long/StrategyTester Long 13.htm | 103 + Docs/Reports/XTPW/Short/StrategyTester 13.gif | Bin 0 -> 7848 bytes Docs/Reports/XTPW/Short/StrategyTester 13.htm | 139 + Docs/Signalling Conditions.md | 501 +++ Docs/x-saherelm.ea.x.full.set | 276 ++ Experts/x-saherelm.ea.mq4 | 1116 ++++++ Indicators/x-saherelm.ma.mq4 | 173 + Indicators/x-saherelm.xrange.mq4 | 294 ++ Indicators/x-saherelm.xtpow.mq4 | 275 ++ Libraries/x-saherelm.dialog.mq4 | 110 + Libraries/x-saherelm.draw.lib.mq4 | 2010 +++++++++++ Libraries/x-saherelm.indicator.lib.mq4 | 450 +++ Libraries/x-saherelm.lib.mq4 | 1695 +++++++++ Libraries/x-saherelm.log.lib.mq4 | 91 + Libraries/x-saherelm.models.lib.mq4 | 155 + Libraries/x-saherelm.signal.lib.mq4 | 1756 +++++++++ Libraries/x-saherelm.x.signal.lib.mq4 | 1063 ++++++ Libraries/x-saherelm.xr.signal.lib.mq4 | 1142 ++++++ Libraries/x-saherelm.xtpw.signal.lib.mq4 | 1332 +++++++ MQL4.code-workspace | 12 + Node/x-arg.parser.js | 91 + Node/x-color.tools.js | 506 +++ Node/x-file.tools.js | 909 +++++ Node/x-logger.tools.js | 362 ++ Node/x-type-detector.tools.js | 268 ++ Node/x-value.tools.js | 1528 ++++++++ Publishes/.gitkeep | 0 README.md | 11 + Temp/result.md | 307 ++ Templates/x-saherelm.ea..xtpw.btc.tpl | 90 + Templates/x-saherelm.ea.15m.tpl | 208 ++ publish.js | 253 ++ 520 files changed, 186332 insertions(+) create mode 100644 .gitignore create mode 100644 .gitkeep create mode 100644 .vscode/settings.json create mode 100644 .vscode/vscode-kanban.json create mode 100644 Bkp/BTCUSD-15M/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/BTCUSD-15M/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/BTCUSD-15M/Indicators/x-saherelm.xrange.mq4 create mode 100644 Bkp/BTCUSD-15M/Indicators/x-saherelm.xtpow.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/BTCUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 create mode 100644 Bkp/UnUsed/Experts/x-saherelm.osc.1.ea.mq4 create mode 100644 Bkp/UnUsed/Experts/x-saherelm.xma.ea.mq4 create mode 100644 Bkp/UnUsed/Indicators/ParabolicSar.mq4 create mode 100644 Bkp/UnUsed/Indicators/SimplePanel/PanelDialog.mqh create mode 100644 Bkp/UnUsed/Indicators/SimplePanel/SimplePanel.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.osc.panel.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.psar.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.shpd.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.sl.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.tp.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.volume.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.xma.1.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.xmma.mq4 create mode 100644 Bkp/UnUsed/Indicators/x-saherelm.xmma.signalling.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.lib.1.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.models.lib.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.xma.models.lib.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.xma.signal.lib.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.xmma.models.lib.mq4 create mode 100644 Bkp/UnUsed/Libs/x-saherelm.xmma.signal.lib.mq4 create mode 100644 Bkp/Used/14020419/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020419/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.cci.ea.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.x.hl.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.x.trend.power.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.x.trend.power.v2.mq4 create mode 100644 Bkp/Used/14020420/x-saherelm.x.xma.mq4 create mode 100644 Bkp/Used/14020425/21-00/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.shpd.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.trend.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.xbnd.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.xhh.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmarket.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmtrend.mq4 create mode 100644 Bkp/Used/14020425/21-00/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.cci.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.rma.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.shp.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mm.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.sc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.shpd.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.trend.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.xbnd.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.xmarket.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.xmtrend.mq4 create mode 100644 Bkp/Used/14020425/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.cci.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.rma.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.shp.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.xma.mc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.xma.mm.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/Libraries/x-saherelm.xma.sc.signal.lib.mq4 create mode 100644 Bkp/Used/14020425/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020425/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020428/Indicators/ROCv2.2.mq4 create mode 100644 Bkp/Used/14020428/Indicators/roc2.mq4 create mode 100644 Bkp/Used/14020428/Indicators/roc_smoothed.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.shpd.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.trend.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.x.hl.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.x.xma.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.xbnd.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.xhh.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.xmarket.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.xmtrend.mq4 create mode 100644 Bkp/Used/14020428/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.cci.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.rma.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.shp.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.xma.mc.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.xma.mm.signal.lib.mq4 create mode 100644 Bkp/Used/14020428/Libraries/x-saherelm.xma.sc.signal.lib.mq4 create mode 100644 Bkp/Used/14020430/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/14020430/Indicators/x-saherelm.volume.mq4 create mode 100644 Bkp/Used/14020430/Indicators/x-saherelm.xmarket.mq4 create mode 100644 Bkp/Used/14020430/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/14020431/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020431/Experts/x-saherelm.xr.ea.mq4 create mode 100644 Bkp/Used/14020431/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020431/Indicators/x-saherelm.x.hl.mq4 create mode 100644 Bkp/Used/14020431/Indicators/x-saherelm.x.range.mq4 create mode 100644 Bkp/Used/14020431/Indicators/x-saherelm.x.xma.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020431/Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 2.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 2.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 3.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 3.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 6.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 6.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 3.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 3.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/test 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/14020427/test 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 4 - Short Long 0.3 0.4.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/X/StrategyTester 4 - Short Long 0.3 0.4.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 1.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 1.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 2.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 2.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 4.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 4.htm create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.gif create mode 100644 Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.htm create mode 100644 Bkp/Used/14020502/Docs/Signalling Conditions.md create mode 100644 Bkp/Used/14020502/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020502/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020502/Indicators/x-saherelm.xtpow.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020502/Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/Used/14020510/read-conditions.tpw.long.mq4 create mode 100644 Bkp/Used/14020512/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/Used/14020512/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/14020512/Indicators/x-saherelm.xrange.mq4 create mode 100644 Bkp/Used/14020512/Indicators/x-saherelm.xtpow.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/Used/14020512/Libraries/x-saherelm.xtpw.signal.lib.mq4 create mode 100644 Bkp/Used/14020512/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Experts/x-saherelm.osc.ea.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.models.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Experts/x-saherelm.osc.ea.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/ParabolicSar.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.psar.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.models.lib.mq4 create mode 100644 Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/OSC EA/Experts/x-saherelm.osc.ea.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.adx.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.momentum.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.osc.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.rma.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.rsi.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.xma.mq4 create mode 100644 Bkp/Used/OSC EA/Indicators/x-saherelm.zigzag.mq4 create mode 100644 Bkp/Used/OSC EA/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/Used/OSC EA/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/Used/OSC EA/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/Used/OSC EA/Libraries/x-saherelm.osc.models.lib.mq4 create mode 100644 Bkp/Used/OSC EA/Libraries/x-saherelm.osc.signal.lib.mq4 create mode 100644 Bkp/Used/Parabolic SAR EA/parabolic.sar.ea.mq4 create mode 100644 Bkp/Used/x-saherelm.xTEMP.signal.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Experts/x-saherelm.ea.mq4 create mode 100644 Bkp/XAUUSD-15M/Indicators/x-saherelm.ma.mq4 create mode 100644 Bkp/XAUUSD-15M/Indicators/x-saherelm.xrange.mq4 create mode 100644 Bkp/XAUUSD-15M/Indicators/x-saherelm.xtpow.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.log.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.models.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Bkp/XAUUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 create mode 100644 Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif create mode 100644 Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.htm create mode 100644 Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif create mode 100644 Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.htm create mode 100644 Docs/Reports/14020427/StrategyTester 1.gif create mode 100644 Docs/Reports/14020427/StrategyTester 1.htm create mode 100644 Docs/Reports/14020427/StrategyTester 2.gif create mode 100644 Docs/Reports/14020427/StrategyTester 2.htm create mode 100644 Docs/Reports/14020427/StrategyTester 3.gif create mode 100644 Docs/Reports/14020427/StrategyTester 3.htm create mode 100644 Docs/Reports/14020427/StrategyTester 4.gif create mode 100644 Docs/Reports/14020427/StrategyTester 4.htm create mode 100644 Docs/Reports/14020427/StrategyTester 5.gif create mode 100644 Docs/Reports/14020427/StrategyTester 5.htm create mode 100644 Docs/Reports/14020427/StrategyTester 6.gif create mode 100644 Docs/Reports/14020427/StrategyTester 6.htm create mode 100644 Docs/Reports/14020427/Whole StrategyTester 1.gif create mode 100644 Docs/Reports/14020427/Whole StrategyTester 1.htm create mode 100644 Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif create mode 100644 Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm create mode 100644 Docs/Reports/14020427/Whole StrategyTester 3.gif create mode 100644 Docs/Reports/14020427/Whole StrategyTester 3.htm create mode 100644 Docs/Reports/14020427/Whole StrategyTester.gif create mode 100644 Docs/Reports/14020427/Whole StrategyTester.htm create mode 100644 Docs/Reports/14020427/XR Strategy Test 1.gif create mode 100644 Docs/Reports/14020427/XR Strategy Test 1.htm create mode 100644 Docs/Reports/14020427/XR Strategy Test 2.gif create mode 100644 Docs/Reports/14020427/XR Strategy Test 2.htm create mode 100644 Docs/Reports/14020427/test 1.gif create mode 100644 Docs/Reports/14020427/test 1.htm create mode 100644 Docs/Reports/EURUSD-15M/StrategyTester 1.gif create mode 100644 Docs/Reports/EURUSD-15M/StrategyTester 1.htm create mode 100644 Docs/Reports/Screenshot 2023-08-03 202922.png create mode 100644 Docs/Reports/Screenshot 2023-08-08 174923.png create mode 100644 Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.gif create mode 100644 Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.htm create mode 100644 Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.gif create mode 100644 Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.htm create mode 100644 Docs/Reports/StrategyTester X (XXX and XTPW) Full.gif create mode 100644 Docs/Reports/StrategyTester X (XXX and XTPW) Full.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3 - 1.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3 - 1.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester 2.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester 2.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester 3 - Short.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester 3 - Short.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.htm create mode 100644 Docs/Reports/Tests/X/StrategyTester Short 1.gif create mode 100644 Docs/Reports/Tests/X/StrategyTester Short 1.htm create mode 100644 Docs/Reports/Tests/XR/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/XR/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/XR/StrategyTester 2.gif create mode 100644 Docs/Reports/Tests/XR/StrategyTester 2.htm create mode 100644 Docs/Reports/Tests/XR/StrategyTester 3.gif create mode 100644 Docs/Reports/Tests/XR/StrategyTester 3.htm create mode 100644 Docs/Reports/Tests/XR/StrategyTester 4.gif create mode 100644 Docs/Reports/Tests/XR/StrategyTester 4.htm create mode 100644 Docs/Reports/Tests/XR/StrategyTester 5.gif create mode 100644 Docs/Reports/Tests/XR/StrategyTester 5.htm create mode 100644 Docs/Reports/Tests/XTPW/Full/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/XTPW/Full/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 4.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 4.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.htm create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester.gif create mode 100644 Docs/Reports/Tests/XTPW/In Test/StrategyTester.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 10.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 10.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 11.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 11.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 13.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 13.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 2.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 2.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 5.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 5.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 6.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 6.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 7.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 7.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 8.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 8.htm create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.gif create mode 100644 Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 10.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 10.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 11.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 11.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 12.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 12.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 13.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 13.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 2.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 2.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 3.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 3.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 4.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 4.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 5.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 5.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 6.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 6.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 7.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 7.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 8.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 8.htm create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 9.gif create mode 100644 Docs/Reports/Tests/XTPW/Short/StrategyTester 9.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 1.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 1.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 2.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 2.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 3.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 3.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 4.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester 4.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester Long 1.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester Long 1.htm create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester Long 2.gif create mode 100644 Docs/Reports/Tests/XTPW/Test/StrategyTester Long 2.htm create mode 100644 Docs/Reports/X/Full/StrategyTester 1 Full.gif create mode 100644 Docs/Reports/X/Full/StrategyTester 1 Full.htm create mode 100644 Docs/Reports/X/Long/StrategyTester.gif create mode 100644 Docs/Reports/X/Long/StrategyTester.htm create mode 100644 Docs/Reports/X/Short/StrategyTester Short 1.gif create mode 100644 Docs/Reports/X/Short/StrategyTester Short 1.htm create mode 100644 Docs/Reports/X/Short/StrategyTester Short 2.gif create mode 100644 Docs/Reports/X/Short/StrategyTester Short 2.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 1.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 1.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 10.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 10.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 11.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 11.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 2.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 2.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 3.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 3.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 4.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 4.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 5.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 5.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 6.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 6.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 7.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 7.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 8.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 8.htm create mode 100644 Docs/Reports/XR/Long/StrategyTester 9.gif create mode 100644 Docs/Reports/XR/Long/StrategyTester 9.htm create mode 100644 Docs/Reports/XR/Short/StrategyTester 1.gif create mode 100644 Docs/Reports/XR/Short/StrategyTester 1.htm create mode 100644 Docs/Reports/XR/Short/StrategyTester 2.gif create mode 100644 Docs/Reports/XR/Short/StrategyTester 2.htm create mode 100644 Docs/Reports/XR/Short/StrategyTester 3.gif create mode 100644 Docs/Reports/XR/Short/StrategyTester 3.htm create mode 100644 Docs/Reports/XR/Short/StrategyTester 4.gif create mode 100644 Docs/Reports/XR/Short/StrategyTester 4.htm create mode 100644 Docs/Reports/XR/StrategyTester 1 - Full.gif create mode 100644 Docs/Reports/XR/StrategyTester 1 - Full.htm create mode 100644 Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.gif create mode 100644 Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.htm create mode 100644 Docs/Reports/XTPW/Full/StrategyTester 1.gif create mode 100644 Docs/Reports/XTPW/Full/StrategyTester 1.htm create mode 100644 Docs/Reports/XTPW/Long/StrategyTester Long 13.gif create mode 100644 Docs/Reports/XTPW/Long/StrategyTester Long 13.htm create mode 100644 Docs/Reports/XTPW/Short/StrategyTester 13.gif create mode 100644 Docs/Reports/XTPW/Short/StrategyTester 13.htm create mode 100644 Docs/Signalling Conditions.md create mode 100644 Docs/x-saherelm.ea.x.full.set create mode 100644 Experts/x-saherelm.ea.mq4 create mode 100644 Indicators/x-saherelm.ma.mq4 create mode 100644 Indicators/x-saherelm.xrange.mq4 create mode 100644 Indicators/x-saherelm.xtpow.mq4 create mode 100644 Libraries/x-saherelm.dialog.mq4 create mode 100644 Libraries/x-saherelm.draw.lib.mq4 create mode 100644 Libraries/x-saherelm.indicator.lib.mq4 create mode 100644 Libraries/x-saherelm.lib.mq4 create mode 100644 Libraries/x-saherelm.log.lib.mq4 create mode 100644 Libraries/x-saherelm.models.lib.mq4 create mode 100644 Libraries/x-saherelm.signal.lib.mq4 create mode 100644 Libraries/x-saherelm.x.signal.lib.mq4 create mode 100644 Libraries/x-saherelm.xr.signal.lib.mq4 create mode 100644 Libraries/x-saherelm.xtpw.signal.lib.mq4 create mode 100644 MQL4.code-workspace create mode 100644 Node/x-arg.parser.js create mode 100644 Node/x-color.tools.js create mode 100644 Node/x-file.tools.js create mode 100644 Node/x-logger.tools.js create mode 100644 Node/x-type-detector.tools.js create mode 100644 Node/x-value.tools.js create mode 100644 Publishes/.gitkeep create mode 100644 README.md create mode 100644 Temp/result.md create mode 100644 Templates/x-saherelm.ea..xtpw.btc.tpl create mode 100644 Templates/x-saherelm.ea.15m.tpl create mode 100644 publish.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e79ca76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# +SharedProjects/* +Scripts/* +Projects/* +Presets/* +Logs/* +Include/* +Images/* +Files/* + +# +*.dat +*.ex4 +Indicators/Examples/* + +# +ZigZag.mq4 +Stochastic.mq4 +RSI.mq4 +Parabolic.mq4 +OsMA.mq4 +MACD.mq4 +Momentum.mq4 +iExposure.mq4 +Ichimoku.mq4 +Heiken Ashi.mq4 +Custom Moving Averages.mq4 +CCI.mq4 +Bulls.mq4 +Bears.mq4 +Bands.mq4 +Awesome.mq4 +ATR.mq4 +Alligator.mq4 +Accumulation.mq4 +Accelerator.mq4 +stdlib.mq4 +MACD Sample.mq4 +Moving Average.mq4 + +# +# Node Based ... +Publishes/* +!Publishes/.gitkeep \ No newline at end of file diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1569039 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "C_Cpp.errorSquiggles": "disabled", + "C_Cpp.intelliSenseEngineFallback": "enabled", + "C_Cpp.default.compilerPath": "" +} \ No newline at end of file diff --git a/.vscode/vscode-kanban.json b/.vscode/vscode-kanban.json new file mode 100644 index 0000000..7d281cd --- /dev/null +++ b/.vscode/vscode-kanban.json @@ -0,0 +1,16 @@ +{ + "todo": [ + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "creation_time": "2023-06-22T02:10:44.343Z", + "id": "2", + "references": [], + "title": "Complete Panel for OSC" + } + ], + "in-progress": [], + "testing": [], + "done": [] +} \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Experts/x-saherelm.ea.mq4 b/Bkp/BTCUSD-15M/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..d8a63ca --- /dev/null +++ b/Bkp/BTCUSD-15M/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,1038 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_EA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 7; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + maxOpenTrades <= 0 + || maxEquityPercent < 0 + || minBalancePercent < 0 + || lotsPerTradePercent < 0 + || maxDrawdownPercentPerPTrade < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + static bool tradingPauseAlerted; + + // + allowDoTrade = false; + + // + if (!tradingPauseAlerted) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + + // + tradingPauseAlerted = true; + } + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + // Retrieve Signal Lots Per Trade ... + double lPTradePercent = GetSignalLottage( + request.signal, + lotsPerTradePercent + ); + + // + bool isPositionOpened = TradeSignal( + request.signal, + lPTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", ProvidedBy: ", GetSignalProviderIdentifier(request.signal.provider), + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // XSignalling ... + if (enableXSignalling) { + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + if (xCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XXX_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XXX_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xMaximumCandlesPerTrade, + X_XXX_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xFailedSignals++; + } + } + + // + // XR Signalling ... + if (enableXRSignalling) { + // + if (xRCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xRCloseLongTrades = false; + } + + // + if (xRCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XR_PROVIDER); + + // + xRCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XR_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XR_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xRMaximumCandlesPerTrade, + X_XR_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xRFailedSignals++; + } + } + + // + // XTPW Signalling ... + if (enableXTPWSignalling) { + // + if (xTPWCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XTPW_PROVIDER); + + // + xTPWCloseLongTrades = false; + } + + // + if (xTPWCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xTPWCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XTPW_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XTPW_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xTPWMaximumCandlesPerTrade, + X_XTPW_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xTPWFailedSignals++; + } + } + + // + // Close Maximum DrawDown Passed Trades ... + // this is the Maximum Controller ... + // + double maxOfXPercent = enableXSignalling ? + MathMax( + xLongMaxDrawdownPerTradePercent, + xShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXRPercent = enableXRSignalling ? + MathMax( + xRLongMaxDrawdownPerTradePercent, + xRShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXTPWPercent = enableXTPWSignalling ? + MathMax( + xTPWLongMaxDrawdownPerTradePercent, + xTPWShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxDrawDownPercent = MathMax( + maxOfXPercent, + maxOfXRPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxOfXTPWPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxDrawdownPercentPerPTrade + ); + + // + // we Calculate Max DrawDown Percent Per Trade ... + // then try to Close based on them ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawDownPercent + ); +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Define Template Signal Requests for Managing Multiple Signals ... + // + // X ... + XSignalRequest xLongSignalRequest = {}; + XSignalRequest xShortSignalRequest = {}; + // + // XR ... + XSignalRequest xrLongSignalRequest = {}; + XSignalRequest xrShortSignalRequest = {}; + // + // XTPW ... + XSignalRequest xTPWLongSignalRequest = {}; + XSignalRequest xTPWShortSignalRequest = {}; + + // + // START XR Signal Handler ... + // + // + if (enableXRSignalling) { + // + CheckXRSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xRWaitForLongSignals) { + // + CheckXRLongSignalConditions( + bar_index + ); + + // + xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xRWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + } else { + ClearXRLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xRWaitForShortSignals) { + // + CheckXRShortSignalConditions( + bar_index + ); + + // + xrShortSignalRequest = GenerateXRSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xrShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrShortSignalRequest.signal + ); + + // + if (isReady && xRWaitForShortSignals) { + // + hasShortSignal = true; + signal = xrShortSignalRequest.signal; + } else { + ClearXRShortSignalConditions(); + } + } + } else { + ClearXRShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + // START XTPW Signal Handler ... + // + if (enableXTPWSignalling) { + // + CheckXTPWSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xTPWWaitForLongSignals) { + // + CheckXTPWLongSignalConditions( + bar_index + ); + + // + xTPWLongSignalRequest = GenerateXTPWSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xTPWLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWLongSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForLongSignals) { + // + hasLongSignal = true; + signal = xTPWLongSignalRequest.signal; + } else { + ClearXTPWLongSignalConditions(); + } + } + } else { + ClearXTPWLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xTPWWaitForShortSignals) { + // + CheckXTPWShortSignalConditions( + bar_index + ); + + // + xTPWShortSignalRequest = GenerateXTPWSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xTPWShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWShortSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForShortSignals) { + // + hasShortSignal = true; + signal = xTPWShortSignalRequest.signal; + } else { + ClearXTPWShortSignalConditions(); + } + } + } else { + ClearXTPWShortSignalConditions(); + } + } + } + // + // END XTPW Signal Handler ... + // + + // + // START X Signal Handler ... + // + // + if (enableXSignalling) { + // + CheckXSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xWaitForLongSignals) { + // + CheckXLongSignalConditions( + bar_index + ); + + // + xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } + } else { + ClearXLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xWaitForShortSignals) { + // + CheckXShortSignalConditions( + bar_index + ); + + // + xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal + ); + + // + if (isReady && xWaitForShortSignals) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + } else { + ClearXShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/BTCUSD-15M/Indicators/x-saherelm.ma.mq4 b/Bkp/BTCUSD-15M/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/BTCUSD-15M/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Indicators/x-saherelm.xrange.mq4 b/Bkp/BTCUSD-15M/Indicators/x-saherelm.xrange.mq4 new file mode 100644 index 0000000..1359f57 --- /dev/null +++ b/Bkp/BTCUSD-15M/Indicators/x-saherelm.xrange.mq4 @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XRange Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XRange Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 14; +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_plots 3 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Middle Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +#define highestHighBufferIndex 0 +#define lowestLowBufferIndex 1 +#define middleBufferIndex 2 + +// +double highestHighBuffer[]; +double lowestLowBuffer[]; +double middleBuffer[]; + +// +datetime startTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + string hhLbl = StringConcatenate( + "XR HH(", marketLength, ")" + ); + SetIndexBuffer(highestHighBufferIndex, highestHighBuffer); + SetIndexLabel(highestHighBufferIndex, hhLbl); + + // + string llLbl = StringConcatenate( + "XR LL(", marketLength, ")" + ); + SetIndexBuffer(lowestLowBufferIndex, lowestLowBuffer); + SetIndexLabel(lowestLowBufferIndex, llLbl); + + // + string midLbl = StringConcatenate( + "XR Mid(", marketLength, ")" + ); + SetIndexBuffer(middleBufferIndex, middleBuffer); + SetIndexLabel(middleBufferIndex, midLbl); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculations ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculations ... +void CalculateBuffers( + const int &bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + SetIndicatorBuffersNone(bar_index); + return; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + int startDistance = startBarIndex - bar_index; + if (startDistance < marketLength) { + // + SetIndicatorBuffersNone(bar_index); + return; + } + + // + // Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + bar_index + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + highestHighBuffer[bar_index] = hh; + + // + // Lowest Low ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + bar_index + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + lowestLowBuffer[bar_index] = ll; + + // + // Middle Buffer ... + double mid = (hh + ll) / 2; + middleBuffer[bar_index] = mid; + + // + // Reset Start Time ... + startTime = 0; +} + +// +void SetIndicatorBuffersNone( + const int bar_index +) { + // + int lastBarIndex = bar_index + 1; + + // + double lastHighestHigh; + double lastLowestLow; + + // + // Highest High ... + if (ArraySize(highestHighBuffer) > lastBarIndex) { + lastHighestHigh = highestHighBuffer[lastBarIndex]; + } else { + lastHighestHigh = 0; + } + + // + // Lowest Low ... + if (ArraySize(lowestLowBuffer) > lastBarIndex) { + lastLowestLow = lowestLowBuffer[lastBarIndex]; + } else { + lastLowestLow = 0; + } + + // + highestHighBuffer[bar_index] = lastHighestHigh; + lowestLowBuffer[bar_index] = lastLowestLow; + + // + double mid = (lastHighestHigh + lastLowestLow) / 2; + middleBuffer[bar_index] = mid; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Indicators/x-saherelm.xtpow.mq4 b/Bkp/BTCUSD-15M/Indicators/x-saherelm.xtpow.mq4 new file mode 100644 index 0000000..46ff59e --- /dev/null +++ b/Bkp/BTCUSD-15M/Indicators/x-saherelm.xtpow.mq4 @@ -0,0 +1,275 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 20.0); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + SetLevelValue(3, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,3,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + int doubleMarketLength = (marketLength * 2); + double ema = GetMA( + bar_index, + doubleMarketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double emaRate = GetMarketHighestHigh(bar_index, doubleMarketLength) - GetMarketLowestLow(bar_index, doubleMarketLength) / 100; + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..776cde4 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,2010 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Draw Highest High ... +bool DrawHighestHigh( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrAqua, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_HH(", marketLen ,")_", + hh, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + hhTime, + hh, + drawUntilTime, + hh, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Lowest Low ... +bool DrawLowestLow( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrFuchsia, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_LL(", marketLen ,")_", + ll, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + llTime, + ll, + drawUntilTime, + ll, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Market Middle ... +bool DrawMarketMiddle( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrYellow, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + double middle = ll + ((hh - ll) / 2); + datetime middleTime = hhIdx < llIdx + ? hhTime + : llTime + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_MID(", marketLen ,")_", + middle, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + middleTime, + middle, + drawUntilTime, + middle, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..0e4b162 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,450 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Reading specified Buffer From ADX Indicator ... +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading specified Buffer from XHL Indicator ... +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading ADX Values ... +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +// Reading Pivot States ... +XPvtState GetPVTState( + const int bar_index, + const int marketLen +) { + // + XPvtState result = {}; + + // + double hh = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double ho = GetMarketHighestOpen( + bar_index, + marketLen + ); + + // + double hc = GetMarketHighestClose( + bar_index, + marketLen + ); + + // + double hl = GetMarketHighestLow( + bar_index, + marketLen + ); + + // + double ll = GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double lo = GetMarketLowestOpen( + bar_index, + marketLen + ); + + // + double lc = GetMarketLowestClose( + bar_index, + marketLen + ); + + // + double lh = GetMarketLowestHigh( + bar_index, + marketLen + ); + + // + // Filling Result ... + // + result.hh = hh; + result.ho = ho; + result.hc = hc; + result.hl = hl; + + // + result.ll = ll; + result.lo = lo; + result.lc = lc; + result.lh = lh; + + // + return result; +} + +// +// Calculate XRange from Market ... +static XRState lastXRState; +XRState GetXRange( + const int bar_index, + const int rangeMarketLength +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + rangeMarketLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= rangeMarketLength) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +// Reading XTPowState from Indicatoe ... +XTPOWState GetXTPowState( + const int bar_index, + const int marketLen +) { + // + XTPOWState result = {}; + + // + // + double powerUp = 0; + double powerDown = 0; + double signal = 0; + + // + string indicatorName = "x-saherelm.xtpow"; + + // + int pUpIndex = 0; + int pDownIndex = 1; + int signalIndex = 2; + + // + powerUp = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pUpIndex, + bar_index + ); + + // + powerDown = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pDownIndex, + bar_index + ); + + // + signal = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + signalIndex, + bar_index + ); + + // + result.signal = signal; + result.powerUp = powerUp; + result.powerDown = powerDown; + + // + return result; +} + +// +// Reading XRState From Indicator ... +XRState ReadXRange( + const int bar_index, + const int marketLen +) { + // + XRState result = {}; + + // + // Define Buffer Indexes ... + int hhBufferIndex = 0; + int llBufferIndex = 1; + int midBufferIndex = 2; + + // + string indicatorName = "x-saherelm.xrange"; + + // + // Read Values From XRange Indicator ... + + // + double hh = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + hhBufferIndex, // Buffer Index ... + bar_index + ); + + // + double ll = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + llBufferIndex, // Buffer Index ... + bar_index + ); + + // + double mid = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + midBufferIndex, // Buffer Index ... + bar_index + ); + + // + // Filling Result ... + result.hh = hh; + result.ll = ll; + result.mid = mid; + + // + return result; +} +// +// END Indicator Reading Data ... +// diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..cc0e23e --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1662 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +static datetime lastBarTime; + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +struct XPrice { + // + double askPrice; + double bidPrice; + double priceGap; + + // + double longEntry; + double longExit; + + // + double shortEntry; + double shortExit; +}; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// Retrieve Moving Average ... +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Retrieve Market Current Prices for Signals ... +XPrice GetPrice() { + // + XPrice result = {}; + + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(bidPrice - askPrice); + + // + result.askPrice = askPrice; + result.bidPrice = bidPrice; + result.priceGap = priceGap; + + // + result.longEntry = askPrice; + result.longExit = bidPrice; + + // + result.shortEntry = bidPrice; + result.shortExit = askPrice; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.log.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.models.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..fa9903f --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,154 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER, + X_XTPW_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// Model Market Highs and Lows ... +struct XPvtState { + // + double hh; + double ho; + double hc; + double hl; + + // + double ll; + double lo; + double lc; + double lh; +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +struct XTPOWState { + // + double powerUp; + double powerDown; + + // + double signal; +}; +// +// End Models ... +// diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..097ce74 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1756 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" +#include "../Libraries/x-saherelm.xtpw.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetSignalProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + case X_XTPW_PROVIDER: + result = "XTPW"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetSignalProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XTPW_PROVIDER) + ) > -1 + ) { + result = X_XTPW_PROVIDER; + } + + // + return result; +} + +// +// Retrieve Signal Lots Per Trade ... +double GetSignalLottage( + const XSignal &signal, + const double defLotsPerTrade +) { + // + double result = defLotsPerTrade; + + // + bool isLong = signal.type == X_SIGNAL_LONG; + + // + switch (signal.provider) { + // + case X_XR_PROVIDER: + // + result = isLong ? + xRLongLotsPerTradePercent : + xRShortLotsPerTradePercent + ; + break; + + // + case X_XXX_PROVIDER: + // + result = isLong ? + xLongLotsPerTradePercent : + xShortLotsPerTradePercent + ; + break; + + // + case X_XTPW_PROVIDER: + // + result = isLong ? + xTPWLongLotsPerTradePercent : + xTPWShortLotsPerTradePercent + ; + break; + } + + // + return result; +} + +// +// Draw Specific Range On Chart ... +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetSignalProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetSignalProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetSignalProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetSignalProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_LONG + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderShortTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_SHORT + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isProviderVerified + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade, + const ENUM_X_SIGNAL_TYPE type = X_SIGNAL_NONE, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + string comment = OrderComment(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + bool isTypeVerified = + type == X_SIGNAL_NONE ? + true : + ( isLongOrder + && type == X_SIGNAL_LONG + ) || ( + !isLongOrder + && type == X_SIGNAL_SHORT + ) + ; + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isTypeVerified + && isProviderVerified + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + ( + openPrice < signal.entry + || MathAbs(openPrice - signal.entry) < 300 * _Point + ) + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); + ClearXTPWLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { + // + ClearXShortSignalConditions(); + ClearXRShortSignalConditions(); + ClearXTPWShortSignalConditions(); +} +// +// END Signal Conditions ... +// diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..8534420 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,1063 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xStarter = "- X Signal Provider -"; // ---> X Signal Provider <--- + +// +input bool enableXSignalling = false; // X Signalling Enable + +// +input bool enableXLong = true; // X Signalling Enable Long +input bool enableXShort = true; // X Signalling Enable Short + +// +input double xShortR2R = 3; // X Short Risk To Reward Ratio +input double xShortLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xShortMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Short Trade + +// +input double xLongR2R = 3; // X Long Risk To Reward Ratio +input double xLongLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xLongMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Long Trade + +// +input double xSharpDetectorFactor = 700; // X Sharp Detection Factor + +// +input int xMaximumCandlesPerTrade = 206; // X Maximum Candles which a Trade can open + +// +input int xOscillatorLength = 7; // X Oscillator Length + +// +input double xPSarStep = 0.02; // X Parabolic Sar Step +input double xPSarMaximum = 0.2; // X Parabolic Sar Maximum + +// +input int xRangeMarketLength = 5; // X Range Detector Length + +// +input int xSwingLength = 7; // X Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XMarketState { + double psar; + double fast; + double slow; + double open; + double verifier; + double oscillator; + double oscillatorVerifier; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; + +// +static XSignalConditions xShortConds; +static bool xCloseShortTrades = false; +static bool xWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xFailedSignals = 0; + +// +datetime lastVerifierTouched; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); + XTPOWState tPowState = GetXTPowState( + bar_index + 1, + xSwingLength + ); + + // + XMarketState state = GetXMarketState( + bar_index + 1 + ); + + // + // Check Verifier Last Touched ... + bool isVerifierTouched = pCandle.high > state.verifier + && pCandle.low < state.verifier; + + // + // Disable Signals if a signal Failed ... + if (xFailedSignals) { + // + // TODO: Complete this ... + } + + // + // Enable Or Disable Signalling ... + if (isVerifierTouched) { + // + lastVerifierTouched = barTime; + + // + if (xWaitForLongSignals) { + xWaitForLongSignals = false; + } + + // + if (xWaitForShortSignals) { + xWaitForShortSignals = false; + } + } else { + // + int lastVerifierTouchedBarIndex = iBarShift( + _Symbol, + _Period, + lastVerifierTouched + ); + + // + int distance = MathAbs(lastVerifierTouchedBarIndex - bar_index); + + // + if ( + !xWaitForLongSignals + && distance > (xSwingLength * 2) + ) { + xWaitForLongSignals = true; + } + + // + if ( + !xWaitForShortSignals + && ( + distance > (xSwingLength * 2) + || ( + tPowState.powerDown > tPowState.powerUp + && tPowState.powerDown < 49 + ) + ) + ) { + xWaitForShortSignals = true; + } + } + + // + // Close All Long Open Trades ... + if ( + tPowState.powerDown > 55 + && tPowState.powerDown > tPowState.powerUp + ) { + // xCloseLongTrades = true; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXLong + || !enableXSignalling + || !xWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXShort + || !enableXSignalling + || !xWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + xShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double reward = + requestLong ? + risk * xLongR2R : + risk * xShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + XRState range = GetXRange( + bar_index, + xRangeMarketLength + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + if ( + !enableXLong + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.entryTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + // && MathAbs(signalBarIndex - startBarIndex) >= 1 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXShortConditions() { + // + if ( + !enableXShort + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.entryTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.entryTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.entryTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve Range ... + XRState range = GetXRange( + signalBarIndex, + xRangeMarketLength + ); + + // + // Retrive XMarket States ... + XMarketState xState0 = GetXMarketState(signalBarIndex); + XMarketState xState1 = GetXMarketState(signalBarIndex + 1); + XMarketState xState2 = GetXMarketState(signalBarIndex + 2); + XMarketState xStateLast = GetXMarketState(signalBarIndex + xSwingLength); + + // + // Retrieve Trend Powers ... + XTPOWState xTPow0 = GetXTPowState( + signalBarIndex, + xSwingLength + ); + XTPOWState xTPow1 = GetXTPowState( + signalBarIndex + 1, + xSwingLength + ); + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (xSharpDetectorFactor * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry < hh + // + // && signal.entry < range.hh + // && signal.entry > range.mid + // // + // && candle.high > xState0.verifier + // && signal.entry > xState0.verifier + // + // && pCandle.low != ll + && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp < iTPowState.powerDown + || iTPowState.signal > MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers > 1 + && tPowUnverifyConditions == 0 + ; + + // + isPSarVerified = + xState0.psar < signal.entry + && xState0.psar < candle.low; + + // + isStateVerified = + // + // Start ... + true + // + // && xState0.open < xState0.slow + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + xState0.psar > signal.entry + && xState0.psar > candle.high + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry > ll + && pCandle.low != ll + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp > iTPowState.powerDown + || iTPowState.signal < MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers < 1 + && tPowUnverifyConditions == 0 + && MathAbs(xTPow0.powerUp - xTPow0.powerDown) > 50 * _Point + ; + + // + isStateVerified = + // + // Start ... + true + // + // && (xStateLast.verifier - xState0.verifier) >= 0 + // + && xState0.verifier > signal.entry + // + && MathAbs(signal.entry - xState0.verifier) < (xSharpDetectorFactor * _Point) + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XMarketState GetXMarketState( + const int bar_index +) { + // + XMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double slow = GetMA( + bar_index, + xSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double oscillator = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + double oscillatorVerifier = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xPSarStep, + xPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.open = open; + result.slow = slow; + result.verifier = verifier; + result.oscillator = oscillator; + result.oscillatorVerifier = oscillatorVerifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..53785cf --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,1142 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = false; // XR Signalling Enable + +// +input bool enableXRLong = true; // XR Signalling Enable Long +input bool enableXRShort = true; // XR Signalling Enable Short + +// +input double xRShortR2R = 1.5; // XR Short Risk To Reward Ratio +input double xRShortLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRShortMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Short Trade + +// +input double xRLongR2R = 1.5; // XR Long Risk To Reward Ratio +input double xRLongLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRLongMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Long Trade + +// +input int xRMaximumCandlesPerTrade = 96; // XR Maximum Candles which a Trade can open + +// +input int xRSwingLength = 48; // XR Swing Length +// +// END Inputs ... +// + +// +input double xRSharpDetectionFactor = 1350; // XR Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + double open; + + // + double range; + double rangeFast; + double rangeSlow; + double rangeOpen; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +static XRSignalConditions xRLongConds; +static bool xRCloseLongTrades = false; +static bool xRWaitForLongSignals = true; + +// +static XRSignalConditions xRShortConds; +static bool xRCloseShortTrades = false; +static bool xRWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xRFailedSignals = 0; + +// +double xRMaximumDrawDown = 0; + +// +int fastLength = 0; +int slowLength = 0; + +// +int verifierLength = 0; + +// +int rangeFastLength = 0; +int rangeSlowLength = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool longCondition1 = + // + // Starter ... + true + // + && isMarketBullish + // + && + ( + candle2.high < range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.low > range1.mid + ; + + // + if ( + // + ( + longCondition1 + ) + // + && xRLongConds.startTime == 0 + && xRLongConds.entryTime == 0 + && xRLongConds.signalTime == 0 + ) { + // + xRLongConds.startTime = barTime; + xRLongConds.entryTime = barTime; + xRLongConds.signalTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXRShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool shortCondition1 = + // + // Starter ... + true + // + && isMarketBearish + // + && + ( + candle2.low > range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.high < range1.mid + ; + + // + if ( + // + ( + shortCondition1 + ) + // + && xRShortConds.startTime == 0 + && xRShortConds.entryTime == 0 + && xRShortConds.signalTime == 0 + ) { + // + xRShortConds.startTime = barTime; + xRShortConds.entryTime = barTime; + xRShortConds.signalTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXRShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + XPvtState pvts = GetPVTState( + bar_index, + xRSwingLength + ); + XPrice prices = GetPrice(); + + // + double entryPrice = requestLong ? + prices.longEntry : + prices.shortEntry + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - pvts.ll : + pvts.hh - MathMax(openPrice, closePrice); + if (risk <= 0) { + // + risk = requestLong ? + MathAbs(pvts.hh - entryPrice) : + MathAbs(pvts.ll - entryPrice) + ; + } + + // + double reward = + requestLong ? + risk * xRLongR2R : + risk * xRShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + + // + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Long Signal Conditions ... +bool ValidateXRLongConditions() { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRLongConds.startTime > 0 + && xRLongConds.signalTime > 0 + && xRLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRLongConds.signalTime >= xRLongConds.startTime + && xRLongConds.entryTime >= xRLongConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Short Signal Conditions ... +bool ValidateXRShortConditions() { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRShortConds.startTime > 0 + && xRShortConds.signalTime > 0 + && xRShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRShortConds.signalTime >= xRShortConds.startTime + && xRShortConds.entryTime >= xRShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xRLongConds.startTime = 0; + xRLongConds.signalTime = 0; + xRLongConds.entryTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXRShortSignalConditions() { + // + xRShortConds.startTime = 0; + xRShortConds.signalTime = 0; + xRShortConds.entryTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + // Find Signal Bar Index ... + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + signalBarIndex, + xRSwingLength + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + XOHCL candle2 = GetCandleModel(signalBarIndex + 2); + XOHCL candle3 = GetCandleModel(signalBarIndex + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(signalBarIndex); + XRMarketState state1 = GetXRMarketState(signalBarIndex + 1); + XRMarketState state2 = GetXRMarketState(signalBarIndex + 2); + XRMarketState state3 = GetXRMarketState(signalBarIndex + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + signalBarIndex + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + signalBarIndex + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + signalBarIndex + xRSwingLength + 2, + xRSwingLength + ); + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + signalBarIndex + 2, + xRSwingLength + ); + + // + double hhllDiff = MathAbs(pvt0.hh - pvt0.ll); + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + bool isSharpOccured = hhllDiff > sharpDetectionValue; + + // + // Calculate State Min Max Diff ... + // + double state0Min = MathMin(state0.fast, state0.slow); + state0Min = MathMin(state0Min, state0.open); + state0Min = MathMin(state0Min, state0.rangeFast); + state0Min = MathMin(state0Min, state0.rangeSlow); + state0Min = MathMin(state0Min, state0.rangeOpen); + state0Min = MathMin(state0Min, state0.verifier); + + // + double state0Max = MathMax(state0.fast, state0.slow); + state0Max = MathMax(state0Max, state0.open); + state0Max = MathMax(state0Max, state0.rangeFast); + state0Max = MathMax(state0Max, state0.rangeSlow); + state0Max = MathMax(state0Max, state0.rangeOpen); + state0Max = MathMax(state0Max, state0.verifier); + + // + double state0MinMaxDiff = (state0Max - state0Min); + + // + bool isTPowValid = false; + bool isStateValid = false; + bool isRangeValid = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + // + // && !(state0MinMaxDiff > sharpDetectionValue) + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Calculate Market Lengths ... + + // + if (fastLength == 0) { + fastLength = xRSwingLength; + } + + // + if (slowLength == 0) { + slowLength = xRSwingLength * 2; + } + + // + if (verifierLength == 0) { + verifierLength = (GetDailyCandleCount() * 2); + } + + // + if (rangeFastLength == 0) { + rangeFastLength = (int)(verifierLength / 2); + } + + // + if (rangeSlowLength == 0) { + rangeSlowLength = verifierLength; + } + + // + // Reading Values ... + + // + double fast = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double slow = GetMA( + bar_index, + slowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double rangeFast = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeSlow = GetMA( + bar_index, + rangeSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeOpen = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double verifier = GetMA( + bar_index, + verifierLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + // Filling Result ... + result.fast = fast; + result.slow = slow; + result.open = open; + result.verifier = verifier; + result.rangeFast = rangeFast; + result.rangeSlow = rangeSlow; + result.rangeOpen = rangeOpen; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/BTCUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 b/Bkp/BTCUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 new file mode 100644 index 0000000..11c7340 --- /dev/null +++ b/Bkp/BTCUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 @@ -0,0 +1,1251 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XTPW Signal Global Library +// --------------------------------------------------- +// XSaherElm EA Signal Provider based on +// XTPow Indicator... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xTPWStarter = "- XTPW Signal Provider -"; // ---> XTPW Signal Provider <--- + +// +input bool enableXTPWSignalling = true; // XTPW Signalling Enable + +// +input bool enableXTPWLong = true; // XTPW Signalling Enable Long +input bool enableXTPWShort = false; // XTPW Signalling Enable Short + +// +input double xTPWShortR2R = 2; // XTPW Short Risk To Reward Ratio +input double xTPWShortLotsPerTradePercent = 0.0002; // XTPW Lots Percent per Short Trades +input double xTPWShortMaxDrawdownPerTradePercent = 0.3; // XTPW Max Allowed DrawDown Percent per Short Trade + +// +input double xTPWLongR2R = 3; // XTPW Long Risk To Reward Ratio +input double xTPWLongLotsPerTradePercent = 0.00001; // XTPW Lots Percent per Short Trades +input double xTPWLongMaxDrawdownPerTradePercent = 0.03; // XTPW Max Allowed DrawDown Percent per Long Trade + +// +input int xTPWMaximumCandlesPerTrade = 144; // XTPW Maximum Candles which a Trade can open + +// +input double xTPWPSarStep = 0.02; // XTPW Parabolic Sar Step +input double xTPWPSarMaximum = 0.2; // XTPW Parabolic Sar Maximum + +// +input int xTPWSwingLength = 7; // XTPW Signal Swing Length +// +// END Inputs ... +// + +// +input double xTPWSharpDetectionFactor = 650; // XTPW Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XTPW Based Signal Conditions ... +struct XTPWSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XTPWMarketState { + // + double psar; + + // + double scFast; + double scSlow; + double scWeight; + + // + double mcFast; + double mcSlow; + double mcWeight; + + // + double lcFast; + double lcSlow; + double lcWeight; +}; + +// +struct XLHS { + // + double scHH; + double scLL; + + // + double mcHH; + double mcLL; + + // + double lcHH; + double lcLL; +}; + +// +static XTPWSignalConditions xTPWLongConds; +static bool xTPWCloseLongTrades = false; +static bool xTPWWaitForLongSignals = true; + +// +static XTPWSignalConditions xTPWShortConds; +static bool xTPWCloseShortTrades = false; +static bool xTPWWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xTPWFailedSignals = 0; + +// +double tPowerVerifier = 20; +double tPowerMaxVerifier = 55; + +// +int scFastLength = 0; +int scSlowLength = 0; + +// +int mcFastLength = 0; +int mcSlowLength = 0; + +// +int lcFastLength = 0; +int lcSlowLength = 0; + +// +datetime lastTurnOffLongTradesTime; +datetime lastTurnOffShortTradesTime; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXTPWSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 1); + + // + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // // + // // Disable Long Conditions ... + // if ( + // xTPWWaitForLongSignals + // && + // ( + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperAboveMaxVerifier + // ) + // ) { + // // + // xTPWWaitForLongSignals = false; + // lastTurnOffLongTradesTime = barTime; + // } + + // // + // // Enable Long Conditions ... + // if ( + // !xTPWWaitForLongSignals + // && lastTurnOffLongTradesTime > 0 + // && ( + // // isFastCrossOverSlow + // // || + // // isFastCrossUnderSlow + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperBelowMaxVerifier + // ) + // ) { + // // + // // Find Last Turn Off Bar Index ... + // int lastTurnOffLongTradesBarIndex = iBarShift( + // _Symbol, + // _Period, + // lastTurnOffLongTradesTime + // ); + + // // + // // the Distance must be bigger than market length ... + // if (MathAbs(lastTurnOffLongTradesBarIndex - bar_index) > xTPWSwingLength) { + // // + // xTPWWaitForLongSignals = true; + // lastTurnOffLongTradesTime = 0; + // } + // } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXTPWLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + || !xTPWWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPow States ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPowMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve XPrice Model ... + XPrice prices = GetPrice(); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XLHS lhs = GetXTPWLHS(bar_index); + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool longCondition1 = + // + true + // + && tPow2.powerDown > tPow2.powerUp + && tPow1.powerUp > tPow1.powerDown + && tPow1.powerUp > tPowerVerifier + && tPow1.powerUp < tPowerMaxVerifier + ; + + // + // Start Conditions ... + startCondition = ( + longCondition1 + ) + ; + + // + if ( + startCondition + && xTPWLongConds.startTime == 0 + && xTPWLongConds.signalTime == 0 + && xTPWLongConds.entryTime == 0 + ) { + // + xTPWLongConds.startTime = barTime; + xTPWLongConds.signalTime = barTime; + xTPWLongConds.entryTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXTPWShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPower State ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPWMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XPrice prices = GetPrice(); + XLHS lhs = GetXTPWLHS(bar_index); + + // + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool shortCondition1 = + // + true + // + && tPow1.powerDown > tPowerMaxVerifier + && tPow2.powerDown < tPowerMaxVerifier + ; + + // + startCondition = ( + shortCondition1 + ) + ; + + // + if ( + startCondition + && xTPWShortConds.startTime == 0 + && xTPWShortConds.signalTime == 0 + && xTPWShortConds.entryTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXTPWSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + // Check Condition Validations ... + if (requestLong) { + // + // Check Long Condtion is Valid, if Long Requested ... + if ( + !ValidateXTPWLongConditions() + ) { + return result; + } + } else { + // + // Check Short Condtion is Valid, if Short Requested ... + if ( + !ValidateXTPWShortConditions() + ) { + return result; + } + } + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xTPWSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xTPWSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + // Price Calculations ... + XPrice prices = GetPrice(); + + // + // Read State ... + XTPWMarketState state0 = GetXTPWMarketState(bar_index); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 2); + + // + double risk = requestLong ? + // + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double longR2R = xTPWLongR2R; + double shortR2R = xTPWShortR2R; + + // + double sharpDetectorValue = xTPWSharpDetectionFactor * _Point; + + // + if ( + risk > 0 + && requestLong + ) { + return result; + } + + // + // Define Entry Price ... + double entryPrice = requestLong + ? + prices.longEntry + : + prices.shortEntry + ; + + // + // Fix TP Detects for Short Signals ... + if (!requestLong) { + risk = 0; + } + + // + double reward = requestLong ? + risk * longR2R : + risk * shortR2R + ; + + // + if (risk == 0) { + // + // Calculate Reward ... + reward = requestLong + ? + MathAbs(hh - entryPrice) + : + MathAbs(hh - entryPrice) + ; + + // + // Detect Sharp Change Occured or not ... + bool isSharpOccured = reward > sharpDetectorValue + || MathAbs(reward - sharpDetectorValue) < (50 * _Point); + + // + // Change Rewards on Special Conditions ... + if ( + ( + requestLong + && isSharpOccured + && ( + state0.lcFast < state0.lcSlow + || ( + state0.mcFast > state0.mcSlow + && state0.mcWeight < state0.mcSlow + ) + ) + ) + ) { + reward = reward / 2; + } + + // + if (reward < 50 * _Point) { + reward = (50 * _Point) + prices.priceGap; + } + + // // + // if (!requestLong) { + // reward = reward * shortR2R; + // } + } + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XTPW_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XTPW_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWLongConditions() { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime > 0 + && xTPWLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + // Starter ... + true + // + && xTPWLongConds.signalTime >= xTPWLongConds.startTime + && xTPWLongConds.entryTime >= xTPWLongConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWShortConditions() { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime > 0 + && xTPWShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.entryTime + // ); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWShortConds.signalTime >= xTPWShortConds.startTime + && xTPWShortConds.entryTime >= xTPWShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXTPWLongSignalConditions() { + // + xTPWLongConds.startTime = 0; + xTPWLongConds.entryTime = 0; + xTPWLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXTPWShortSignalConditions() { + // + xTPWShortConds.startTime = 0; + xTPWShortConds.entryTime = 0; + xTPWShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXTPWSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve TPow State ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xTPWSwingLength + ); + + // + // Retrive XMarket States ... + XTPWMarketState state0 = GetXTPWMarketState(signalBarIndex); + XTPWMarketState state1 = GetXTPWMarketState(signalBarIndex + 1); + XTPWMarketState state2 = GetXTPWMarketState(signalBarIndex + 2); + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Calculate Sharp Detection Value ... + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + // Find State0 Min ... + double state0Min = MathMin(state0.scFast, state0.scSlow); + state0Min = MathMin(state0Min, state0.mcFast); + state0Min = MathMin(state0Min, state0.mcSlow); + state0Min = MathMin(state0Min, state0.lcFast); + state0Min = MathMin(state0Min, state0.lcSlow); + + // + // Find State0 Min ... + double state0Max = MathMax(state0.scFast, state0.scSlow); + state0Max = MathMax(state0Max, state0.mcFast); + state0Max = MathMax(state0Max, state0.mcSlow); + state0Max = MathMax(state0Max, state0.lcFast); + state0Max = MathMax(state0Max, state0.lcSlow); + + // + // Find Distance Between State0 Min and Max ... + double state0MinMaxDistance = MathAbs(state0Max - state0Min); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + ; + + // + isTPowVerified = + // + // Starter ... + true + ; + + // + isPSarVerified = + // + // Starter ... + true + // + ; + + // + isStateVerified = + // + // Start ... + true + // + && state0.lcSlow > 0 + && state0.lcFast > state0.lcSlow + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + // + // Starter ... + true + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + ; + + // + isStateVerified = + // + // Start ... + true + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +// +// Retrieve Market State ... +XTPWMarketState GetXTPWMarketState( + const int bar_index +) { + // + XTPWMarketState result = {}; + + // + int dayCount = GetDailyCandleCount(); + int halfDayCount = (int)(dayCount / 2); + + // + if (scFastLength == 0) { + scFastLength = xTPWSwingLength; + } + + // + if (scSlowLength == 0) { + scSlowLength = xTPWSwingLength * 2; + } + + // + if (mcFastLength == 0) { + mcFastLength = halfDayCount; + } + + // + if (mcSlowLength == 0) { + mcSlowLength = dayCount; + } + + // + if (lcFastLength == 0) { + lcFastLength = halfDayCount * 3; + } + + // + if (lcSlowLength == 0) { + lcSlowLength = dayCount * 3; + } + + // + double scFast = GetMA( + bar_index, + scFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scSlow = GetMA( + bar_index, + scSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scWeight = GetMA( + bar_index, + scSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double mcFast = GetMA( + bar_index, + mcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcSlow = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcWeight = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double lcFast = GetMA( + bar_index, + lcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcSlow = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcWeight = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xTPWPSarStep, + xTPWPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.scFast = scFast; + result.scSlow = scSlow; + result.mcFast = mcFast; + result.mcSlow = mcSlow; + result.lcFast = lcFast; + result.lcSlow = lcSlow; + result.scWeight = scWeight; + result.mcWeight = mcWeight; + result.lcWeight = lcWeight; + + // + return result; +} + +// +// Retrieve Highest Highs and Lowest Lows in Cycles ... +XLHS GetXTPWLHS( + const int bar_index +) { + // + XLHS result = {}; + + // + // Retrieve LL and HH (s) ... + + // + // SC HH ... + double scHH = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // SC LL ... + double scLL = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // MC HH ... + double mcHH = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // MC LL ... + double mcLL = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // LC HH ... + double lcHH = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + // LC LL ... + double lcLL = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + result.scHH = scHH; + result.scLL = scLL; + result.mcHH = mcHH; + result.mcLL = mcLL; + result.lcHH = lcHH; + result.lcLL = lcLL; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/UnUsed/Experts/x-saherelm.osc.1.ea.mq4 b/Bkp/UnUsed/Experts/x-saherelm.osc.1.ea.mq4 new file mode 100644 index 0000000..e197cbf --- /dev/null +++ b/Bkp/UnUsed/Experts/x-saherelm.osc.1.ea.mq4 @@ -0,0 +1,733 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST_OSC Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// +// ShortName: XST_OSC +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST_OSC Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_OSC"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.0001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.2; // Maximum Trade Equity + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// Power OSC ... +input double minPowerOSC = 0; // Minimum Signal Power + +// +// Variance OSC ... +input double minVarianceOSC = 0; // Minimum Var Power + +// +// ZIGZAG Inputs ... +input int zDeviation = 5; // ZigZag Deviation +input int zBackStep = 3; // ZigZag Back Step + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = false; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int totalBars; +int countedBars = 0; +int lastSignalledBar = 0; + +// +int signalTradeRetry = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.osc.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || minPowerOSC < 0 + || minVarianceOSC < 0 + || slowOSCLength <= fastOSCLength + // + // ZIGZAG ... + || zDeviation < 0 + || zBackStep < 0 + || zBackStep >= marketLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + ArraySetAsSeries( + scTrendPower, + true + ); + + // + ArraySetAsSeries( + shortMarketCrossPointsTime, + true + ); + + // + ArraySetAsSeries( + mcTrendPower, + true + ); + + // + ArraySetAsSeries( + mediumMarketCrossPointsTime, + true + ); + + // + ArraySetAsSeries( + lcTrendPower, + true + ); + + // + ArraySetAsSeries( + longMarketCrossPointsTime, + true + ); + + // + // here we specify logging enabled or not ... + enableLogging = false; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_OSC"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State in Big Picture ... + + // + // Retrieve XMA State ... + // XMAState xmaState = GetXMAState( + // // + // // Bar Index ... + // 0, + // // + // // Market Specification Inpouts ... + // marketLength, // Market Length ... + // // + // // XMA Inputs ... + // shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + // shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + // mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + // mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + // longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + // longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // // + // // Show/Hide Inputs ... + // showShortCycle, + // showShortCycleCrossLines, + // showMediumCycle, + // showMediumCycleCrossLines, + // showLongCycle, + // showLongCycleCrossLines, + // // + // // Color Inputs ... + // shortCycleFastColor, + // shortCycleSlowColor, + // mediumCycleFastColor, + // mediumCycleSlowColor, + // longCycleFastColor, + // longCycleSlowColor + // ); + + // // + // bool isMCFastCrossUnderSCSlow = + // xmaState.mcFast < xmaState.scSlow + // && !(xmaState.mcFastPrev < xmaState.scSlowPrev); + + // // + // if ( + // waitForLongSignals + // && xmaState.isSCTrendDown + // && isMCFastCrossUnderSCSlow + // ) { + // // + // closeLongTrades = true; + // waitForLongSignals = false; + + // // // + // // string message = "Pause Long Trades ..."; + + // // // + // // LogMessage(message); + + // // + // return; + // } + + // // + // if ( + // !waitForLongSignals + // && xmaState.isSCFastCrossOverSlow + // ) { + // // + // waitForLongSignals = true; + + // // // + // // string message = "Play Long Trades ..."; + + // // // + // // LogMessage(message); + + // // + // return; + // } +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + // Prevent Multiple Calculating on Same Bars ... + if (IsNewBar()) { + // // + // LogMessage( + // StringConcatenate( + // "Current Time: ", + // TimeCurrent() + // ) + // ); + + // + countedBars++; + } + + // + // Retrieve Signal Exists ... + XSignalRequest request = CalculateSignal( + // + // Bar Index ... + 0, + // + // Market Specification Inpouts ... + marketLength, // Market Length ... + // + // Risk To Reward Ratio ... + riskToRewardRatio, + // + // XMA Inputs ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + // + // OSC ... + fastOSCLength, // FastOSC Length ... + fastOSCMultiplier, // FastOSC Multiplier ... + slowOSCLength, // SlowOSC Length ... + slowOSCMultiplier, // SlowOSC Multiplier ... + minPowerOSC, // Minimum Signal Power ... + minVarianceOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + zDeviation, // ZigZag Deviation ... + zBackStep // ZigZag Back Step ... + ); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + if (lastSignalledBar == countedBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + bool allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + + // + if ( + !allowDoTrade + && signalTradeRetry < 2 + ) { + // + signalTradeRetry++; + CloseAllInProfitTrades(); + ProcessSignals(); + } else { + signalTradeRetry = 0; + } + } + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Max Open Trades (", + // maxOpenTrades, + // ") reached ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Verification ... + bool isVerified = true; + if (!isVerified) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Signal Verification failed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if (closeLongTrades) { + // + closeLongTrades = false; + + // // + // CloseAllLongTrades(); + // LogMessage("Close All Long Trades ..."); + } + + // + if (closeShortTrades) { + // + closeShortTrades = false; + // CloseAllShortTrades(); + // LogMessage("Close All Short Trades ..."); + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Experts/x-saherelm.xma.ea.mq4 b/Bkp/UnUsed/Experts/x-saherelm.xma.ea.mq4 new file mode 100644 index 0000000..bc16075 --- /dev/null +++ b/Bkp/UnUsed/Experts/x-saherelm.xma.ea.mq4 @@ -0,0 +1,700 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST_XMA Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// +// ShortName: XST_XMA +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST_XMA Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_XMA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.0001; // Lots Per Trade Percent +input int maxOpenTrades = 3; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// XMA Inputs ... +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio +// +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = false; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int totalBars; +int countedBars = 0; +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.xma.signal.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XST_XMA"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + ArraySetAsSeries( + scTrendPower, + true + ); + + // + ArraySetAsSeries( + shortMarketCrossPointsTime, + true + ); + + // + ArraySetAsSeries( + mcTrendPower, + true + ); + + // + ArraySetAsSeries( + mediumMarketCrossPointsTime, + true + ); + + // + ArraySetAsSeries( + lcTrendPower, + true + ); + + // + ArraySetAsSeries( + longMarketCrossPointsTime, + true + ); + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + // ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State in Big Picture ... + + // + // Check if Medium Cycle Fast cross Short Cycle Slow + // Turn off Longs ... + + // // + // if ( + // waitForLongSignals + // && ( + // xmaState.isMCFastCrossUnderSlow || + // xmaState.isLCFastCrossUnderSlow + // ) + // ) { + // // + // closeLongTrades = true; + // waitForLongSignals = false; + + // // + // string msg = "Pause Long Handler ..."; + // LogMessage(msg); + // SendAlert(msg); + // return; + // } + + // // + // if ( + // !waitForLongSignals + // && ( + // xmaState.isMCFastCrossOverSlow || + // xmaState.isLCFastCrossOverSlow + // ) + // ) { + // // + // closeShortTrades = true; + // waitForLongSignals = true; + + // // + // string msg = "Play Long Handler ..."; + // LogMessage(msg); + // SendAlert(msg); + // return; + // } + + // // + // bool isXMASlowCrossOverXMMALongFast = + // xmaState.xmaSlow > xmmaState.longFast + // && !( + // xmaState.xmaSlowPrev > xmmaState.longFastPrev + // ); + + // // + // bool isXMASlowCrossOverXMMALongSlow = + // xmaState.xmaSlow > xmmaState.longSlow + // && !( + // xmaState.xmaSlowPrev > xmmaState.longSlowPrev + // ); + + // // + // bool isXMASlowCrossUnderXMMALongFast = + // xmaState.xmaSlow < xmmaState.longFast + // && !( + // xmaState.xmaSlowPrev < xmmaState.longFastPrev + // ); + + // // + // bool isXMASlowCrossUnderXMMALongSlow = + // xmaState.xmaSlow < xmmaState.longSlow + // && !( + // xmaState.xmaSlowPrev < xmmaState.longSlowPrev + // ); + + // // + // // Find Sharp Dump and Sharp Pump ... + // bool isMarketSharpDump = false; + + // // + // bool isMarketSharpPump = false; + + // // // + // // if ( + // // waitForLongSignals + // // && ( + // // isMarketSharpDump || + // // isXMASlowCrossOverXMMALongFast + // // ) + // // ) { + // // // + // // closeLongTrades = true; + // // waitForLongSignals = false; + + // // // + // // string msg = "Pause Long Handler ..."; + // // LogMessage(msg); + // // SendAlert(msg); + // // return; + // // } + + // // // + // // if ( + // // !waitForLongSignals + // // && ( + // // isMarketSharpPump || + // // isXMASlowCrossOverXMMALongSlow + // // ) + // // ) { + // // // + // // closeShortTrades = true; + // // waitForLongSignals = true; + + // // // + // // string msg = "Play Long Handler ..."; + // // LogMessage(msg); + // // SendAlert(msg); + // // return; + // // } +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + // Prevent Multiple Calculating on Same Bars ... + if (IsNewBar()) { + countedBars++; + } + + // + // Retrieve Signal Exists ... + XSignalRequest request = CalculateSignal( + // + // Bar Index ... + 0, + // + // Market Specification Inpouts ... + marketLength, // Market Length ... + // + // Risk To Reward Ratio ... + riskToRewardRatio, + // + // XMA Inputs ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showShortCycle, + showShortCycleCrossLines, + showMediumCycle, + showMediumCycleCrossLines, + showLongCycle, + showLongCycleCrossLines, + // + // Color Inputs ... + shortCycleFastColor, + shortCycleSlowColor, + mediumCycleFastColor, + mediumCycleSlowColor, + longCycleFastColor, + longCycleSlowColor + ); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + if (lastSignalledBar == countedBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + bool allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + } + } + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + + // + // Retrieve Signal Verification ... + bool isVerified = true; + if (!isVerified) { + // + allowDoTrade = false; + + // + string message = StringConcatenate( + "Trading Pause => ", + "Signal Verification failed ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if (closeLongTrades) { + // + closeLongTrades = false; + + // + CloseAllLongTrades(); + LogMessage("Close All Long Trades ..."); + } + + // + if (closeShortTrades) { + // + closeShortTrades = false; + CloseAllShortTrades(); + LogMessage("Close All Short Trades ..."); + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/ParabolicSar.mq4 b/Bkp/UnUsed/Indicators/ParabolicSar.mq4 new file mode 100644 index 0000000..261808a --- /dev/null +++ b/Bkp/UnUsed/Indicators/ParabolicSar.mq4 @@ -0,0 +1,333 @@ +//------------------------------------------------------------------ +#property copyright "www.forex-station.com" +#property link "www.forex-station.com" +//------------------------------------------------------------------ +#property indicator_chart_window +#property indicator_buffers 4 +#property indicator_color1 clrLimeGreen +#property indicator_color2 clrOrange +#property indicator_color3 clrLimeGreen +#property indicator_color4 clrOrange +#property indicator_width3 3 +#property indicator_width4 3 +#property strict + +// +// +// +// +// + +extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame to use +extern double AccStep = 0.02; // Accumulation step +extern double AccLimit = 0.2; // Accumulation limit +extern ENUM_APPLIED_PRICE PriceHigh = PRICE_CLOSE; // Psar high price +extern ENUM_APPLIED_PRICE PriceLow = PRICE_CLOSE; // Psar low price +extern int PriceSmoothing = 0; // Psar smoothing +extern ENUM_MA_METHOD PriceSmoothingMethod = MODE_SMA; // Psar ma smoothing method +extern bool alertsOn = true; // Alerts on? +extern bool alertsOnCurrent = false; // Alerts on current open bar? +extern bool alertsMessage = true; // Alerts message? +extern bool alertsSound = false; // Alerts sound? +extern bool alertsEmail = false; // Alerts email? +extern bool alertsNotify = false; // Alerts notification by phone? +extern bool DrawAsDots = true; // Draw as dots or solid line +extern int Shift = 0; // Shift + +double sarUp[]; +double sarDn[]; +double saraUp[]; +double saraDn[]; +int timeFrame; +string indicatorFileName; +bool returnBars; + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +int init() +{ + int type = DRAW_LINE; if (DrawAsDots) type = DRAW_ARROW; + SetIndexBuffer(0,sarUp); SetIndexStyle(0,type); SetIndexArrow(0,159); + SetIndexBuffer(1,sarDn); SetIndexStyle(1,type); SetIndexArrow(1,159); + SetIndexBuffer(2,saraUp); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); + SetIndexBuffer(3,saraDn); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,159); + + // + // + // + // + // + + indicatorFileName = WindowExpertName(); + returnBars = (TimeFrame==-99); + TimeFrame = MathMax(TimeFrame,_Period); + PriceSmoothing = MathMax(PriceSmoothing,1); + for (int i=0; i<4; i++) SetIndexShift(i,Shift*timeFrame/Period()); + + // + // + // + // + // + + return(0); +} +int deinit() { return(0); } + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +int start() +{ + int i,counted_bars=IndicatorCounted(); + if(counted_bars < 0) return(-1); + if(counted_bars>0) counted_bars--; + int limit = MathMin(Bars-counted_bars,Bars-1); + if (returnBars) { sarUp[0] = limit+1; return(0); } + + // + // + // + // + // + + if (TimeFrame == Period()) + { + for(i = limit; i >= 0; i--) + { + double sarClose; + double sarOpen; + double sarPosition; + double sarChange; + double pHigh = iMA(NULL,0,PriceSmoothing,0,PriceSmoothingMethod,PriceHigh,i); + double pLow = iMA(NULL,0,PriceSmoothing,0,PriceSmoothingMethod,PriceLow ,i); + iParabolic(fmax(pHigh,pLow),fmin(pHigh,pLow),AccStep,AccLimit,sarClose,sarOpen,sarPosition,sarChange,i); + sarUp[i] = EMPTY_VALUE; + sarDn[i] = EMPTY_VALUE; + saraUp[i] = EMPTY_VALUE; + saraDn[i] = EMPTY_VALUE; + if (sarPosition==1) + sarUp[i] = sarClose; + else sarDn[i] = sarClose; + if (sarChange!=0) + if (sarChange==1) + saraUp[i] = sarClose; + else saraDn[i] = sarClose; + } + manageAlerts(); + return(0); + } + + // + // + // + // + // + + limit = (int)fmax(limit,fmin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period())); + for(i=limit; i>=0; i--) + { + int y = iBarShift(NULL,TimeFrame,Time[i]); + int x = iBarShift(NULL,TimeFrame,Time[i+1]); + sarUp[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,0,y); + sarDn[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,1,y); + saraUp[i] = EMPTY_VALUE; + saraDn[i] = EMPTY_VALUE; + if (x!=y) + { + saraUp[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,2,y); + saraDn[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,3,y); + } + } + return(0); + +} + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +double work[][7]; +#define _high 0 +#define _low 1 +#define _ohigh 2 +#define _olow 3 +#define _open 4 +#define _position 5 +#define _af 6 + + +void iParabolic(double high, double low, double step, double limit, double& pClose, double& pOpen, double& pPosition, double& pChange, int i) +{ + if (ArrayRange(work,0)!=Bars) ArrayResize(work,Bars); i = Bars-i-1; + + // + // + // + // + // + + pChange = 0; + work[i][_ohigh] = high; + work[i][_olow] = low; + if (i<1) + { + work[i][_high] = high; + work[i][_low] = low; + work[i][_open] = high; + work[i][_position] = -1; + return; + } + work[i][_open] = work[i-1][_open]; + work[i][_af] = work[i-1][_af]; + work[i][_position] = work[i-1][_position]; + work[i][_high] = fmax(work[i-1][_high],high); + work[i][_low] = fmin(work[i-1][_low] ,low ); + + // + // + // + // + // + + if (work[i][_position] == 1) + if (low<=work[i][_open]) + { + work[i][_position] = -1; + pChange = -1; + pClose = work[i][_high]; + work[i][_high] = high; + work[i][_low] = low; + work[i][_af] = step; + work[i][_open] = pClose + work[i][_af]*(work[i][_low]-pClose); + if (work[i][_open]work[i-1][_high] && work[i][_af]work[i ][_olow]) work[i][_open] = work[i ][_olow]; + if (work[i][_open]>work[i-1][_olow]) work[i][_open] = work[i-1][_olow]; + } + else + if (high>=work[i][_open]) + { + work[i][_position] = 1; + pChange = 1; + pClose = work[i][_low]; + work[i][_low] = low; + work[i][_high] = high; + work[i][_af] = step; + work[i][_open] = pClose + work[i][_af]*(work[i][_high]-pClose); + if (work[i][_open]>work[i ][_olow]) work[i][_open] = work[i ][_olow]; + if (work[i][_open]>work[i-1][_olow]) work[i][_open] = work[i-1][_olow]; + } + else + { + pClose = work[i][_open]; + if (work[i][_low]=0; i--) + if (tf==iTfTable[i]) return(sTfTable[i]); + return(""); +} \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/SimplePanel/PanelDialog.mqh b/Bkp/UnUsed/Indicators/SimplePanel/PanelDialog.mqh new file mode 100644 index 0000000..2004efe --- /dev/null +++ b/Bkp/UnUsed/Indicators/SimplePanel/PanelDialog.mqh @@ -0,0 +1,359 @@ +//+------------------------------------------------------------------+ +//| PanelDialog.mqh | +//| Copyright 2009-2015, MetaQuotes Software Corp. | +//| http://www.mql5.com | +//+------------------------------------------------------------------+ +#include +#include +#include +#include +#include +#include +#include +#include +//+------------------------------------------------------------------+ +//| defines | +//+------------------------------------------------------------------+ +//--- indents and gaps +#define INDENT_LEFT (11) // indent from left (with allowance for border width) +#define INDENT_TOP (11) // indent from top (with allowance for border width) +#define INDENT_RIGHT (11) // indent from right (with allowance for border width) +#define INDENT_BOTTOM (11) // indent from bottom (with allowance for border width) +#define CONTROLS_GAP_X (10) // gap by X coordinate +#define CONTROLS_GAP_Y (10) // gap by Y coordinate +//--- for buttons +#define BUTTON_WIDTH (100) // size by X coordinate +#define BUTTON_HEIGHT (20) // size by Y coordinate +//--- for the indication area +#define EDIT_HEIGHT (20) // size by Y coordinate +//+------------------------------------------------------------------+ +//| Class CPanelDialog | +//| Usage: main dialog of the SimplePanel application | +//+------------------------------------------------------------------+ +class CPanelDialog : public CAppDialog + { +private: + CEdit m_edit; // the display field object + CButton m_button1; // the button object + CButton m_button2; // the button object + CButton m_button3; // the fixed button object + CListView m_list_view; // the list object + CRadioGroup m_radio_group; // the radio buttons group object + CCheckGroup m_check_group; // the check box group object + +public: + CPanelDialog(void); + ~CPanelDialog(void); + //--- create + virtual bool Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2); + //--- chart event handler + virtual bool OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam); + +protected: + //--- create dependent controls + bool CreateEdit(void); + bool CreateButton1(void); + bool CreateButton2(void); + bool CreateButton3(void); + bool CreateRadioGroup(void); + bool CreateCheckGroup(void); + bool CreateListView(void); + //--- internal event handlers + virtual bool OnResize(void); + //--- handlers of the dependent controls events + void OnClickButton1(void); + void OnClickButton2(void); + void OnClickButton3(void); + void OnChangeRadioGroup(void); + void OnChangeCheckGroup(void); + void OnChangeListView(void); + bool OnDefault(const int id,const long &lparam,const double &dparam,const string &sparam); + }; +//+------------------------------------------------------------------+ +//| Event Handling | +//+------------------------------------------------------------------+ +EVENT_MAP_BEGIN(CPanelDialog) +ON_EVENT(ON_CLICK,m_button1,OnClickButton1) +ON_EVENT(ON_CLICK,m_button2,OnClickButton2) +ON_EVENT(ON_CLICK,m_button3,OnClickButton3) +ON_EVENT(ON_CHANGE,m_radio_group,OnChangeRadioGroup) +ON_EVENT(ON_CHANGE,m_check_group,OnChangeCheckGroup) +ON_EVENT(ON_CHANGE,m_list_view,OnChangeListView) +ON_OTHER_EVENTS(OnDefault) +EVENT_MAP_END(CAppDialog) +//+------------------------------------------------------------------+ +//| Constructor | +//+------------------------------------------------------------------+ +CPanelDialog::CPanelDialog(void) + { + } +//+------------------------------------------------------------------+ +//| Destructor | +//+------------------------------------------------------------------+ +CPanelDialog::~CPanelDialog(void) + { + } +//+------------------------------------------------------------------+ +//| Create | +//+------------------------------------------------------------------+ +bool CPanelDialog::Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2) + { + if(!CAppDialog::Create(chart,name,subwin,x1,y1,x2,y2)) + return(false); +//--- create dependent controls + if(!CreateEdit()) + return(false); + if(!CreateButton1()) + return(false); + if(!CreateButton2()) + return(false); + if(!CreateButton3()) + return(false); + if(!CreateRadioGroup()) + return(false); + if(!CreateCheckGroup()) + return(false); + if(!CreateListView()) + return(false); +//--- succeed + return(true); + } +//+------------------------------------------------------------------+ +//| Create the display field | +//+------------------------------------------------------------------+ +bool CPanelDialog::CreateEdit(void) + { +//--- coordinates + int x1=INDENT_LEFT; + int y1=INDENT_TOP; + int x2=ClientAreaWidth()-(INDENT_RIGHT+BUTTON_WIDTH+CONTROLS_GAP_X); + int y2=y1+EDIT_HEIGHT; +//--- create + if(!m_edit.Create(m_chart_id,m_name+"Edit",m_subwin,x1,y1,x2,y2)) + return(false); + if(!m_edit.ReadOnly(true)) + return(false); + if(!Add(m_edit)) + return(false); + m_edit.Alignment(WND_ALIGN_WIDTH,INDENT_LEFT,0,INDENT_RIGHT+BUTTON_WIDTH+CONTROLS_GAP_X,0); +//--- succeed + return(true); + } +//+------------------------------------------------------------------+ +//| Create the "Button1" button | +//+------------------------------------------------------------------+ +bool CPanelDialog::CreateButton1(void) + { +//--- coordinates + int x1=ClientAreaWidth()-(INDENT_RIGHT+BUTTON_WIDTH); + int y1=INDENT_TOP; + int x2=x1+BUTTON_WIDTH; + int y2=y1+BUTTON_HEIGHT; +//--- create + if(!m_button1.Create(m_chart_id,m_name+"Button1",m_subwin,x1,y1,x2,y2)) + return(false); + if(!m_button1.Text("Button1")) + return(false); + if(!Add(m_button1)) + return(false); + m_button1.Alignment(WND_ALIGN_RIGHT,0,0,INDENT_RIGHT,0); +//--- succeed + return(true); + } +//+------------------------------------------------------------------+ +//| Create the "Button2" button | +//+------------------------------------------------------------------+ +bool CPanelDialog::CreateButton2(void) + { +//--- coordinates + int x1=ClientAreaWidth()-(INDENT_RIGHT+BUTTON_WIDTH); + int y1=INDENT_TOP+BUTTON_HEIGHT+CONTROLS_GAP_Y; + int x2=x1+BUTTON_WIDTH; + int y2=y1+BUTTON_HEIGHT; +//--- create + if(!m_button2.Create(m_chart_id,m_name+"Button2",m_subwin,x1,y1,x2,y2)) + return(false); + if(!m_button2.Text("Button2")) + return(false); + if(!Add(m_button2)) + return(false); + m_button2.Alignment(WND_ALIGN_RIGHT,0,0,INDENT_RIGHT,0); +//--- succeed + return(true); + } +//+------------------------------------------------------------------+ +//| Create the "Button3" fixed button | +//+------------------------------------------------------------------+ +bool CPanelDialog::CreateButton3(void) + { +//--- coordinates + int x1=ClientAreaWidth()-(INDENT_RIGHT+BUTTON_WIDTH); + int y1=ClientAreaHeight()-(INDENT_BOTTOM+BUTTON_HEIGHT); + int x2=x1+BUTTON_WIDTH; + int y2=y1+BUTTON_HEIGHT; +//--- create + if(!m_button3.Create(m_chart_id,m_name+"Button3",m_subwin,x1,y1,x2,y2)) + return(false); + if(!m_button3.Text("Locked")) + return(false); + if(!Add(m_button3)) + return(false); + m_button3.Locking(true); + m_button3.Alignment(WND_ALIGN_RIGHT|WND_ALIGN_BOTTOM,0,0,INDENT_RIGHT,INDENT_BOTTOM); +//--- succeed + return(true); + } +//+------------------------------------------------------------------+ +//| Create the "RadioGroup" element | +//+------------------------------------------------------------------+ +bool CPanelDialog::CreateRadioGroup(void) + { + int sx=(ClientAreaWidth()-(INDENT_LEFT+INDENT_RIGHT+BUTTON_WIDTH))/3-CONTROLS_GAP_X; +//--- coordinates + int x1=INDENT_LEFT; + int y1=INDENT_TOP+EDIT_HEIGHT+CONTROLS_GAP_Y; + int x2=x1+sx; + int y2=ClientAreaHeight()-INDENT_BOTTOM; +//--- create + if(!m_radio_group.Create(m_chart_id,m_name+"RadioGroup",m_subwin,x1,y1,x2,y2)) + return(false); + if(!Add(m_radio_group)) + return(false); + m_radio_group.Alignment(WND_ALIGN_HEIGHT,0,y1,0,INDENT_BOTTOM); +//--- fill out with strings + for(int i=0;i<4;i++) + if(!m_radio_group.AddItem("Item "+IntegerToString(i),1<= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculatePanel(i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculatePanel( + const int &bar_index +) { +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.psar.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.psar.mq4 new file mode 100644 index 0000000..a263cdb --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.psar.mq4 @@ -0,0 +1,215 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center PSAR Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm PSAR Oscillator" +#property strict + +// +// START Inputs ... +// +input int shift = 0; // Shift +input double step = 0.02; // Step +input double maximum = 0.2; // Maximum +input bool drawAsDots = false; // Draw As Dots +// +input int priceSmoothing = 0; // Price Smoothing +input ENUM_APPLIED_PRICE priceLow = PRICE_CLOSE; // Psar low price +input ENUM_APPLIED_PRICE priceHigh = PRICE_OPEN; // Psar high price +input ENUM_MA_METHOD priceSmoothingMethod = MODE_SMA; // Price Smoothing Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_color1 clrLimeGreen +#property indicator_width1 1 +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_DOT + +// +#property indicator_color2 clrAqua +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +#property indicator_color3 clrFuchsia +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// +// Declare Buffers ... +// +#define sarBufferIndex 0 +#define upBufferIndex 1 +#define downBufferIndex 2 + +// +double sarBuffer[]; +double upBuffer[]; +double downBuffer[]; + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + SetIndexBuffer(sarBufferIndex, sarBuffer); + SetIndexLabel(sarBufferIndex, "SAR"); + + // + SetIndexBuffer(upBufferIndex, upBuffer); + SetIndexLabel(upBufferIndex, "Up"); + + // + SetIndexBuffer(downBufferIndex, downBuffer); + SetIndexLabel(downBufferIndex, "Down"); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_PSAR"; + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + // int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < 0) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate isarValue ... + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + double pHigh = iMA( + NULL, + _Period, + priceSmoothing, + 0, + priceSmoothingMethod, + priceHigh, + bar_index + ); + + // + double pLow = iMA( + _Symbol, + _Period, + priceSmoothing, + 0, + priceSmoothingMethod, + priceLow, + bar_index + ); + + // + upBuffer[bar_index] = pHigh; + sarBuffer[bar_index] = sarValue; + downBuffer[bar_index] = pLow; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.shpd.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.shpd.mq4 new file mode 100644 index 0000000..76ee426 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.shpd.mq4 @@ -0,0 +1,533 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Sharp Market Pump/Dump Indicator +// --------------------------------------------- +// this indicator detects market +// sharp pump and dumps ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm SHPD Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +input int loopback = 5; // Loopback for Sharp +input double multiplier = 2.0; // Multiplier +input double minimumMarketGap = 0.03; // Minimum Market Gap +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Specify this is an Chart Indicator ... +// #property indicator_chart_window +#property indicator_separate_window + +// +#property indicator_buffers 6 +#property indicator_plots 6 + +// +#property indicator_label1 "Market Highest" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrAqua +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +#property indicator_label2 "Market Lowest" +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrAqua +#property indicator_style2 STYLE_SOLID +#property indicator_width2 1 + +// +#property indicator_label3 "Market Highest Low" +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrFuchsia +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +#property indicator_label4 "Market Lowest High" +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrBlueViolet +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +#property indicator_label5 "Market Moving Average" +#property indicator_type5 DRAW_LINE +#property indicator_color5 clrYellow +#property indicator_style5 STYLE_DASHDOT +#property indicator_width5 1 + +// +#property indicator_label6 "Market Moving Average T" +#property indicator_type6 DRAW_LINE +#property indicator_color6 clrLime +#property indicator_style6 STYLE_DASHDOT +#property indicator_width6 1 + +// +// here we declare indicator buffers ... +// +double marketHighestBuffer[]; +double marketLowestBuffer[]; +double marketHighestLowBuffer[]; +double marketLowestHighBuffer[]; + +// +double marketMovingAverageBuffer[]; +double marketMovingAverageTBuffer[]; + +// +#define marketHighestBufferIndex 0 +#define marketLowestBufferIndex 1 +#define marketHighestLowBufferIndex 2 +#define marketLowestHighBufferIndex 3 +#define marketMovingAverageBufferIndex 4 +#define marketMovingAverageTBufferIndex 5 + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "X_SHPD_IND"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + if ( + loopback < 0 + || marketLength < 0 + || loopback > marketLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Initialize what we want ... + SetIndexBuffer(marketHighestBufferIndex, marketHighestBuffer); + SetIndexBuffer(marketLowestBufferIndex, marketLowestBuffer); + // + SetIndexBuffer(marketHighestLowBufferIndex, marketHighestLowBuffer); + SetIndexBuffer(marketLowestHighBufferIndex, marketLowestHighBuffer); + // + SetIndexBuffer(marketMovingAverageBufferIndex, marketMovingAverageBuffer); + SetIndexBuffer(marketMovingAverageTBufferIndex, marketMovingAverageTBuffer); + + // + return INIT_SUCCEEDED; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + RemoveDraws(logTag); +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int limit; + + // + static int lastMarketTrend = 0; + static datetime lastMarketTrendTime = 0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < marketLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = rates_total - prev_calculated; + if (prev_calculated > 0) { + limit++; + } + + // + // Do Calculation ... + for (int i = limit - 1 - (loopback + 1); i >= 0; i--) { + // + int lastMarketHighestIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + i + ); + double lastMarketHighest = high[lastMarketHighestIndex]; + marketHighestBuffer[i] = lastMarketHighest; + + // + int lastMarketLowestIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + i + ); + double lastMarketLowest = low[lastMarketLowestIndex]; + marketLowestBuffer[i] = lastMarketLowest; + + // + int lastMarketHighestLowIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + i + ); + double lastMarketHighestLow = high[lastMarketHighestLowIndex]; + marketHighestLowBuffer[i] = lastMarketHighestLow; + + // + int lastMarketLowestHighIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + i + ); + double lastMarketLowestHigh = low[lastMarketLowestHighIndex]; + marketLowestHighBuffer[i] = lastMarketLowestHigh; + + // + double marketMovingAverage = iMA( + _Symbol, + _Period, + marketLength * 2, // Ma Length ... + 0, // Ma Shift ... + MODE_SMA, // Ma Method ... + PRICE_MEDIAN, // Ma Applied Price ... + i // Bar Index ... + ); + marketMovingAverageBuffer[i] = marketMovingAverage; + + // + double marketMovingAverageT = iMA( + _Symbol, + _Period, + marketLength * 2, // Ma Length ... + 0, // Ma Shift ... + MODE_SMA, // Ma Method ... + PRICE_TYPICAL, // Ma Applied Price ... + i // Bar Index ... + ); + marketMovingAverageTBuffer[i] = marketMovingAverageT; + + // + double marketGap = MathAbs(marketMovingAverageBuffer[i] - marketMovingAverageTBuffer[i]); + + // + // this means Market Going to Trend Down ... + bool isMCrossOverMT = marketMovingAverageBuffer[i] > marketMovingAverageTBuffer[i] + && !( + marketMovingAverageBuffer[i + 1] > marketMovingAverageTBuffer[i + 1] + ); + bool isTrendDown = isMCrossOverMT && + marketGap > minimumMarketGap; + + // + // this means Market Going to Trend Up ... + bool isMCrossUnderMT = marketMovingAverageBuffer[i] < marketMovingAverageTBuffer[i] + && !( + marketMovingAverageBuffer[i + 1] < marketMovingAverageTBuffer[i + 1] + ); + bool isTrendUp = + // !isTrendDown + // && + isMCrossUnderMT + && marketGap > minimumMarketGap; + + // + bool isTrendRange = ( + !isMCrossUnderMT + && !isMCrossOverMT + ) || ( + !isTrendUp + && !isTrendDown + ); + + // + // Detect Last Market Trend State & Last Market Trend Time ... + int currentMarketTrend = + isTrendDown ? -1 : + isTrendUp ? 1 : + 0; + if (currentMarketTrend != lastMarketTrend) { + // + lastMarketTrend = currentMarketTrend; + lastMarketTrendTime = iTime( + _Symbol, + _Period, + i + ); + + // + if (isTrendDown) { + // + datetime arrowTime = iTime( + _Symbol, + _Period, + i + ); + + // + double arrowPrice = iHigh( + _Symbol, + _Period, + i + ); + arrowPrice = arrowPrice + (50 * _Point); + + // + string lbl = StringConcatenate( + logTag, + "_TrendDown_", + arrowTime + ); + + // + DrawArrow( + 0, + lbl, + 0, + arrowTime, + arrowPrice, + SYMBOL_ARROWDOWN, + ANCHOR_TOP, + clrFuchsia, + STYLE_SOLID, + 3 + ); + } + + // + if (isTrendUp) { + // + datetime arrowTime = iTime( + _Symbol, + _Period, + i + ); + + // + double arrowPrice = iLow( + _Symbol, + _Period, + i + ); + arrowPrice = arrowPrice - (50 * _Point); + + // + string lbl = StringConcatenate( + logTag, + "_TrendUp_", + arrowTime + ); + + // + DrawArrow( + 0, + lbl, + 0, + arrowTime, + arrowPrice, + SYMBOL_ARROWUP, + ANCHOR_BOTTOM, + clrAqua, + STYLE_SOLID, + 3 + ); + } + + // + if (isTrendRange) { + // + datetime arrowTime = iTime( + _Symbol, + _Period, + i + ); + + // + double arrowUpPrice = iHigh( + _Symbol, + _Period, + i + ); + arrowUpPrice = arrowUpPrice + (50 * _Point); + + // + double arrowDownPrice = iLow( + _Symbol, + _Period, + i + ); + arrowDownPrice = arrowDownPrice - (50 * _Point); + + // + string lblUp = StringConcatenate( + logTag, + "_TrendRange_UP_", + arrowTime + ); + + // + string lblDown = StringConcatenate( + logTag, + "_TrendRange_DOWN_", + arrowTime + ); + + // + DrawArrow( + 0, + lblUp, + 0, + arrowTime, + arrowUpPrice, + SYMBOL_ARROWDOWN, + ANCHOR_TOP, + clrGray, + STYLE_SOLID, + 3 + ); + + // + DrawArrow( + 0, + lblDown, + 0, + arrowTime, + arrowDownPrice, + SYMBOL_ARROWUP, + ANCHOR_BOTTOM, + clrGray, + STYLE_SOLID, + 3 + ); + } + + // + bool isSharp = false; + double marketHLGap = marketHighestBuffer[i] - marketLowestBuffer[i]; + for (int j = i + loopback; j > i; j--) { + // + double prevMarketHLGap = marketHighestBuffer[j] - marketLowestBuffer[j + 1]; + bool isThisSharp = + marketHLGap > prevMarketHLGap * multiplier; + + // + isSharp = isSharp || + ( + // ( + // isTrendUp || isTrendDown + // ) + // && + ( + isThisSharp + && marketGap > minimumMarketGap + ) + ); + } + + // + if (isSharp) { + // + datetime arrowTime = iTime( + _Symbol, + _Period, + i + ); + + // + double arrowPrice = iHigh( + _Symbol, + _Period, + i + ); + arrowPrice = arrowPrice + (50 * _Point); + + // + string lbl = StringConcatenate( + logTag, + "_SHARP_", + arrowTime + ); + + // + DrawArrow( + 0, + lbl, + 0, + arrowTime, + arrowPrice, + SYMBOL_ARROWDOWN, + ANCHOR_TOP, + clrYellow, + STYLE_SOLID, + 3 + ); + } + } + } + + // + // return value of prev_calculated for next call + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.sl.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.sl.mq4 new file mode 100644 index 0000000..9ab0e00 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.sl.mq4 @@ -0,0 +1,154 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center StopLoss Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm StopLoss Indicator" +#property strict + +// +// START Inputs ... +// +input int swingLoopback = 7; // Swing Loopback +input double thrshold = 10; // Threshold +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Specify this is an Chart Indicator ... +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 2 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 2 + +// +// here we declare plot Long Stop Loss to system ... +#property indicator_label1 "Long Stop Loss" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// here we declare plot Short Stop Loss to system ... +#property indicator_label2 "Short Stop Loss" +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrAqua +#property indicator_style2 STYLE_SOLID +#property indicator_width2 1 + +// +// here we declare indicator buffers ... +// +double longStopLossBuffer[]; +double shortStopLossBuffer[]; + +// +#define longStopLossIndex 0 +#define shortStopLossIndex 1 +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(longStopLossIndex, longStopLossBuffer); + SetIndexBuffer(shortStopLossIndex, shortStopLossBuffer); + + // + return(INIT_SUCCEEDED); +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int limit; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < swingLoopback) { + return 0; + } + + // + // found which candles calculated before ... + limit = rates_total - prev_calculated; + if (prev_calculated > 0) { + limit++; + } + + // + // Do Calculation ... + for (int i = limit - 1; i >= 0; i--) { + // + int lastMarketHighestIndex = iHighest(_Symbol, _Period, MODE_HIGH, swingLoopback, i); + double lastMarketHighest = high[lastMarketHighestIndex]; + + // + int lastMarketLowestIndex = iLowest(_Symbol, _Period, MODE_LOW, swingLoopback, i); + double lastMarketLowest = low[lastMarketLowestIndex]; + + // + double longStopLoss = lastMarketLowest - (thrshold * _Point); + longStopLoss = NormalizeDouble(longStopLoss, _Digits); + + // + double shortStopLoss = lastMarketHighest + (thrshold * _Point); + shortStopLoss = NormalizeDouble(shortStopLoss, _Digits); + + // + longStopLossBuffer[i] = longStopLoss; + shortStopLossBuffer[i] = shortStopLoss; + } + + // + // return value of prev_calculated for next call + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.tp.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.tp.mq4 new file mode 100644 index 0000000..89bfeba --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.tp.mq4 @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center TP Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm TP Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the R2R Length ... +input int swingLoopback = 7; // Swing Loopback +input double slThrshold = 10; // SL Threshold +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 2 +#property indicator_plots 2 + +// +// here we declare plot to system ... +#property indicator_label1 "Long TP" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrLime +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// here we declare plot to system ... +#property indicator_label2 "Short TP" +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_SOLID +#property indicator_width2 1 + +// +// Declare Buffers ... +#define longTPBufferIndex 0 +#define shortTPBufferIndex 1 + +// +double longTPBuffer[]; +double shortTPBuffer[]; + +// +string slIndicatorName = "x-saherelm.sl"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(longTPBufferIndex, longTPBuffer); + SetIndexDrawBegin(longTPBufferIndex, swingLoopback); + + // + SetIndexBuffer(shortTPBufferIndex, shortTPBuffer); + SetIndexDrawBegin(shortTPBufferIndex, swingLoopback); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, swingLoopback); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateLongTP( + open, + i + ); + + // + // Calculate Short TP ... + CalculateShortTP( + open, + i + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Long TPs based on SL and Open Price ... +void CalculateLongTP( + const double &open[], + const int &bar_index +) { + // + // read long sl ... + double longSL = iCustom( + _Symbol, + _Period, + slIndicatorName, + swingLoopback, + slThrshold, + 0, // Long SL Buffer Index ... + bar_index + ); + + // + double longRisk = open[bar_index] - longSL; + double longReward = longRisk * riskToRewardRatio; + + // + double longTP = open[bar_index] + longReward; + longTP = NormalizeDouble(longTP, _Digits); + + // + longTPBuffer[bar_index] = longTP; +} + +// +// Calculate Short TPs based on SL and Open Price ... +void CalculateShortTP( + const double &open[], + const int &bar_index +) { + // + // read short sl ... + double shortSL = iCustom( + _Symbol, + _Period, + slIndicatorName, + swingLoopback, + slThrshold, + 1, // Short SL Buffer Index ... + bar_index + ); + + // + double shortRisk = shortSL - open[bar_index]; + double shortReward = shortRisk * riskToRewardRatio; + + // + double shortTP = open[bar_index] - shortReward; + shortTP = NormalizeDouble(shortTP, _Digits); + + // + shortTPBuffer[bar_index] = shortTP; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.volume.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.volume.mq4 new file mode 100644 index 0000000..eb4aa73 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.volume.mq4 @@ -0,0 +1,270 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center Volume Indicator +// ------------------------------------------------------------- +// this indicator provides Volume ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Volume Indicator" +#property strict + +// +// START Inputs ... +// +input int length = 11; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 3 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 3 + +// +// Buy Volume ... +#property indicator_width1 1 +#property indicator_color1 clrGreen +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_style1 STYLE_DOT + +// +// Sell Volume ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT + +// +// Diff ... +#property indicator_width3 1 +#property indicator_type3 DRAW_HISTOGRAM +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define buyVolumeBufferIndex 0 +#define sellVolumeBufferIndex 1 +#define diffBufferIndex 2 + +// +double buyVolumeBuffer[]; +double sellVolumeBuffer[]; +double diffBuffer[]; + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_VOLUME"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // Buy Volume Buffer ... + SetIndexBuffer(buyVolumeBufferIndex, buyVolumeBuffer); + SetIndexLabel(buyVolumeBufferIndex, "Buy Volume"); + + // + // Sell Volume Buffer ... + SetIndexBuffer(sellVolumeBufferIndex, sellVolumeBuffer); + SetIndexLabel(sellVolumeBufferIndex, "Sell Volume"); + + // + // Diff Buffer ... + SetIndexBuffer(diffBufferIndex, diffBuffer); + SetIndexLabel(diffBufferIndex, "Diff"); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateBuffers( + open, + close, + high, + low, + i + ); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateBuffers( + const double &open[], + const double &close[], + const double &high[], + const double &low[], + const int &bar_index +) { + // + long volume = iVolume( + _Symbol, + _Period, + bar_index + ); + + // + double buyVolume = 0.0; + double sellVolume = 0.0; + + // + // Up ... + if (close[bar_index] > open[bar_index]) { + // + double cuenta = (high[bar_index] - low[bar_index]) * 10000; + double cuenta1 = volume - cuenta; + + // + buyVolume = ((volume - cuenta) / 2) + cuenta; + + // + buyVolumeBuffer[bar_index] = buyVolume; + sellVolumeBuffer[bar_index] = volume - buyVolume; + } else + // + // Down ... + if (close[bar_index] < open[bar_index]) { + // + double cuenta1 = (high[bar_index] - low[bar_index]) * 10000; + double cuenta = volume - cuenta1; + + // + sellVolume = ((volume - cuenta1) / 2) + cuenta1; + + // + sellVolumeBuffer[bar_index] = sellVolume; + buyVolumeBuffer[bar_index] = volume - sellVolume; + } else + // + // Neutral ... + if (close[bar_index] == open[bar_index]) { + // + double cuenta = (volume / 2) * 1.0; + + // + sellVolumeBuffer[bar_index] = cuenta; + buyVolumeBuffer[bar_index] = volume - cuenta; + } + + // + diffBuffer[bar_index] = MathAbs(buyVolumeBuffer[bar_index]) - MathAbs(sellVolumeBuffer[bar_index]); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.xma.1.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.xma.1.mq4 new file mode 100644 index 0000000..4c96e36 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.xma.1.mq4 @@ -0,0 +1,337 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the R2R Length ... +input int swingLoopback = 7; // Swing Loopback +input int xmaFlowMultiplier = 3; // XMA Flow Multiplier +input int xmaMarkMultiplier = 5; // XMA Mark Multiplier +input int xmaFastMultiplier = 7; // XMA Fast Multiplier +input int xmaSlowMultiplier = 14; // XMA Slow Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 6 +#property indicator_plots 6 + +// +// XMA High ... +#property indicator_label1 "XMA High" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrLime +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// XMA Low ... +#property indicator_label2 "XMA Low" +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrOrange +#property indicator_style2 STYLE_SOLID +#property indicator_width2 1 + +// +// XMA Mark ... +#property indicator_label3 "XMA Mark" +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrCornflowerBlue +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 + +// +// XMA Mid ... +#property indicator_label4 "XMA Mid" +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrBisque +#property indicator_style4 STYLE_DASHDOT +#property indicator_width4 1 + +// +// XMA Fast ... +#property indicator_label5 "XMA Fast" +#property indicator_type5 DRAW_LINE +#property indicator_color5 clrGreen +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// XMA Slow ... +#property indicator_label6 "XMA Slow" +#property indicator_type6 DRAW_LINE +#property indicator_color6 clrRed +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 + +// +// Declare Buffers ... +#define xmaHighBufferIndex 0 +#define xmaLowBufferIndex 1 +#define xmaMarkBufferIndex 2 +#define xmaMidBufferIndex 3 +#define xmaFastBufferIndex 4 +#define xmaSlowBufferIndex 5 + +// +double xmaHighBuffer[]; +double xmaLowBuffer[]; +double xmaMarkBuffer[]; +double xmaMidBuffer[]; +double xmaFastBuffer[]; +double xmaSlowBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + + // + // Validating Input Parameters ... + if (swingLoopback <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // XMA High ... + SetIndexBuffer(xmaHighBufferIndex, xmaHighBuffer); + SetIndexDrawBegin(xmaHighBufferIndex, swingLoopback * xmaFlowMultiplier); + + // + // XMA Low ... + SetIndexBuffer(xmaLowBufferIndex, xmaLowBuffer); + SetIndexDrawBegin(xmaLowBufferIndex, swingLoopback * xmaFlowMultiplier); + + // + // XMA Mark ... + SetIndexBuffer(xmaMarkBufferIndex, xmaMarkBuffer); + SetIndexDrawBegin(xmaMarkBufferIndex, swingLoopback * xmaMarkMultiplier); + + // + // XMA Mid ... + SetIndexBuffer(xmaMidBufferIndex, xmaMidBuffer); + SetIndexDrawBegin(xmaMidBufferIndex, swingLoopback); + + // + // XMA Fast ... + SetIndexBuffer(xmaFastBufferIndex, xmaFastBuffer); + SetIndexDrawBegin(xmaFastBufferIndex, swingLoopback * xmaFastMultiplier); + + // + // XMA Slow ... + SetIndexBuffer(xmaSlowBufferIndex, xmaSlowBuffer); + SetIndexDrawBegin(xmaSlowBufferIndex, swingLoopback * xmaSlowMultiplier); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, swingLoopback); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate XMA Flow ... + CalculateXMAFlow(i); + + // + // Calculate XMA Mark ... + CalculateXMAMark(i); + + // + // Calculate XMA Mid ... + CalculateXMAMid(i); + + // + // Calculate XMA Fast/Slow ... + CalculateXMAFastSlow(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate XMA Flow ... +void CalculateXMAFlow(const int &bar_index) { + // + int xmaFlowLength = swingLoopback * xmaFlowMultiplier; + + // + // Calculating XMa High ... + double xmaHigh = iMA( + _Symbol, + _Period, + xmaFlowLength, + 0, + MODE_SMA, + PRICE_HIGH, + bar_index + ); + xmaHighBuffer[bar_index] = xmaHigh; + + // + // Calculating XMa Low ... + double xmaLow = iMA( + _Symbol, + _Period, + xmaFlowLength, + 0, + MODE_SMA, + PRICE_LOW, + bar_index + ); + xmaLowBuffer[bar_index] = xmaLow; +} + +// +// Calculate XMA Mark ... +void CalculateXMAMark(const int &bar_index) { + // + int xmaMarkLength = swingLoopback * xmaMarkMultiplier; + + // + // Calculating XMa Mark ... + double xmaMark = iMA( + _Symbol, + _Period, + xmaMarkLength, + 0, + MODE_SMA, + PRICE_HIGH, + bar_index + ); + xmaMarkBuffer[bar_index] = xmaMark; +} + +// +// Calculate XMA Mid ... +void CalculateXMAMid(const int &bar_index) { + // + // Calculating XMa Mid ... + double xmaMid = iMA( + _Symbol, + _Period, + swingLoopback, + 0, + MODE_EMA, + PRICE_HIGH, + bar_index + ); + xmaMidBuffer[bar_index] = xmaMid; +} + +// +// Calculate XMA Fast/Slow ... +void CalculateXMAFastSlow(const int &bar_index) { + // + int xmaFastLength = swingLoopback * xmaFastMultiplier; + int xmaSlowLength = swingLoopback * xmaSlowMultiplier; + + // + // Calculating XMa Fast ... + double xmaFast = iMA( + _Symbol, + _Period, + xmaFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + xmaFastBuffer[bar_index] = xmaFast; + + // + // Calculating XMa Slow ... + double xmaSlow = iMA( + _Symbol, + _Period, + xmaSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + xmaSlowBuffer[bar_index] = xmaSlow; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.xmma.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.xmma.mq4 new file mode 100644 index 0000000..835aae4 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.xmma.mq4 @@ -0,0 +1,408 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMMA Indicator +// --------------------------------------------- +// this is an indicator which going to analyse +// Market based on Price Movements and provide +// some informations to act based on current market +// state ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Market Analyser (XMMA) Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +input int fastShift = 1; // Fast Shift +input int slowShift = 3; // Slow Shift +input int longMarketFastMultiplier = 100; // Long Market Fast Multiplier +input int longMarketSlowMultiplier = 200; // Long Market Slow Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 7 +#property indicator_plots 7 + +// +// Fast ... +#property indicator_label1 "Fast" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Slow ... +#property indicator_label2 "SLow" +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Mid ... +#property indicator_label3 "Mid" +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrBisque +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 + +// +// Long SL ... +#property indicator_label4 "Long SL" +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrAqua +#property indicator_style4 STYLE_DASH +#property indicator_width4 1 + +// +// Short SL ... +#property indicator_label5 "Short SL" +#property indicator_type5 DRAW_LINE +#property indicator_color5 clrFuchsia +#property indicator_style5 STYLE_DASH +#property indicator_width5 1 + +// +// Long Market Fast ... +#property indicator_label6 "Long Fast" +#property indicator_type6 DRAW_LINE +#property indicator_color6 clrAqua +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// Long Market Slow ... +#property indicator_label7 "Long Market Slow" +#property indicator_type7 DRAW_LINE +#property indicator_color7 clrFuchsia +#property indicator_style7 STYLE_DOT +#property indicator_width7 1 + +// +// Declare Buffers ... +#define fastBufferIndex 0 +#define slowBufferIndex 1 +#define midBufferIndex 2 +#define longSLBufferIndex 3 +#define shortSLBufferIndex 4 +#define longMarketFastBufferIndex 5 +#define longMarketSlowBufferIndex 6 + +// +double fastBuffer[]; +double slowBuffer[]; +double midBuffer[]; +double longSLBuffer[]; +double shortSLBuffer[]; +double longMarketFastBuffer[]; +double longMarketSlowBuffer[]; + +// +int lastCrossOverIndex = 0; +double lastCrossOver = 0.0; + +// +int lastCrossUnderIndex = 0; +double lastCrossUnder = 0.0; + +// +double lastLongSL = 0.0; +int lastLongSLIndex = 0; + +// +double lastShortSL = 0.0; +int lastShortSLIndex = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastShift < 0 || + slowShift < 0 || + marketLength <= 0 || + slowShift < fastShift + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Fast ... + SetIndexBuffer(fastBufferIndex, fastBuffer); + + // + // Slow ... + SetIndexBuffer(slowBufferIndex, slowBuffer); + + // + // Mid ... + SetIndexBuffer(midBufferIndex, midBuffer); + + // + // Long SL ... + SetIndexBuffer(longSLBufferIndex, longSLBuffer); + + // + // Short SL ... + SetIndexBuffer(shortSLBufferIndex, shortSLBuffer); + + // + // Long Market Fast ... + SetIndexBuffer(longMarketFastBufferIndex, longMarketFastBuffer); + + // + // Long Market Slow ... + SetIndexBuffer(longMarketSlowBufferIndex, longMarketSlowBuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Flow ... + CalculateFlow(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Flow ... +void CalculateFlow( + const int &bar_index +) { + // + int fastLength = marketLength + fastShift; + int slowLength = marketLength + fastShift + slowShift; + + // + // Calculating Fast ... + double fast = iMA( + _Symbol, + _Period, + fastLength, + 0, + MODE_EMA, + PRICE_WEIGHTED, + bar_index + ); + fastBuffer[bar_index] = fast; + + // + // Calculating Slow ... + double slow = iMA( + _Symbol, + _Period, + slowLength, + 0, + MODE_EMA, + PRICE_WEIGHTED, + bar_index + ); + slowBuffer[bar_index] = slow; + + // + // Calculating XMa Mid ... + double xmaMid = iMA( + _Symbol, + _Period, + marketLength, + 0, + MODE_EMA, + PRICE_HIGH, + bar_index + ); + midBuffer[bar_index] = xmaMid; + + // + // Calculating XMa Long Market Fast ... + double xmaLongMarketFast = iMA( + _Symbol, + _Period, + marketLength * longMarketFastMultiplier, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + longMarketFastBuffer[bar_index] = xmaLongMarketFast; + + // + // Calculating XMa Long Market Slow ... + double xmaLongMarketSlow = iMA( + _Symbol, + _Period, + marketLength * longMarketSlowMultiplier, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + longMarketSlowBuffer[bar_index] = xmaLongMarketSlow; + + // + // Find Cross Points ... + // + bool isCrossOver = fastBuffer[bar_index] > slowBuffer[bar_index] + && !( + fastBuffer[bar_index + 1] > slowBuffer[bar_index + 1] + ); + + // + bool isCrossUnder = fastBuffer[bar_index] < slowBuffer[bar_index] + && !( + fastBuffer[bar_index + 1] < slowBuffer[bar_index + 1] + ); + + // + // Find Trending ... + // + bool isTrendUp = fastBuffer[bar_index] > slowBuffer[bar_index] + && fastBuffer[bar_index] > fastBuffer[bar_index + 1] + && slowBuffer[bar_index] > slowBuffer[bar_index + 1]; + + // + bool isTrendDown = fastBuffer[bar_index] < slowBuffer[bar_index] + && fastBuffer[bar_index] < fastBuffer[bar_index + 1] + && slowBuffer[bar_index] < slowBuffer[bar_index + 1]; + + // + // Do Some Calculations ... + if (isCrossOver) { + // + lastCrossOverIndex = bar_index; + lastCrossOver = fastBuffer[bar_index]; + } else if (isCrossUnder) { + // + lastCrossUnderIndex = bar_index; + lastCrossUnder = fastBuffer[bar_index]; + } + + // + // Calculate SLs ... + // + // Long SL ... + if (lastCrossOver > 0) { + // + lastLongSLIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + lastCrossOverIndex + ); + + // + lastLongSL = iLow( + _Symbol, + _Period, + lastLongSLIndex + ); + } + + // + // Short SL ... + if (lastCrossUnder > 0) { + // + lastShortSLIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + lastCrossUnderIndex + ); + + // + lastShortSL = iHigh( + _Symbol, + _Period, + lastShortSLIndex + ); + } + + // + longSLBuffer[bar_index] = lastLongSL; + shortSLBuffer[bar_index] = lastShortSL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Indicators/x-saherelm.xmma.signalling.mq4 b/Bkp/UnUsed/Indicators/x-saherelm.xmma.signalling.mq4 new file mode 100644 index 0000000..2d4a0d8 --- /dev/null +++ b/Bkp/UnUsed/Indicators/x-saherelm.xmma.signalling.mq4 @@ -0,0 +1,249 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center XMMA Signalling Indicator +// ------------------------------------------------------------- +// this indicator provides signals for XMMA Based Strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMMA Signalling Indicator" +#property strict + +// +// START Inputs ... +// +// +// Signal Show/Hide ... +input bool showSignals = true; // Show Signals +input bool showLongSignals = true; // Show Long Signals +input bool showShortSignals = true; // Show Short Signals + +// +// Signal Prefixe ... +input string signalPrefix = "XS_SG_OSC"; // Signal Prefix +input double signalArrowPositionThresholdFactor = 100; // Signal Arrow Dist of Price + +// +// Signal Colors ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +// here we specify alerting signals ... +input bool alertSignals = false; // Alert Signals +input bool pushNotificationSignals = false; // Push Notification Alert Signals + +// +// Indicator Inputs ... +input int marketLength = 7; // Market Length +input int fastShift = 1; // Fast Shift +input int slowShift = 3; // Slow Shift +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.xmma.signal.lib.mq4" + +// +// Last Signalled Bar ... +int lastSignalledBar = 0; + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_SG_OSC"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastShift < 0 || + slowShift < 0 || + marketLength <= 0 || + slowShift < fastShift + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateSignals(i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(signalPrefix); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Here we are Calculate Signals based on Oscillators and fill up +// related buffers ... +void CalculateSignals(const int &bar_index) { + // + // Retrieve Signal Exists ... + XSignalRequest request = CalculateSignal( + bar_index, + marketLength, + fastShift, + slowShift + ); + + // + if (!request.hasSignal) { + return; + } + + // + // Prevent Multiple Alerting at same Candle ... + if (lastSignalledBar == bar_index) { + return; + } + + // + lastSignalledBar = bar_index; + + // + bool hasLongSignal = request.type == X_LONG; + bool hasShortSignal = request.type == X_SHORT; + + // + // Signal Tag ... + string signalTAG = GenerateSignalTAG( + request.signal, + signalPrefix, + bullishSignalLabel, + bearishSignalLabel + ); + + // + // Handle Alerts ... + if (alertSignals && bar_index == 0) { + // + // General Alert ... + Alert(signalTAG); + + // + // Push Notifications ... + if (pushNotificationSignals) { + SendNotification(signalTAG); + } + } + + // + // Handle Can Show Signals ... + bool canShowSignals = showSignals && + (hasLongSignal ? showLongSignals : hasShortSignal ? showShortSignals : false); + if (canShowSignals) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + request.signal, + 0, + 0, + signalArrowPositionThresholdFactor, + signalPrefix, // Signal Tag ... + bullishSignalLabel, // Long Signal Label ... + bullishSignalColor, + bearishSignalLabel, // Short Signal Label ... + bearishSignalColor + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Libs/x-saherelm.lib.1.mq4 b/Bkp/UnUsed/Libs/x-saherelm.lib.1.mq4 new file mode 100644 index 0000000..fc7b528 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.lib.1.mq4 @@ -0,0 +1,203 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + static datetime lastbar; + datetime curbar = (datetime)SeriesInfoInteger(_Symbol, _Period, SERIES_LASTBAR_DATE); + + // + if(lastbar != curbar) { + // + lastbar = curbar; + return true; + } + + // + return false; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Multiply two Buffer ... +void MultiplyBuffer( + const double &buffer1[], + const double &buffer2[], + double &result[] +) { + // + int buffer1Size = ArraySize(buffer1); + int buffer2Size = ArraySize(buffer2); + + // + int size = MathMax(buffer1Size, buffer2Size); + + // + ArrayResize(result, size); + ArrayFill(result, 0, size, 0.0); + + // + for (int i = 0; i < size; i++) { + result[i] = buffer1[i] * buffer2[i]; + } +} + +// +// Calculate SMA ... +double iSMA( + const double &src[], + const int len = 7, + const int bar_index = 0 +) { + // + double result = 0.0; + + // + for (int i = bar_index + (len - 1); i >= bar_index; i--) { + result += src[bar_index] / len; + } + + // + return result; +} + +// +// Calculat VMA ... +double iVWMA( + const double &src[], + const long &volume[], + const int len = 7, + const int bar_index = 0 +) { + // + double result = 0.0; + + // + // double volume ... + int volumeSize = ArraySize(volume); + double dVolume[]; + ArrayResize(dVolume, volumeSize); + ArrayFill(dVolume, 0, volumeSize, 0.0); + for (int i = 0; i < volumeSize; i++) { + dVolume[i] = volume[i] * 1.0; + }; + + + // + double multipliedSourceVolume[]; + MultiplyBuffer( + src, + dVolume, + multipliedSourceVolume + ); + + // + result = iSMA( + multipliedSourceVolume, + len + ) / iSMA( + dVolume, + len + ); + + // + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/UnUsed/Libs/x-saherelm.models.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..b8618f2 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.models.lib.mq4 @@ -0,0 +1,271 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// + +// +// Used Indicators List ... +const string slIndicatorName = "x-saherelm.sl"; +const string tpIndicatorName = "x-saherelm.tp"; +const string maIndicatorName = "x-saherelm.ma"; +const string xmaIndicatorName = "x-saherelm.xma"; +const string oscIndicatorName = "x-saherelm.osc"; +const string sslIndicatorName = "x-saherelm.ssl"; +const string pcrtIndicatorName = "x-saherelm.pcrt"; +const string volumeIndicatorName = "x-saherelm.volume"; +const string zigZagIndicatorName = "x-saherelm.zigzag"; + +// +// Direction ... +enum X_DIRECTION { + X_UP, + X_DOWN +}; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// Define an Specific Arrow Code enum ... +enum X_ARROW_CODE { + // + X_ARROW_UP = OBJ_ARROW_UP, + X_ARROW_DOWN = OBJ_ARROW_DOWN, + // + X_ARROW_THUMB_UP = OBJ_ARROW_THUMB_UP, + X_ARROW_THUMB_DOWN = OBJ_ARROW_THUMB_DOWN, + // + X_ARROW_BUY = OBJ_ARROW_BUY, + X_ARROW_SELL = OBJ_ARROW_SELL, + // + X_ARROW_STOP = OBJ_ARROW_STOP, + X_ARROW_CHECK = OBJ_ARROW_CHECK, + // + X_ARROW_LEFT_PRICE = OBJ_ARROW_LEFT_PRICE, + X_ARROW_RIGHT_PRICE = OBJ_ARROW_RIGHT_PRICE, +}; + +// +// Pricae Action Theory Candle Types ... +enum X_P_CANDLE_TYPE { + X_P_CT_BULLISH = 1, + X_P_CT_NEUTRAL = 2, + X_P_CT_BEARISH = 3, +}; + +// +// Candlestick Theory Candle Types ... +enum X_CANDLE_TYPE { + X_CT_DOJI = 1, + X_CT_EVENING_STAR = 2, + X_CT_MORNING_STAR = 3, + X_CT_SHOOTING_STAR = 4, + X_CT_HAMMER = 5, + X_CT_INVERTED_HAMMER = 6, + X_CT_BEARISH_HARAMI = 7, + X_CT_BULLISH_HARAMI = 8, + X_CT_BEARISH_ENGULFING = 9, + X_CT_BULLISH_ENGULFING = 10, + X_CT_PRICE_LINE = 11, + X_CT_BULLISH_BELT = 12, + X_CT_BULLISH_KICKER = 13, + X_CT_BEARISH_KICKER = 14, + X_CT_HANGING_MAN = 15, + X_CT_DARK_CLOUD_COVER = 16 +}; + +// +// we model OSC Return Data ... +struct XOSCState { + // + double fastOSC; + double fastOSCPrev; + + // + double slowOSC; + double slowOSCPrev; + + // + double powerOSC; + double powerOSCPrev; + + // + double varOSC; + double varOSCPrev; + + // + double tanFSOSC; +}; + +// +// we Model MACD State ... +struct XMACDState { + double MACD; + double signal; +}; + +// +// model ssl State ... +struct XSSLState { + // + double sslUp; + double sslUpPrev; + + // + double sslDown; + double sslDownPrev; +}; + +// +// Model Volume Indicator Result ... +struct XVolumeState { + double buyVolume; + double sellVolume; +}; + +// +// Signal Info Model ... +struct XSignalInfo { + // + bool hasSignal; + // + bool hasLongSignal; + bool hasShortSignal; +}; + +// +// Model SLs as this ... +struct XSLInfo { + double longSL; + double shortSL; +}; + +// +// Model TPs as this ... +struct XTPInfo { + double longTP; + double shortTP; +}; + +// +// ZigZag State ... +struct XZigZagState { + // + double zigZag; + datetime zigZagTime; + + // + double zigZagPrev; + datetime zigZagPrevTime; + + // + double low; + int lowBarIndex; + datetime lowTime; + + // + double high; + int highBarIndex; + datetime highTime; + + // + double delta; + + // + bool isWaitForTrendUp; + bool isWaitForTrendDown; + + // + bool isLowIsLastLow; + bool isHighIsLastHigh; +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +// State of Market based on XMA ... +struct XMAState { + // + double xmaFast; + double xmaFastPrev; + + // + double xmaSlow; + double xmaSlowPrev; + + // + bool isBullishTrend; + bool isBearishTrend; + + // + double trendPower; + + // + double xmaHigh; + double xmaHighPrev; + + // + double xmaLow; + double xmaLowPrev; + + // + bool isFlowUp; + bool isFlowDown; + + // + double xmaMark; + + // + double xmaMid; + double xmaMidPrev; +}; + +// +// Define an enum for Detection Rules on Candlestick Indicator ... +enum X_CD_DETECTION_RULES { + X_PRICE_50_SMA, + X_PRICE_50_200_SMA +}; +// +// End Models ... +// diff --git a/Bkp/UnUsed/Libs/x-saherelm.signal.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..4fe3dd4 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1467 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// Start Signal Functions ... +// +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag = "", + const string longSignalLabel = "", + const string shortSignalLabel = "" +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Logging a Signal ... +void LogSignal( + const XSignal &signal, + const string tag = "", + const string longSignalLabel = "", + const string shortSignalLabel = "" +) { + // + // Generate Message ... + string signalMessage = GenerateSignalTAG( + signal, + tag, + longSignalLabel, + shortSignalLabel + ); + + // + LogMessage(signalMessage); +} + +// +// Retrieve Price Action Candlestick Type ... +double GetPCandleType(const int bar_index) { + // + double result = iCustom( + _Symbol, + _Period, + pcrtIndicatorName, + 0, + bar_index + ); + + // + return result; +} + +// +// Retrieve OSC Snapshot State ... +XOSCState GetOSCState(const int bar_index) { + // + // Temp Result ... + XOSCState result = {}; + + // + // Start Extract Data from Oscillator ... + // + // + // Fast OSC ... + double fastOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 0, // Fast OSC Buffer Index ... + bar_index + ); + result.fastOSC = fastOSC; + + // + // Prev FastOSC ... + double fastOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 0, // Fast OSC Buffer Index ... + bar_index + 1 + ); + result.fastOSCPrev = fastOSCPrev; + + // + // Slow OSC ... + double slowOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 1, // Slow OSC Buffer Index ... + bar_index + ); + result.slowOSC = slowOSC; + + // + // Prev Slow OSC ... + double slowOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 1, // Slow OSC Buffer Index ... + bar_index + 1 + ); + result.slowOSCPrev = slowOSCPrev; + + // + // Power OSC ... + double powerOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 2, // Power OSC Buffer Index ... + bar_index + ); + result.powerOSC = powerOSC; + + // + double powerOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 2, // Power OSC Buffer Index ... + bar_index + 1 + ); + result.powerOSCPrev = powerOSCPrev; + + // + // Var OSC ... + double varOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 3, // Var OSC Buffer Index ... + bar_index + ); + result.varOSC = varOSC; + + // + double varOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 3, // Var OSC Buffer Index ... + bar_index + 1 + ); + result.varOSCPrev = varOSCPrev; + + // + // Tan FS OSC ... + double tanFSOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier, + 4, // Tan F/S OSC Buffer Index ... + bar_index + ); + result.tanFSOSC = tanFSOSC; + // + // End Extract Data from Oscillator ... + // + + // + return result; +} + +// +// Retrieve Ma Snapshot State ... +XMaState GetMaState( + const int bar_index, + int fastMaPeriod = 20, + ENUM_MA_METHOD fastMaMethod = MODE_EMA, + ENUM_APPLIED_PRICE fastMaAppliedPrice = PRICE_CLOSE, + int slowMaPeriod = 50, + ENUM_MA_METHOD slowMaMethod = MODE_EMA, + ENUM_APPLIED_PRICE slowMaAppliedPrice = PRICE_CLOSE +) { + // + XMaState result = {}; + + // + double fastMa = iCustom( + _Symbol, + _Period, + maIndicatorName, + fastMaPeriod, + fastMaMethod, + fastMaAppliedPrice, + slowMaPeriod, + slowMaMethod, + slowMaAppliedPrice, + 0, + bar_index + ); + result.fastMa = fastMa; + + // + double fastMaPrev = iCustom( + _Symbol, + _Period, + maIndicatorName, + fastMaPeriod, + fastMaMethod, + fastMaAppliedPrice, + slowMaPeriod, + slowMaMethod, + slowMaAppliedPrice, + 0, + bar_index + 1 + ); + result.fastMaPrev = fastMaPrev; + + // + double slowMa = iCustom( + _Symbol, + _Period, + maIndicatorName, + fastMaPeriod, + fastMaMethod, + fastMaAppliedPrice, + slowMaPeriod, + slowMaMethod, + slowMaAppliedPrice, + 1, + bar_index + ); + result.slowMa = slowMa; + + // + double slowMaPrev = iCustom( + _Symbol, + _Period, + maIndicatorName, + fastMaPeriod, + fastMaMethod, + fastMaAppliedPrice, + slowMaPeriod, + slowMaMethod, + slowMaAppliedPrice, + 1, + bar_index + 1 + ); + result.slowMaPrev = slowMaPrev; + + // + Print(fastMa, slowMa, fastMaPrev, slowMaPrev); + + // + return result; +} + +// +// Retrieve MACD info ... +XMACDState GetMACDState() { + // + XMACDState result = {}; + + // + // TODO: Complete this later ... + + // + return result; +} + +// +// Check OSC Has Signal ... +// default Method ... +XSignalInfo OSCHasSignal( + const XOSCState &oscState, + const double &minimumSignalPower, + const double &minimumVarPower +) { + // + // Genrate Temp Result ... + XSignalInfo result = {}; + + // + bool isCrossedOver = oscState.fastOSC > oscState.slowOSC && !(oscState.fastOSCPrev > oscState.slowOSCPrev); + bool hasLongSignal = isCrossedOver && oscState.powerOSC >= minimumSignalPower; + result.hasLongSignal = hasLongSignal; + + // + bool isCrossedUnder = oscState.fastOSC < oscState.slowOSC && !(oscState.fastOSCPrev < oscState.slowOSCPrev); + bool hasShortSignal = isCrossedUnder && oscState.powerOSC >= minimumSignalPower; + result.hasShortSignal = hasShortSignal; + + // + bool hasSignal = hasLongSignal || hasShortSignal; + result.hasSignal = hasSignal; + + // + return result; +} + +// +// Check OSC Has Signal ... +// Method 1 ... +XSignalInfo OSCHasSignal_1( + const XOSCState &oscState, + const double &minimumSignalPower, + const double &minimumVarPower +) { + // + static bool canSignalLong = true; + static bool canSignalShort = true; + + // + // Genrate Temp Result ... + XSignalInfo result = {}; + //return result; + + // + // bool hasLongSignal = false; + bool isCrossedOver = oscState.fastOSC > oscState.slowOSC && + !(oscState.fastOSCPrev > oscState.slowOSCPrev); + bool hasLongSignal = isCrossedOver && + oscState.powerOSC >= minimumSignalPower && + oscState.varOSC >= minimumVarPower; + result.hasLongSignal = hasLongSignal; + // if (hasLongSignal) { + // canSignalLong = false; + // } + + // + // bool hasShortSignal = false; + bool isCrossedUnder = oscState.fastOSC < oscState.slowOSC && !(oscState.fastOSCPrev < oscState.slowOSCPrev); + bool hasShortSignal = isCrossedUnder && + oscState.powerOSC >= minimumSignalPower && + oscState.varOSC >= minimumVarPower; + result.hasShortSignal = hasShortSignal; + // if (hasShortSignal) { + // canSignalShort = false; + // } + + // + bool hasSignal = hasLongSignal || hasShortSignal; + result.hasSignal = hasSignal; + + // + // Fix can Signal Long ... + //if (oscState.fastOSC >= 0 && !canSignalLong) { + // canSignalLong = true; + //} + + // + // Fix can Signal Short ... + //if (oscState.fastOSC <= 1 && !canSignalShort) { + // canSignalShort = true; + //} + + // + return result; +} + +// +// Check OSC Has Signal ... +// Method 2 ... +XSignalInfo OSCHasSignal_2( + const XOSCState &oscState, + const int &bar_index +) { + // + static bool canSignalLong = true; + static bool canSignalShort = true; + + // + // Genrate Temp Result ... + XSignalInfo result = {}; + //return result; + + // + // bool hasLongSignal = false; + bool isCrossedOver = oscState.fastOSC > oscState.slowOSC && + !(oscState.fastOSCPrev > oscState.slowOSCPrev); + + // + // Get Prev Price Action Candle Type ... + int pCandleType = (int) GetPCandleType(bar_index + 1); + + bool hasLongSignal = isCrossedOver + && oscState.slowOSC > 0.5 + && oscState.varOSC > 0; + + // && oscState.powerOSC >= 0.006 + // && oscState.powerOSC - oscState.powerOSCPrev > 0 + // && oscState.tanFSOSC >= 0.06 + + // && ( + // pCandleType == X_CT_HAMMER || + // pCandleType == X_CT_BULLISH_BELT || + // pCandleType == X_CT_MORNING_STAR || + // pCandleType == X_CT_BULLISH_KICKER || + // pCandleType == X_CT_BULLISH_HARAMI || + // pCandleType == X_CT_INVERTED_HAMMER || + // pCandleType == X_CT_BULLISH_ENGULFING || + // pCandleType == 0 + // ) + result.hasLongSignal = hasLongSignal; + if (hasLongSignal) { + // + // Print("Tan: " + oscState.tanFSOSC); + } + // if (hasLongSignal) { + // canSignalLong = false; + // } + + // + // bool hasShortSignal = false; + bool isCrossedUnder = oscState.fastOSC < oscState.slowOSC && !(oscState.fastOSCPrev < oscState.slowOSCPrev); + bool hasShortSignal = false; + result.hasShortSignal = hasShortSignal; + // if (hasShortSignal) { + // canSignalShort = false; + // } + + // + bool hasSignal = hasLongSignal || hasShortSignal; + result.hasSignal = hasSignal; + + // + // Fix can Signal Long ... + //if (oscState.fastOSC >= 0 && !canSignalLong) { + // canSignalLong = true; + //} + + // + // Fix can Signal Short ... + //if (oscState.fastOSC <= 1 && !canSignalShort) { + // canSignalShort = true; + //} + + // + return result; +} + +// +// Check Ma Has Signal ... +XSignalInfo MaHasSignal( + const XMaState &maState, + const int &bar_index +) { + // + XSignalInfo result = {}; + result.hasSignal = false; + + // + // Long ... + bool isFastCrossOverSlow = maState.fastMa > maState.slowMa + && !(maState.fastMaPrev > maState.slowMaPrev); + bool hasLongSignal = isFastCrossOverSlow; + result.hasLongSignal = hasLongSignal; + + // + // Short ... + bool isFastCrossUnderSlow = maState.fastMa < maState.slowMa + && !(maState.fastMaPrev < maState.slowMaPrev); + bool hasShortSignal = isFastCrossUnderSlow; + result.hasShortSignal = hasShortSignal; + + // + bool hasSignal = hasLongSignal || hasShortSignal; + result.hasSignal = hasSignal; + + // + return result; +} + +// +// Reading Swing SL ... +XSLInfo GetSwngSL(const int &bar_index) { + // + // Temp result ... + XSLInfo result = {}; + + // + // Start Reading SL ... + // + // + // Long SL ... + double longSL = iCustom( + _Symbol, + _Period, + slIndicatorName, + slLoopback, // SL IND Inputs ... + slThrshold, // SL IND Inputs ... + 0, // Long SL Buffer Index ... + bar_index + ); + longSL = NormalizeDouble(longSL, _Digits); + result.longSL = longSL; + + // + // Short SL ... + double shortSL = iCustom( + _Symbol, + _Period, + slIndicatorName, + slLoopback, // SL IND Inputs ... + slThrshold, // SL IND Inputs ... + 1, // Short SL Buffer Index ... + bar_index + ); + shortSL = NormalizeDouble(shortSL, _Digits); + result.shortSL = shortSL; + // + // End Reading SL ... + // + + // + return result; +} + +// +// Reading TP based on SwingSL ... +XTPInfo GetTP(const int &bar_index) { + // + // Temp result ... + XTPInfo result = {}; + + // + // Start Reading TP ... + // + // + // Long TP ... + double longTP = iCustom( + _Symbol, + _Period, + tpIndicatorName, + slLoopback, // TP IND Inputs ... + slThrshold, // SL IND Inputs ... + riskToRewardRatio, // TP IND Inputs ... + 0, // Long TP Buffer Index ... + bar_index + ); + longTP = NormalizeDouble(longTP, _Digits); + result.longTP = longTP; + + // + // Short TP ... + double shortTP = iCustom( + _Symbol, + _Period, + tpIndicatorName, + slLoopback, // TP IND Inputs ... + slThrshold, // SL IND Inputs ... + riskToRewardRatio, // TP IND Inputs ... + 1, // Short TP Buffer Index ... + bar_index + ); + shortTP = NormalizeDouble(shortTP, _Digits); + result.shortTP = shortTP; + // + // End Reading TP ... + // + + // + return result; +} + +// +// Calculate Signal ... +// Default Method ... +XSignalRequest CalculateOSCSignal( + const int bar_index, + const double minimumSignalPower = 0.03, + const double minimumVarPower = 0.01 +) { + // + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + // Reading Oscillator State ... + XOSCState oscState = GetOSCState(bar_index); + + // + // Generate Signals From OSC ... + XSignalInfo signalInfo = OSCHasSignal( + oscState, + minimumSignalPower, + minimumVarPower + ); + + // + result.hasSignal = signalInfo.hasSignal; + if (!signalInfo.hasSignal) { + return result; + } + + // + // increase signal count ... + signalCount++; + + // + // increase long/short signal count ... + if (signalInfo.hasLongSignal) { + longSignalCount++; + } else if (signalInfo.hasShortSignal) { + shortSignalCount++; + } + + // + // Retrieve Open Price ... + double openPrice = iOpen(_Symbol, _Period, bar_index); + openPrice = NormalizeDouble(openPrice, _Digits); + + // + // Signal Entry Price ... + double signalEntryPrice = signalInfo.hasLongSignal ? Ask : Bid; + signalEntryPrice = NormalizeDouble(signalEntryPrice, _Digits); + + // + // Signal Time ... + datetime signalTime = iTime(_Symbol, _Period, bar_index); + + // + // Signal Type ... + X_SIGNAL_TYPE signalType = signalInfo.hasLongSignal ? X_LONG : X_SHORT; + result.type = signalType; + + // + // Reading SL ... + XSLInfo slInfo = GetSwngSL(bar_index); + + // + // Reading TP ... + XTPInfo tpInfo = GetTP(bar_index); + + // + // Generate Signal SL ... + double signalSL = signalInfo.hasLongSignal ? slInfo.longSL : slInfo.shortSL; + + // + // Generate Signal TP ... + double signalTP = signalInfo.hasLongSignal ? tpInfo.longTP : tpInfo.shortTP; + + // + // Generate XSignal Instance based on received Data ... + XSignal signal = {}; + signal.id = signalCount; + signal.sl = signalSL; + signal.tp = signalTP; + signal.time = signalTime; + signal.type = signalType; + signal.symbol = _Symbol; + // signal.openPrice = openPrice; + // signal.entryPrice = signalEntryPrice; + + // + result.signal = signal; + + // + return result; +} + +// +// Calculate Signal ... +// Method 1 ... +XSignalRequest CalculateSignal_1( + const int bar_index, + const double minimumSignalPower = 0.03, + const double minimumVarPower = 0.01 +) { + // + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + // Reading Oscillator State ... + XOSCState oscState = GetOSCState(bar_index); + + // + // Retrieve Price Action Theory based Candlestick Type ... + int pCandleType = (int) GetPCandleType(bar_index); + + // + // Generate Signals From OSC ... + XSignalInfo signalInfo = OSCHasSignal_1( + oscState, + minimumSignalPower, + minimumVarPower + ); + + // + result.hasSignal = signalInfo.hasSignal; + if (!signalInfo.hasSignal) { + return result; + } + + // + // Get Price Action Candlestick Verification on Long Signals ... + if (signalInfo.hasLongSignal) { + // + // Check current Candle Type based on Price Action Theory ... + if (pCandleType == X_P_CT_BEARISH) { + // + result.hasSignal = false; + return result; + } else if (pCandleType == X_P_CT_NEUTRAL) { + // + // Here we must loop through back bar indexes until find a + // candle which no NEUTRAL ... + int barCounter = bar_index + 1; + int prevUnNeutralPCandleType = -1; + while( + barCounter <= Bars && + prevUnNeutralPCandleType == -1 + ) { + // + int cPCType = (int) GetPCandleType(barCounter); + if (cPCType != X_P_CT_NEUTRAL) { + prevUnNeutralPCandleType = cPCType; + } else { + barCounter++; + } + } + + // + result.hasSignal = false; + if (prevUnNeutralPCandleType != X_P_CT_BULLISH) { + return result; + } + + // + result.hasSignal = true; + } + } + + // + // Get Price Action Candlestick Verification on Short Signals ... + if (signalInfo.hasShortSignal) { + // + // Check current Candle Type based on Price Action Theory ... + if (pCandleType == X_P_CT_BULLISH) { + // + result.hasSignal = false; + return result; + } else if (pCandleType == X_P_CT_NEUTRAL) { + // + // Here we must loop through back bar indexes until find a + // candle which no NEUTRAL ... + int barCounter = bar_index + 1; + int prevUnNeutralPCandleType = -1; + while( + barCounter <= Bars && + prevUnNeutralPCandleType == -1 + ) { + // + int cPCType = (int) GetPCandleType(barCounter); + if (cPCType != X_P_CT_NEUTRAL) { + prevUnNeutralPCandleType = cPCType; + } else { + barCounter++; + } + } + + // + result.hasSignal = false; + if (prevUnNeutralPCandleType != X_P_CT_BEARISH) { + return result; + } + + // + result.hasSignal = true; + } + } + + // + // increase signal count ... + signalCount++; + + // + // increase long/short signal count ... + if (signalInfo.hasLongSignal) { + longSignalCount++; + } else if (signalInfo.hasShortSignal) { + shortSignalCount++; + } + + // + // Retrieve Open Price ... + double openPrice = iOpen(_Symbol, _Period, bar_index); + openPrice = NormalizeDouble(openPrice, _Digits); + + // + // Signal Entry Price ... + RefreshRates(); + double signalEntryPrice = signalInfo.hasLongSignal ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID); + // signalInfo.hasLongSignal ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID); + signalEntryPrice = NormalizeDouble(signalEntryPrice, _Digits); + + // + // Signal Time ... + datetime signalTime = iTime(_Symbol, _Period, bar_index); + + // + // Signal Type ... + X_SIGNAL_TYPE signalType = signalInfo.hasLongSignal ? X_LONG : X_SHORT; + result.type = signalType; + + // + // Reading SL ... + XSLInfo slInfo = GetSwngSL(bar_index); + + // + // Reading TP ... + XTPInfo tpInfo = GetTP(bar_index); + + // + // Generate Signal SL ... + double signalSL = signalInfo.hasLongSignal ? slInfo.longSL : slInfo.shortSL; + + // + // Generate Signal TP ... + double signalTP = signalInfo.hasLongSignal ? tpInfo.longTP : slInfo.longSL; // tpInfo.shortTP; + + // + // Generate XSignal Instance based on received Data ... + XSignal signal = {}; + signal.id = signalCount; + signal.sl = signalSL; + signal.tp = signalTP; + signal.time = signalTime; + signal.type = signalType; + signal.symbol = _Symbol; + // signal.openPrice = openPrice; + // signal.entryPrice = signalEntryPrice; + + // + result.signal = signal; + + // + return result; +} + +// +// Calculate Signal ... +// Method 2 ... +XSignalRequest CalculateSignal_2(const int bar_index) { + // + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + // Reading Oscillator State ... + XOSCState oscState = GetOSCState(bar_index); + + // + // Generate Signals From OSC ... + XSignalInfo signalInfo = OSCHasSignal_2( + oscState, + bar_index + ); + + // + result.hasSignal = signalInfo.hasSignal; + if (!signalInfo.hasSignal) { + return result; + } + + // + // increase signal count ... + signalCount++; + + // + // increase long/short signal count ... + if (signalInfo.hasLongSignal) { + longSignalCount++; + } else if (signalInfo.hasShortSignal) { + shortSignalCount++; + } + + // + // Signal Time ... + datetime signalTime = iTime(_Symbol, _Period, bar_index); + + // + // Signal Type ... + X_SIGNAL_TYPE signalType = signalInfo.hasLongSignal ? X_LONG : X_SHORT; + result.type = signalType; + + // + // Reading SL ... + XSLInfo slInfo = GetSwngSL(bar_index); + + // + // Reading TP ... + XTPInfo tpInfo = GetTP(bar_index); + + // + // Generate Signal SL ... + double signalSL = signalInfo.hasLongSignal ? slInfo.longSL : slInfo.shortSL; + + // + // Generate Signal TP ... + double signalTP = signalInfo.hasLongSignal ? tpInfo.longTP : tpInfo.shortTP; + + // + // Generate XSignal Instance based on received Data ... + XSignal signal = {}; + signal.id = signalCount; + signal.sl = signalSL; + signal.tp = signalTP; + signal.time = signalTime; + signal.type = signalType; + signal.symbol = _Symbol; + + // + result.signal = signal; + + // + return result; +} + +// +// Calculate Signal ... +// Using Ma ... +XSignalRequest CalculateMaSignal(const int bar_index) { + // + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + // Reading Moving Average State ... + XMaState maState = GetMaState(bar_index); + + // + // Generate Signals From OSC ... + XSignalInfo signalInfo = MaHasSignal( + maState, + bar_index + ); + Print("Ma HasSignal: ", signalInfo.hasSignal); + + // + result.hasSignal = signalInfo.hasSignal; + if (!signalInfo.hasSignal) { + return result; + } + + // + // increase signal count ... + signalCount++; + + // + // increase long/short signal count ... + if (signalInfo.hasLongSignal) { + longSignalCount++; + } else if (signalInfo.hasShortSignal) { + shortSignalCount++; + } + + // + // Signal Time ... + datetime signalTime = iTime(_Symbol, _Period, bar_index); + + // + // Signal Type ... + X_SIGNAL_TYPE signalType = signalInfo.hasLongSignal ? X_LONG : X_SHORT; + result.type = signalType; + + // + // Reading SL ... + XSLInfo slInfo = GetSwngSL(bar_index); + + // + // Reading TP ... + XTPInfo tpInfo = GetTP(bar_index); + + // + // Generate Signal SL ... + double signalSL = signalInfo.hasLongSignal ? slInfo.longSL : slInfo.shortSL; + + // + // Generate Signal TP ... + double signalTP = signalInfo.hasLongSignal ? tpInfo.longTP : tpInfo.shortTP; + + // + // Generate XSignal Instance based on received Data ... + XSignal signal = {}; + signal.id = signalCount; + signal.sl = signalSL; + signal.tp = signalTP; + signal.time = signalTime; + signal.type = signalType; + signal.symbol = _Symbol; + + // + result.signal = signal; + + // + return result; +} + +// +// Count Open Positions ... +int CountOpenPositions() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Handle Trading On Signals ... +void TradeOnSignal( + const XSignal &signal, + double tradeVolume = 0.1, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrLime, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrRed +) { + // + // Start Genearting required data ... + // + // + // START implementing Money Management ... + // + if (tradeCount == 0) { + // + initialBalance = AccountBalance(); + + // + string msg = StringConcatenate("Initial Account Balance: ", initialBalance); + LogMessage(msg); + } + + // + // Retrieve current Account balance + double currentBalance = AccountBalance(); + if (currentBalance < initialBalance / 2) { + // + string msg = StringConcatenate("Account Balance less than minimum allowed, trading off ..."); + LogMessage(msg); + + // + return; + } + // + // END implementing Money Management ... + // + + // + // Detect Trade is Long or Short ... + bool isLongSignal = signal.type == X_LONG; + + // + // Generate Trade Comment ... + string tradeComment = GenerateSignalTAG( + signal, + signalTag, + longSignalLabel, + shortSignalLabel + ); + + // + // Detect Trade Operation ... + int tradeOperation = isLongSignal ? OP_BUY : OP_SELL; + + // + // Detect Trade Color ... + color tradeColor = isLongSignal ? longSignalColor : shortSignalColor; + // + // End Genearting required data ... + // + + // + double price = 0; + double closePrice = 0; + double priceGap = 0; + double tp = 0; + double sl = 0; + + // + RefreshRates(); + + // + // Calculating Open, SL, TP for Positions ... + if (isLongSignal) { + // + // Long Positions ... + + // + // Prices ... + price = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + closePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + + // + priceGap = closePrice - price; + + // + // SL ... + if (signal.sl > 0) { + sl = signal.sl + priceGap; + } + + // + // TP ... + if (signal.tp > 0) { + tp = signal.tp - priceGap; + } + } else { + // + // Short Positions ... + + // + // Prices ... + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + closePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // SL ... + if (signal.sl > 0) { + sl = signal.sl - priceGap; + } + + // + // TP ... + if (signal.tp > 0) { + tp = signal.tp + priceGap; + } + } + + // + // Ignore last TP and SL Calculation and Use Default ... + // sl = signal.sl; + // tp = signal.tp; + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Define Trade Variables ... + double slGap = SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point; + + // + // Price Check ... + if (price == 0) { + return; + } + + // + // Prevent Open Trading when price doesn't fill slGap ...' + if (signal.sl > 0 && signal.sl < slGap) { + return; + } + + // + // Prevent Open Trading when price doesn't fill slGap ...' + if (signal.tp > 0 && signal.tp < slGap) { + return; + } + + // + // Fix Signal SL and Price Same issue ... + if (price == sl || MathAbs(price - sl) <= slGap) { + // + // string msg = StringConcatenate("id: ", signal.id , ", Price: ", price, ", sl: ", sl); + // LogMessage(msg); + + // + return; + } + + // + // Placing Order ... + int orderTicket = OrderSend( + signal.symbol, + tradeOperation, + tradeVolume, + price, + 3, + sl, + tp, + tradeComment, + (int)signal.id, + 0, + tradeColor + ); + + // + if (orderTicket >= 0) { + tradeCount++; + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignalShape( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + + // + color slColor = isLongSignal ? shortSignalColor : longSignalColor; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Signal SL ... + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal TP ... + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + arrowColor, + STYLE_SOLID, + 2 + ); + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} +// +// End Signal Functions ... +// diff --git a/Bkp/UnUsed/Libs/x-saherelm.xma.models.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.xma.models.lib.mq4 new file mode 100644 index 0000000..cc7b803 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.xma.models.lib.mq4 @@ -0,0 +1,138 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// + +// +// Used Indicators List ... +const string xmaIndicatorName = "x-saherelm.xma"; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XMAState { + // + // Short Cycle ... + // + // FAST ... + double scFast; + double scFastPrev; + + // + // SLOW ... + double scSlow; + double scSlowPrev; + + // + bool isSCTrendUp; + bool isSCTrendDown; + bool isSCFastCrossOverSlow; + bool isSCFastCrossUnderSlow; + + // + // Medium Cycle ... + // + // FAST ... + double mcFast; + double mcFastPrev; + + // + // SLOW ... + double mcSlow; + double mcSlowPrev; + + // + bool isMCTrendUp; + bool isMCTrendDown; + bool isMCFastCrossOverSlow; + bool isMCFastCrossUnderSlow; + + // + // Long Cycle ... + // + // FAST ... + double lcFast; + double lcFastPrev; + + // + // SLOW ... + double lcSlow; + double lcSlowPrev; + + // + bool isLCTrendUp; + bool isLCTrendDown; + bool isLCFastCrossOverSlow; + bool isLCFastCrossUnderSlow; + + // + // MIDDLEAGE ... + double marketMiddleage; + double marketMiddleagePrev; + + // + // Hot Cross Points ... + // + bool isHotCrossOver; + bool isHottestCrossOver; + + // + bool isHotCrossUnder; + bool isHottestCrossUnder; + + // + // Signal ... + bool hasSignal; + bool hasLongSignal; + bool hasShortSignal; + + // + XSignal signal; +}; +// +// End Models ... +// diff --git a/Bkp/UnUsed/Libs/x-saherelm.xma.signal.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.xma.signal.lib.mq4 new file mode 100644 index 0000000..1e016b1 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.xma.signal.lib.mq4 @@ -0,0 +1,1855 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.xma.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static double scTrendPower[]; +static double scMinTrendPower = -1; +static double scMaxTrendPower = -1; +static datetime shortMarketCrossPointsTime[]; + +// +static double mcTrendPower[]; +static double mcMaxTrendPower = -1; +static double mcMinTrendPower = -1; +static datetime mediumMarketCrossPointsTime[]; + +// +static double lcTrendPower[]; +static double lcMaxTrendPower = -1; +static double lcMinTrendPower = -1; +static datetime longMarketCrossPointsTime[]; + +// +static double minMidInSC = -1; +static double maxMidInSC = -1; + + +// +// +// Retrieve and Calculate XMA State ... +XMAState GetXMAState( + const int bar_index, // Bar Index ... + // + // Market Length ... + const int marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // Temp Result ... + XMAState result = {}; + + // + // START Reading Buffers ... + // + // + // Define BufferIndexes ... + int scFastBufIndex = 0; + int scSlowBufIndex = 1; + int mcFastBufIndex = 2; + int mcSlowBufIndex = 3; + int lcFastBufIndex = 4; + int lcSlowBufIndex = 5; + int midBufIndex = 6; + + // + // START Short Cycle ... + // + // + // Short Cycle Fast ... + double scFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + ); + result.scFast = scFast; + + // + // Short Cycle Previous Fast ... + double scFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scFastPrev = scFastPrev; + + // + // Short Cycle Slow ... + double scSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + ); + result.scSlow = scSlow; + + // + // Short Cycle Previous Slow ... + double scSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scSlowPrev = scSlowPrev; + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + // Medium Cycle Fast ... + double mcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + ); + result.mcFast = mcFast; + + // + // Medium Cycle Previous Fast ... + double mcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcFastPrev = mcFastPrev; + + // + // Medium Cycle Slow ... + double mcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.mcSlow = mcSlow; + + // + // Medium Cycle Previous Slow ... + double mcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcSlowPrev = mcSlowPrev; + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + // Long Cycle Fast ... + double lcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + ); + result.lcFast = lcFast; + + // + // Long Cycle Previous Fast ... + double lcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcFastPrev = lcFastPrev; + + // + // Long Cycle Slow ... + double lcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.lcSlow = lcSlow; + + // + // Long Cycle Previous Slow ... + double lcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcSlowPrev = lcSlowPrev; + // + // END Long Cycle ... + // + + // + // START Makret Middleage ... + // + // + // Market Middleage ... + double marketMiddleage = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + ); + result.marketMiddleage = marketMiddleage; + + // + // Previous Market Middleage ... + double marketMiddleagePrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.marketMiddleagePrev = marketMiddleagePrev; + // + // END Makret Middleage ... + // + // + // END Reading Buffers ... + // + + // + // START Calculating ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFast > scSlow + && !(scFastPrev > scSlowPrev); + result.isSCFastCrossOverSlow = isSCFastCrossOverSlow; + + // + bool isSCFastCrossUnderSlow = scFast < scSlow + && !(scFastPrev < scSlowPrev); + result.isSCFastCrossUnderSlow = isSCFastCrossUnderSlow; + + // + bool isSCTrendUp = scFast > scSlow && + scFastPrev > scSlowPrev; + result.isSCTrendUp = isSCTrendUp; + + // + bool isSCTrendDown = !isSCTrendUp + && scFast < scSlow + && scFastPrev < scSlowPrev; + result.isSCTrendDown = isSCTrendDown; + + // + // Fill Cycle Min/Max Trend Powers ... + double scTrendPowerCurrent = MathAbs(scFast - scSlow); + ArrayResize( + scTrendPower, + ArraySize(scTrendPower) + 1 + ); + scTrendPower[0] = scTrendPowerCurrent; + if (scTrendPowerCurrent > scMaxTrendPower) { + scMaxTrendPower = scTrendPowerCurrent; + } + if ( + scMinTrendPower < 0 || + scTrendPowerCurrent < scMinTrendPower) { + scMinTrendPower = scTrendPowerCurrent; + } + + // + // Fill Time Series ... + if ( + isSCFastCrossOverSlow + || isSCFastCrossUnderSlow + ) { + // + // Increase Array Size ... + ArrayResize( + shortMarketCrossPointsTime, + ArraySize(shortMarketCrossPointsTime) + 1 + ); + + // + shortMarketCrossPointsTime[0] = currentTime; + + // + scMinTrendPower = -1; + scMaxTrendPower = -1; + } + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFast > mcSlow + && !(mcFastPrev > mcSlowPrev); + result.isMCFastCrossOverSlow = isMCFastCrossOverSlow; + + // + bool isMCFastCrossUnderSlow = mcFast < mcSlow + && !(mcFastPrev < mcSlowPrev); + result.isMCFastCrossUnderSlow = isMCFastCrossUnderSlow; + + // + bool isMCTrendUp = mcFast > mcSlow && + mcFastPrev > mcSlowPrev; + result.isMCTrendUp = isMCTrendUp; + + // + bool isMCTrendDown = !isMCTrendUp + && mcFast < mcSlow + && mcFastPrev < mcSlowPrev; + result.isMCTrendDown = isMCTrendDown; + + // + // Fill Cycle Min/Max Trend Powers ... + double mcTrendPowerCurrent = MathAbs(mcFast - mcSlow); + ArrayResize( + mcTrendPower, + ArraySize(mcTrendPower) + 1 + ); + mcTrendPower[bar_index] = mcTrendPowerCurrent; + if (mcTrendPowerCurrent > mcMaxTrendPower) { + mcMaxTrendPower = mcTrendPowerCurrent; + } + if ( + mcMinTrendPower < 0 || + mcTrendPowerCurrent < mcMinTrendPower) { + mcMinTrendPower = mcTrendPowerCurrent; + } + + // + // Fill Time Series ... + if ( + isMCFastCrossOverSlow + || isMCFastCrossUnderSlow + ) { + // + // Increase Array Size ... + ArrayResize( + mediumMarketCrossPointsTime, + ArraySize(mediumMarketCrossPointsTime) + 1 + ); + + // + mediumMarketCrossPointsTime[0] = currentTime; + + // + mcMinTrendPower = -1; + mcMaxTrendPower = -1; + } + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFast > lcSlow + && !(lcFastPrev > lcSlowPrev); + result.isLCFastCrossOverSlow = isLCFastCrossOverSlow; + + // + bool isLCFastCrossUnderSlow = lcFast < lcSlow + && !(lcFastPrev < lcSlowPrev); + result.isLCFastCrossUnderSlow = isLCFastCrossUnderSlow; + + // + bool isLCTrendUp = lcFast > lcSlow && + lcFastPrev > lcSlowPrev; + result.isLCTrendUp = isLCTrendUp; + + // + bool isLCTrendDown = !isLCTrendUp + && lcFast < lcSlow + && lcFastPrev < lcSlowPrev; + result.isLCTrendDown = isLCTrendDown; + + // + // Fill Cycle Min/Max Trend Powers ... + double lcTrendPowerCurrent = MathAbs(mcFast - mcSlow); + ArrayResize( + lcTrendPower, + ArraySize(lcTrendPower) + 1 + ); + lcTrendPower[bar_index] = lcTrendPowerCurrent; + if (lcTrendPowerCurrent > lcMaxTrendPower) { + lcMaxTrendPower = lcTrendPowerCurrent; + } + if ( + lcMinTrendPower < 0 || + lcTrendPowerCurrent < lcMinTrendPower) { + lcMinTrendPower = lcTrendPowerCurrent; + } + + // + // Fill Time Series ... + if ( + isLCFastCrossOverSlow + || isLCFastCrossUnderSlow + ) { + // + // Increase Array Size ... + ArrayResize( + longMarketCrossPointsTime, + ArraySize(longMarketCrossPointsTime) + 1 + ); + + // + longMarketCrossPointsTime[0] = currentTime; + + // + lcMinTrendPower = -1; + lcMaxTrendPower = -1; + } + + // + // Reset MinMid and MaxMid ... + if ( + isSCFastCrossOverSlow || + isSCFastCrossUnderSlow + ) { + // + minMidInSC = -1; + maxMidInSC = -1; + } + + // + // Find Hottest Area ... + // + bool isHottestCrossOver = isSCFastCrossOverSlow + && isMCFastCrossOverSlow + && isLCFastCrossOverSlow; + result.isHottestCrossOver = isHottestCrossOver; + + // + bool isHotCrossOver = !isHottestCrossOver + && isSCFastCrossOverSlow + && isMCFastCrossOverSlow; + result.isHotCrossOver = isHotCrossOver; + + // + bool isHottestCrossUnder = isSCFastCrossUnderSlow + && isMCFastCrossUnderSlow + && isLCFastCrossUnderSlow; + result.isHottestCrossUnder = isHottestCrossUnder; + + // + bool isHotCrossUnder = !isHottestCrossUnder + && isMCFastCrossUnderSlow + && isLCFastCrossUnderSlow; + result.isHotCrossUnder = isHotCrossUnder; + // + // END Calculating ... + // + + // + // START Calculate Signal ... + // + // + // Long: + // Entry: + // - prev candle open below Mid line ... + // - current candle price above Mid Line ... + // SL: + // - prev candle High ... + // Exit: + // - r2r 1.5 + // - close < mid ... + + // + // Short: + // Entry: + // - prev candle open above Mid Line ... + // - current candle price below Mid Line + // SL: + // - prev candle Low ... + // Exit: + // - r2r 1.5 + // - close > mid + // + RefreshRates(); + + // + double prevCandleOpen = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleHigh = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleLow = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + + // + bool hasLongSignal = + true + && isSCTrendDown + && marketMiddleage > minMidInSC + && prevCandleOpen < marketMiddleage + && longEntryPrice > marketMiddleage + ; + result.hasLongSignal = hasLongSignal; + + // + bool hasShortSignal = + true + && isSCTrendUp + && marketMiddleage < maxMidInSC + && prevCandleOpen > marketMiddleage + && shortEntryPrice < marketMiddleage; + result.hasShortSignal = hasShortSignal; + + // + bool hasSignal = hasLongSignal || hasShortSignal; + result.hasSignal = hasSignal; + // + // END Calculate Signal ... + // + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest CalculateSignal( + const int bar_index, // Bar Index ... + // + // Market Length ... + const int marketLen, // Market Length ... + // + // Risk To Reward Ratio ... + const double r2r, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + // Get Fully XMA Indicator State ... + XMAState state = GetXMAState( + // + // Bar Index ... + bar_index, // Bar Index ... + // + // Market Length ... + marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + if (!state.hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap; + double sl = 0; + double risk; + double reward; + double tp = 0; + double xmaRiskToReward = r2r; + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + RefreshRates(); + + // + double prevCandleOpen = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleHigh = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleLow = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + + // + // Fill Signal Related Variables ... + if (state.hasLongSignal) { + // + totalLongSignals++; + + // + price = longEntryPrice; + priceGap = longPriceGap; + + // + sl = prevCandleLow; + + // + risk = price - sl; + reward = risk * xmaRiskToReward; + tp = price + reward; + } else if (state.hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // + sl = prevCandleHigh; + + // + risk = sl - price; + reward = risk * xmaRiskToReward; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = state.hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = 0; // sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + + // + // Fill Result ... + result.hasSignal = state.hasSignal; + result.signal = signal; + result.type = signal.type; + + // + return result; +} + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entryPrice, + signal.time, + signal.entryPrice, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + // openPositions == 0 ? + // (volumePercent * balance) : + // (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entryPrice > signal.tp + ) || + ( + !hasLongSignal + && signal.entryPrice < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, "_", + label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// + +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +void CloseAllTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } +} + +// +// Close All Open Long Trades ... +void CloseAllLongTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } + } +} + +// +// Close All Open Short Trades ... +void CloseAllShortTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } + } +} +// +// END Close Orders ... +// +// +// END Orders Functions ... +// diff --git a/Bkp/UnUsed/Libs/x-saherelm.xmma.models.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.xmma.models.lib.mq4 new file mode 100644 index 0000000..c8081d9 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.xmma.models.lib.mq4 @@ -0,0 +1,84 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMMA Models Library +// --------------------------------------------- +// contains all data model definitions related to +// an specific Indicator/Oscillator/Expert ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property description "SaherElm XMMA Models Library" +#property strict + +// +// START Models ... +// + +// +// Used Indicators List ... +const string xmmaIndicatorName = "x-saherelm.xmma"; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +struct XMMAState { + // + double fast; + double fastPrev; + + // + double slow; + double slowPrev; + + // + double mid; + + // + double longSL; + double shortSL; + + // + bool isCrossOver; + bool isCrossUnder; + + // + bool isTrendUp; + bool isTrendDown; +}; +// +// END Models ... +// diff --git a/Bkp/UnUsed/Libs/x-saherelm.xmma.signal.lib.mq4 b/Bkp/UnUsed/Libs/x-saherelm.xmma.signal.lib.mq4 new file mode 100644 index 0000000..5dc36a7 --- /dev/null +++ b/Bkp/UnUsed/Libs/x-saherelm.xmma.signal.lib.mq4 @@ -0,0 +1,1045 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMMA Signalling Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property description "SaherElm XMMA Signalling Librarie" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.xmma.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +XMMAState GetXMMAState( + const int bar_index, + const int mLen, // Market Length ... + const int fShift, // Fast Shift ... + const int sShift // Shift Shift ... +) { + // + // Temp Result ... + XMMAState result = {}; + + // + // Fast ... + double fast = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 0, // Buffer Index ... + bar_index + ); + result.fast = fast; + + // + // FastPrev ... + double fastPrev = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 0, // Buffer Index ... + bar_index + 1 + ); + result.fastPrev = fastPrev; + + // + // Slow ... + double slow = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 1, // Buffer Index ... + bar_index + ); + result.slow = slow; + + // + // SlowPrev ... + double slowPrev = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 1, // Buffer Index ... + bar_index + 1 + ); + result.slowPrev = slowPrev; + + // + // Mid ... + double mid = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 2, // Buffer Index ... + bar_index + ); + result.mid = mid; + + // + // LongSL ... + double longSL = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 3, // Buffer Index ... + bar_index + ); + result.longSL = longSL; + + // + // ShortSL ... + double shortSL = iCustom( + _Symbol, + _Period, + xmmaIndicatorName, + // + // Inputs ... + mLen, // Market Length ... + fShift, // Fast Shift ... + sShift, // Slow Shift ... + // + 4, // Buffer Index ... + bar_index + ); + result.shortSL = shortSL; + + // + // Do Calculations ... + // + // Find Cross Points ... + // + bool isCrossOver = fast >= slow + && !( + fastPrev >= slowPrev + ); + result.isCrossOver = isCrossOver; + + // + bool isCrossUnder = fast <= slow + && !( + fastPrev <= slowPrev + ); + result.isCrossUnder = isCrossUnder; + + // + // Find Trending ... + // + bool isTrendUp = fast > slow + && fast > fastPrev + && slow > slowPrev; + result.isTrendUp = isTrendUp; + + // + bool isTrendDown = fast < slow + && fast < fastPrev + && slow < slowPrev; + result.isTrendDown = isTrendDown; + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest CalculateSignal( + const int bar_index, + // + // Inputs ... + const int mLen, // Market Length ... + const int fShift, // Fast Shift ... + const int sShift // Shift Shift ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + // Define Price Related Variables ... + double tp = 0; + double sl = 0; + double price = 0; + datetime time = 0; + double priceGap = 0; + color clr = clrNONE; + string comment = ""; + double closePrice = 0; + + // + // START Capturing Signal ... + // + // + // START Retrieve Statets ... + // + // Reading Oscillator State ... + XMMAState xmmaState = GetXMMAState( + bar_index, + mLen, + fShift, + sShift + ); + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + // + // START PRICE Calculations ... + // + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + // + // END PRICE Calculations ... + // + // + // END States Calculations ... + // + + // + // START LONG Signals ... + // + bool hasLongSignal = false; + + // + hasLongSignal = + xmmaState.isCrossOver + && xmmaState.isTrendUp + && !xmmaState.isCrossUnder + && !xmmaState.isTrendDown + ; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = + false; + + // + hasShortSignal = + xmmaState.isCrossUnder + && xmmaState.isTrendDown + && !xmmaState.isCrossOver + && !xmmaState.isTrendUp + ; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + return result; + } + + // + // Price ... + price = hasLongSignal ? + longEntryPrice : + shortEntryPrice; + + // + // Close Price ... + closePrice = hasLongSignal ? + longClosePrice : + shortClosePrice; + + // + // Price Gap ... + priceGap = hasLongSignal ? + longPriceGap : + shortPriceGap; + + // + // Calculate Time ... + time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Set TP ... + tp = hasLongSignal ? + // + // Long ... + longClosePrice * (150 * _Point) + : + // + // Short ... + shortClosePrice * (150 * _Point) + ; + + + // + // Set SL ... + sl = hasLongSignal ? + // + // Long ... + xmmaState.longSL + : + // + // Short ... + xmmaState.shortSL + ; + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + // + // END Capturing Signal ... + // + + // + // Retrieve Signal Verifications ... + bool isSignalVerified = + true + && ( + hasLongSignal ? + price > xmmaState.fast + : + true + ) + ; + // GetSignalVerifications( + // signal, + // fOSCLength, + // fOSCMultiplier, + // sOSCLength, + // sOSCMultiplier, + // minPOSC, + // minVOSC, + // zDev, + // zBkStep, + // swingLoopback, + // slThrsh, + // flowMul, + // markMul, + // fastMul, + // slowMul + // ); + + // + // Apply Verifications ... + hasSignal = hasSignal + && isSignalVerified; + + // + result.hasSignal = hasSignal; + if (hasSignal) { + // + // Count Signals ... + totalSignals++; + if (hasLongSignal) { + totalLongSignals++; + } else { + totalShortSignals++; + } + + // + signal.id = totalSignals; + + // + result.signal = signal; + result.type = signal.type; + } + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + //s + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenPositions(); + double volume = (volumePercent * initialBalance); + // openPositions == 0 ? + // (volumePercent * balance) : + // (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, "_", + label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Related Functions ... +// +// +// Count Open Positions ... +int CountOpenPositions() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongPositions() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortPositions() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Close All Open Trades ... +void CloseAllTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } +} + +// +// Close All Open Trades ... +void CloseAllLongTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } + } +} + +// +// Close All Open Trades ... +void CloseAllShortTrades() { + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + } + } + } + } +} +// +// END Orders Related Functions ... +// diff --git a/Bkp/Used/14020419/x-saherelm.ea.mq4 b/Bkp/Used/14020419/x-saherelm.ea.mq4 new file mode 100644 index 0000000..0ca92fd --- /dev/null +++ b/Bkp/Used/14020419/x-saherelm.ea.mq4 @@ -0,0 +1,1444 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input bool useOSCSignalling = false; // Use XOSC Signalling +input string oscSignalIdentifier = "XOSC"; // XOSC Signal Identifier + +// +input bool useXMASignalling = false; // Use XMA Signalling +input string xmaSignalIdentifier = "XMA"; // XMA Signal Identifier + +// +input bool useXSHPSignalling = true; // Use XSHP Signalling +input string xshpSignalIdentifier = "XSHP"; // XSHP Signal Identifier + +// +input bool useXMNTMSignalling = false; // Use XMNTM Signalling +input string xmntmSignalIdentifier = "XMNTM"; // XMNTM Signal Identifier + +// +input bool useXRSISignalling = true; // Use XRSI Signalling +input string xrsiSignalIdentifier = "XRSI"; // XRSI Signal Identifier + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.015; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 504; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// Power OSC ... +input double minPowerOSC = 0.04; // Minimum Signal Power + +// +// Variance OSC ... +input double minVarianceOSC = 0.1; // Minimum Var Power + +// +// ZIGZAG Inputs ... +input int zDeviation = 5; // ZigZag Deviation +input int zBackStep = 3; // ZigZag Back Step + +// +// XMA Inputs ... +// +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showPSar = false; // Show Parabolic Sar +input bool showMarketMiddle = false; // Show Market Middle +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = false; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... + +// +// XMKT Inputs ... +// +// Market Specifications ... +input bool showHighestHigh = false; // Show Market Highest High +input bool showHighestLow = false; // Show Market Highest Low +input bool showHighestOpen = false; // Show Market Highest Open +input bool showHighestClose = false; // Show Market Highest Close +input bool showLowestHigh = false; // Show Market Lowest High +input bool showLowestLow = false; // Show Market Lowest Low +input bool showLowestOpen = false; // Show Market Lowest Open +input bool showLowestClose = false; // Show Market Lowest Close +// +input color highestHighColor = clrDeepPink; // Market Highest High Color +input color highestLowColor = clrDarkOrange; // Market Highest Low Color +input color highestOpenColor = clrDodgerBlue; // Market Highest Open Color +input color highestCloseColor = clrOrchid; // Market Highest Close Color +input color lowestHighColor = clrHotPink; // Market Lowest High Color +input color lowestLowColor = clrOrange; // Market Lowest Low Color +input color lowestOpenColor = clrPowderBlue; // Market Lowest Open Color +input color lowestCloseColor = clrMediumOrchid; // Market Lowest Close Color +// +input ENUM_LINE_STYLE highestHighStyle = STYLE_DOT; // Market Highest High Line Style +input ENUM_LINE_STYLE highestLowStyle = STYLE_DOT; // Market Highest Low Line Style +input ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT; // Market Highest Open Line Style +input ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT; // Market Highest Close Line Style +input ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT; // Market Lowest High Line Style +input ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT; // Market Lowest Low Line Style +input ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT; // Market Lowest Open Line Style +input ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT; // Market Lowest Close Line Style + +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 500; // Sharp Detect Multiplier + +// // +// input bool drawSharpDetectedLabels = false; // Draw Labels on Founded Sharps + +// // +// input string sharpBullishLabel = "SH_BULL"; // Sharp Bullish Label +// input color sharpBullishColor = clrAqua; // Sharp Bullish color + +// // +// input string sharpBearishLabel = "SH_BEAR"; // Sharp Bearish Label +// input color sharpBearishColor = clrFuchsia; // Sharp Bearish color +// // +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +bool isMCGoingToClose; +bool isSharpBullishHappens; +bool isSharpBearishHappens; + +// +datetime startMarketTime; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || minPowerOSC < 0 + || minVarianceOSC < 0 + || slowOSCLength <= fastOSCLength + // + // ZIGZAG ... + || zDeviation < 0 + || zBackStep < 0 + || zBackStep >= marketLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + XOSCState emptyOscState = {}; + ArrayFree(oscStates); + ArrayResize( + oscStates, + marketLength + ); + for (int i = 0; i < marketLength; i++) { + oscStates[i] = emptyOscState; + } + + // + XMAState emptyXmaState = {}; + ArrayFree(xmaStates); + ArrayResize( + xmaStates, + shortCycleSlowMultiplier * marketLength + ); + for (int i = 0; i < shortCycleSlowMultiplier * marketLength; i++) { + xmaStates[i] = emptyXmaState; + } + + // + XMKTState emptyXmktState = {}; + ArrayFree(xmktStates); + ArrayResize( + xmktStates, + marketLength + ); + for (int i = 0; i < marketLength; i++) { + xmktStates[i] = emptyXmktState; + } + + // + // Retrieve Bar Index Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // START Retrieve Statets ... + // + // + // Loop through Market Length ... + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + // Retrieve Index OSC State ... + XOSCState oscState = GetOSCState( + i, // Bar Index ... + fastOSCLength, + fastOSCMultiplier, + slowOSCLength, + slowOSCMultiplier + ); + + // + // Retrieve XMarketState ... + XMKTState xmktState = GetMarketState( + // + i, + marketLength, + // + showHighestHigh, + highestHighColor, + highestHighStyle, + // + showHighestLow, + highestLowColor, + highestLowStyle, + // + showHighestOpen, + highestOpenColor, + highestOpenStyle, + // + showHighestClose, + highestCloseColor, + highestCloseStyle, + // + showLowestHigh, + lowestHighColor, + lowestHighStyle, + // + showLowestLow, + lowestLowColor, + lowestLowStyle, + // + showLowestOpen, + lowestOpenColor, + lowestOpenStyle, + // + showLowestClose, + lowestCloseColor, + lowestCloseStyle + ); + + // + // Set Retrieved Index States ... + oscStates[index] = oscState; + xmktStates[index] = xmktState; + + // + index++; + } + + index = 0; + for (int i = bar_index; i < bar_index + (shortCycleSlowMultiplier * marketLength); i++) { + // + // Retrieve XMA State ... + XMAState xmaState = GetXMAState( + i, // Bar Index ... + marketLength, // Market Length ... + step, // SAR Step ... + maximum, // SAR Maximum ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + showPSar, // Show Parabolic Sar + showMarketMiddle, // Show Market Middle ... + showShortCycle, // Show Short Cycle + showShortCycleCrossLines, // Show Short Cycle Vertical Lines + showMediumCycle, // Show Medium Cycle + showMediumCycleCrossLines, // Show Medium Cycle Vertical Lines + showLongCycle, // Show Long Cycle + showLongCycleCrossLines, // Show Long Cycle Vertical Lines + pSarColor, // Parabolic Sar Color + shortCycleFastColor, // Short Cycle Fast Color ... + shortCycleSlowColor, // Short Cycle Slow Color ... + mediumCycleFastColor, // Medium Cycle Fast Color ... + mediumCycleSlowColor, // Medium Cycle Slow Color ... + longCycleFastColor, // Medium Cycle Fast Color ... + longCycleSlowColor // Medium Cycle Slow Color ... + ); + + // + xmaStates[index] = xmaState; + + // + index++; + } + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + + // + // START OSC Calculations ... + // + // + // END OSC Calculations ... + // + + // + // START XMA Calculations ... + // + + // + // END XMA Calculations ... + // + + // + // START Momentum Calculations ... + // + // + // END Momentum Calculations ... + // + + // + // START RSI Calculations ... + // + // + // END RSI Calculations ... + // + + // + // START PRICE Calculations ... + // + RefreshRates(); + + // + double marketLow[]; + double marketOpen[]; + double marketHigh[]; + double marketClose[]; + // + double marketUp[]; + double marketDown[]; + // + ArrayResize( + marketLow, + marketLength + ); + ArrayResize( + marketOpen, + marketLength + ); + ArrayResize( + marketHigh, + marketLength + ); + ArrayResize( + marketClose, + marketLength + ); + // + ArrayResize( + marketUp, + marketLength + ); + ArrayResize( + marketDown, + marketLength + ); + + // + index = 0; + for (int i = bar_index; i < marketLength + bar_index; i++) { + // + marketLow[index] = iLow( + _Symbol, + _Period, + i + ); + + // + marketOpen[index] = iOpen( + _Symbol, + _Period, + i + ); + + // + marketHigh[index] = iHigh( + _Symbol, + _Period, + i + ); + + // + marketClose[index] = iClose( + _Symbol, + _Period, + i + ); + + // + // marketUp[i] = MathMax(marketOpen[i], marketClose[i]); + marketUp[index] = marketHigh[i]; + + // + // marketDown[i] = MathMin(marketOpen[i], marketClose[i]); + marketDown[index] = marketLow[i]; + + // + index++; + } + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + + // + if (startMarketTime == 0) { + startMarketTime = barTime; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startMarketTime + ); + + // + if (startBarIndex > bar_index + marketLength) { + // + startBarIndex = 0; + startMarketTime = 0; + } + + // + bool isSharpBullishDetected = false; + bool isShareBearishDetected = false; + double sharpDetectionValue = sharpDetectMultiplier * _Point; + if (startBarIndex > bar_index + 1) { + // + double marketStartHigh = iHigh( + _Symbol, + _Period, + startBarIndex + ); + + double marketStartLow = iLow( + _Symbol, + _Period, + startBarIndex + ); + + // + double prevCandleOpen = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleHigh = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double candleOpen = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double prevCandleComparedPrice = MathMin(prevCandleOpen, prevCandleClose); + isShareBearishDetected = + prevCandleHigh < marketStartHigh + && prevCandleComparedPrice < marketStartHigh + && marketStartHigh - prevCandleComparedPrice >= sharpDetectionValue; + + // // + // isSharpBullishDetected = + // marketStartHigh - MathMin(prevCandleOpen, prevCandleClose) >= sharpDetectionValue; + } + // + if ( + isShareBearishDetected + || isSharpBullishDetected + ) { + startBarIndex = 0; + startMarketTime = 0; + } + // + // + // END PRICE Calculations ... + // + + // + // START Capturing Signal ... + // + + // + // START LONG Signals ... + // + // + // NOTES: + // when MC Fast is Over MC Slow, + // All Long Trades must be down when Market Middle is above MCSlow ... + // and must be paused when Market Middle is Going Under MCSlow ... + + // + // OSC ... + bool oscHasLongSignal = false; + if (useOSCSignalling) { + // + oscHasLongSignal = + true + && ( + oscStates[0].fastOSC < 0 + ) + ; + } + + // + // XMA ... + bool xmaHasLongSignal = false; + if (useXMASignalling) { + // + xmaHasLongSignal = + // + // Long Cycle Trend Up ... + xmaStates[0].lcFast > xmaStates[0].lcSlow + // Lowest Low Must be Higher than lcFast ... + && xmktStates[0].lowestLow > xmaStates[0].lcFast + // + // Medium Cycle in Up Trend ... + && xmaStates[0].mcFast > xmaStates[0].mcSlow + // + // and the Medium Cycle Distance must be at least 100 Point ... + && (xmaStates[0].mcFast - xmaStates[0].mcSlow) > (100 * _Point) + // + // then looking for parabolic sar cross down market middleage ... + && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + && !(xmaStates[1].parabolicSAR <= xmaStates[1].marketMiddleage) + // + && xmaStates[0].scFast > xmaStates[0].marketMiddleage + // + // in crossing time Parabolic SAR must be greater than mcFast ... + && xmaStates[0].parabolicSAR > xmaStates[0].mcFast + // + // in this conditions, entry price must below than highest high, in market ... + && longEntryPrice < xmktStates[0].highestHigh + ; + } + + // + bool xshpHasLongSignal = false; + if (useXSHPSignalling) { + // + xshpHasLongSignal = + // + isShareBearishDetected + // + && xmaStates[0].mcFast > xmaStates[0].mcSlow + && xmaStates[1].mcFast > xmaStates[1].mcSlow + && xmaStates[2].mcFast > xmaStates[3].mcSlow + // + && xmaStates[1].mcFast - xmaStates[1].mcSlow > (100 * _Point) + // + && xmktStates[1].lowestLow > xmaStates[1].mcSlow + && xmktStates[1].highestLow > xmktStates[1].lowestHigh + && MathAbs(xmktStates[0].highestLow - xmktStates[0].lowestHigh) > (50 * _Point) + // + && longEntryPrice != xmktStates[0].lowestHigh + && MathAbs(longEntryPrice - xmktStates[0].lowestHigh) > (50 * _Point) + // + && (xmaStates[0].marketMiddleage > xmaStates[0].mcFast + || ( + xmaStates[0].marketMiddleage > xmaStates[0].mcSlow + && xmaStates[0].marketMiddleage < xmaStates[0].mcFast + ) + ) ? + !(longEntryPrice < xmaStates[0].mcSlow) + && !( + longEntryPrice > xmaStates[0].mcSlow + && longEntryPrice < xmaStates[0].mcFast + ) : + true + ; + } + + // + bool xmntmHasLongSignal = false; + if (useXMNTMSignalling) { + } + + // + bool xrsiHasLongSignal = false; + if (useXRSISignalling) { + } + + // + bool hasLongSignal = + // + // OSC Signals ... + oscHasLongSignal + || xmaHasLongSignal + || xshpHasLongSignal + || xmntmHasLongSignal + || xrsiHasLongSignal + ; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = false; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // // + // // Check Short Cycle For Double Crossing ... + // int scCrosses = 0; + // int pSarCrosses = 0; + + // // + // // SC Crosses ... + // for (int i = bar_index; i < bar_index + (shortCycleSlowMultiplier * marketLength) - 1; i++) { + // // + // bool isPSarCrossUnderMarketMid = + // xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage); + + // // + // bool isPSarCrossOverMarketMid = + // xmaStates[0].parabolicSAR > xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage); + + // // + // if ( + // isPSarCrossUnderMarketMid + // || isPSarCrossOverMarketMid + // ) { + // pSarCrosses++; + // } + + // // + // bool isSCFastCrossOverSlow = + // xmaStates[i].scFast > xmaStates[i].scSlow + // && !(xmaStates[i].scFast > xmaStates[i].scSlow); + + // // + // bool isSCFastCrossUnderSlow = + // xmaStates[i].scFast < xmaStates[i].scSlow + // && !(xmaStates[i].scFast < xmaStates[i].scSlow); + + // // + // if ( + // isSCFastCrossOverSlow + // || isSCFastCrossUnderSlow + // ) { + // scCrosses++; + // } + // } + + // // + // // Parabolic SAR ... + // for (int i = bar_index; i < bar_index + (shortCycleFastMultiplier * marketLength) - 1; i++) { + // // + // bool isPSarCrossUnderMarketMid = + // xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage); + + // // + // bool isPSarCrossOverMarketMid = + // xmaStates[0].parabolicSAR > xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage); + + // // + // if ( + // isPSarCrossUnderMarketMid + // || isPSarCrossOverMarketMid + // ) { + // pSarCrosses++; + // } + // } + + // // + // if ( + // scCrosses > 1 + // || pSarCrosses > 1 + // ) { + // LogMessage("Crosses Exceed ..."); + // hasSignal = false; + // } + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap = 0; + double sl = 0; + double risk; + double reward; + double tp = 0; + double r2rRatio = riskToRewardRatio; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Fill Signal Related Variables ... + if (hasLongSignal) { + // + price = longEntryPrice; + priceGap = longPriceGap; + + // + // Setting Up SL Based on Last Market Lowest ... + sl = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + risk = price - sl; + if (risk > (MathAbs(xmaStates[0].mcFast - xmaStates[0].mcSlow) / 2)) { + risk = risk / 3; + } + + reward = risk * r2rRatio; + tp = price + reward; + + // + // Check TP based on Spread ... + if (tp < price + priceGap) { + tp = tp + priceGap; + } + + // + sl = 0; + + // + totalLongSignals++; + } else if (hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // + risk = sl - price; + reward = risk * r2rRatio; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + // + // TODO: Fill Signal Comment By Sgnal Provider + signal.comment = + useOSCSignalling && oscHasLongSignal + ? oscSignalIdentifier + : useXMASignalling && xmaHasLongSignal + ? xmaSignalIdentifier + : useXSHPSignalling && xshpHasLongSignal + ? xshpSignalIdentifier + : useXMNTMSignalling && xmntmHasLongSignal + ? xmntmSignalIdentifier + : useXRSISignalling && xrsiHasLongSignal + ? xrsiSignalIdentifier + : "" + ; + // + // END Capturing Signal ... + // + + // + // Fill Result ... + result.hasSignal = hasSignal; + result.signal = signal; + result.type = signal.type; + + // + // Return Result ... + return result; +} + +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // + // Prevent from Checking, if there is no states available ... + if (ArraySize(xmaStates) == 0) { + return; + } + + // // + // closeLongTrades = + // xmaStates[0].parabolicSAR > xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage) + // ; + + // // + // closeLongTrades = + // false + // ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + // + countedBars++; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor, + // + // Signal Identifiers ... + oscSignalIdentifier, + xmaSignalIdentifier, + xshpSignalIdentifier, + xmntmSignalIdentifier, + xrsiSignalIdentifier + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + // waitForLongSignals = false; + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + // waitForShortSignals = false; + } + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + // waitForShortSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020419/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020419/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..34b539d --- /dev/null +++ b/Bkp/Used/14020419/x-saherelm.signal.lib.mq4 @@ -0,0 +1,2522 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; + +// +static XMAState xmaStates[]; +static XOSCState oscStates[]; +static XMKTState xmktStates[]; +static XSHPDState shpdStates[]; + +// +// Retrieve State ... +XOSCState GetOSCState( + const int bar_index, + const int foLen, + const double foMul, + const int slLen, + const double slMul +) { + // + // Define Trend Direction Related Values ... + // + XOSCState result = {}; + + // + // START Extract Data from Oscillator ... + // + // + // Fast OSC ... + double fastOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + ); + result.fastOSC = fastOSC; + + // + // Slow OSC ... + double slowOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + ); + result.slowOSC = slowOSC; + + // + // Power OSC ... + double powerOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + ); + result.powerOSC = powerOSC; + + // + // Var OSC ... + double varOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + ); + result.varOSC = varOSC; + + // + // Tan FS OSC ... + double tanFSOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 4, // Tan F/S OSC Buffer Index ... + bar_index + ); + result.tanFSOSC = tanFSOSC; + // + // END Extract Data from Oscillator ... + // + + // + return result; +} + +// +// Check Market Ranging or not based on OSC ... +bool IsOSCMarketRanging( + // + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double rangingThreshold, // Detect Ranging based On Power OSC ... + // + // OSC Specifications ... + const int foLen, // Fast OSC Length ... + const double foMul, // Fast OSC Multiplier ... + const int slLen, // Slow OSC Length ... + const double slMul // Slow OSC Multiplier ... +) { + // + bool result = false; + + // + // Detect Buffer Size ... + const int bufferSize = marketLen + bar_index; + double powerOSCBuffer[]; + ArraySetAsSeries( + powerOSCBuffer, + true + ); + ArrayResize( + powerOSCBuffer, + bufferSize + ); + + // + // Loop through Market for Extract PowerOSC from OSC Indicator ... + for (int i = bufferSize - 1; i >= 0; i--) { + // + // Retrieve OSC State at Specific Bar Index ... + XOSCState state = GetOSCState( + i, + foLen, + foMul, + slLen, + slMul + ); + + // + powerOSCBuffer[i] = state.powerOSC; + } + + // + // now we have to extract min and max value of Splitted Buffer ... + XMinMax minMax = GetBufferMinMax(powerOSCBuffer); + + // + // now Check Min and Max Direction and Compare them with Ranging Value ... + result = MathAbs(minMax.min) > rangingThreshold + || MathAbs(minMax.max) > rangingThreshold; + + // + return result; +} + +// +// Retrieve and Calculate XMA State ... +XMAState GetXMAState( + // + // Market Specification Inpouts ... + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + const double stp, // SAR Step ... + const double maxm, // SAR Maximum ... + // + // XMA Inputs ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showPSr, // Show Parabolic Sar + const bool showMMiddle, // Show Market Middle ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color pSrColor, // Parabolic Sar Color + const color scFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // Temp Result ... + XMAState result = {}; + + // + // START Reading Buffers ... + // + // + // Define BufferIndexes ... + int scFastBufIndex = 0; + int scSlowBufIndex = 1; + int mcFastBufIndex = 2; + int mcSlowBufIndex = 3; + int lcFastBufIndex = 4; + int lcSlowBufIndex = 5; + int midBufIndex = 6; + int pSarBufIndex = 7; + + // + // START Short Cycle ... + // + // + // Short Cycle Fast ... + double scFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + ); + result.scFast = scFast; + + // + // Short Cycle Slow ... + double scSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + ); + result.scSlow = scSlow; + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + // Medium Cycle Fast ... + double mcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + ); + result.mcFast = mcFast; + + // + // Medium Cycle Slow ... + double mcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.mcSlow = mcSlow; + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + // Long Cycle Fast ... + double lcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + ); + result.lcFast = lcFast; + + // + // Long Cycle Slow ... + double lcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.lcSlow = lcSlow; + // + // END Long Cycle ... + // + + // + // START Makret Middleage ... + // + // + // Market Middleage ... + double marketMiddleage = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + ); + result.marketMiddleage = marketMiddleage; + // + // END Makret Middleage ... + // + + // + // START Parabolic SAR ... + // + // + // Parabolic ... + double parabolicSAR = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showMMiddle, // Show Market Middle ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + pSarBufIndex, // Buffer Index ... + bar_index + ); + result.parabolicSAR = parabolicSAR; + // + // END Makret Middleage ... + // + // + // END Reading Buffers ... + // + + // + return result; +} + +// +// Retrieve Market State ... +XMKTState GetMarketState( + // + const int bar_index, + // + const int marketLen, + // + const bool showHH, // Show Highest High ... + const color hhColor, // Show Highest High ... + const ENUM_LINE_STYLE hhStyle, // Show Highest High ... + // + const bool showHL, // Show Highest Low ... + const color hlColor, // Show Highest Low ... + const ENUM_LINE_STYLE hlStyle, // Show Highest Low ... + // + const bool showHO, // Show Highest Open ... + const color hoColor, // Show Highest Open ... + const ENUM_LINE_STYLE hoStyle, // Show Highest Open ... + // + const bool showHC, // Show Highest Close ... + const color hcColor, // Show Highest Close ... + const ENUM_LINE_STYLE hcStyle, // Show Highest Close ... + // + const bool showLH, // Show Lowest High ... + const color lhColor, // Show Lowest High ... + const ENUM_LINE_STYLE lhStyle, // Show Lowest High ... + // + const bool showLL, // Show Lowest Low ... + const color llColor, // Show Lowest Low ... + const ENUM_LINE_STYLE llStyle, // Show Lowest Low ... + // + const bool showLO, // Show Lowest Open ... + const color loColor, // Show Lowest Open ... + const ENUM_LINE_STYLE loStyle, // Show Lowest Open ... + // + const bool showLC, // Show Lowest Close ... + const color lcColor, // Show Lowest Close ... + const ENUM_LINE_STYLE lcStyle // Show Lowest Close ... +) { + // + XMKTState result = {}; + + // + int hHBufIndex = 0; + int hLBufIndex = 1; + int hOBufIndex = 2; + int hCBufIndex = 3; + int lHBufIndex = 4; + int lLBufIndex = 5; + int lOBufIndex = 6; + int lCBufIndex = 7; + + // + // START Reading Buffers ... + // + // + // Highest High ... + double hhValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + hHBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.highestHigh = hhValue; + + // + // Highest Low ... + double hlValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + hLBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.highestLow = hlValue; + + // + // Highest Open ... + double hoValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + hOBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.highestOpen = hoValue; + + // + // Highest Close ... + double hcValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + hCBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.highestClose = hcValue; + + // + // Lowest High ... + double lhValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + lHBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.lowestHigh = lhValue; + + // + // Lowest Low ... + double llValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + lLBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.lowestLow = llValue; + + // + // Lowest Open ... + double loValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + lOBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.lowestOpen = loValue; + + // + // Lowest Close ... + double lcValue = iCustom( + _Symbol, + _Period, + xmarketIndicatorName, + // + // Inputs ... + marketLen, // Market Length ... + // + // Show/Hide ... + showHH, // Show Highest High ... + showHL, // Show Highest Low ... + showHO, // Show Highest Open ... + showHC, // Show Highest Close ... + showLH, // Show Lowest High ... + showLL, // Show Lowest Low ... + showLO, // Show Lowest Open ... + showLC, // Show Lowest Close ... + // + // Colors ... + hhColor, // Show Highest High ... + hlColor, // Show Highest Low ... + hoColor, // Show Highest Open ... + hcColor, // Show Highest Close ... + lhColor, // Show Lowest High ... + llColor, // Show Lowest Low ... + loColor, // Show Lowest Open ... + lcColor, // Show Lowest Close ... + // + // Styles ... + hhStyle, // Show Highest High ... + hlStyle, // Show Highest Low ... + hoStyle, // Show Highest Open ... + hcStyle, // Show Highest Close ... + lhStyle, // Show Lowest High ... + llStyle, // Show Lowest Low ... + loStyle, // Show Lowest Open ... + lcStyle, // Show Lowest Close ... + // + lCBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.lowestClose = lcValue; + + // + // END Reading Buffers ... + // + + // + return result; +} + +// +// Retrieve XSHPD State ... +XSHPDState GetXSHPDState( + // + const int bar_index, + // + const int marketLen, + // + const double shpDetectMul, // Sharp Detect Multiplier ... + const bool drwLbls, // Draw Labels on Founded Sharps ... + // + const string shpBullLabel, // Sharp Bullish Label ... + const color shpBullColor, // Sharp Bullish color ... + // + const string shpBearLabel, // Sharp Bearish Label ... + const color shpBearColor // Sharp Bearish color ... +) { + // + // Temp result ... + XSHPDState result = {}; + + // + int sharpBullishBufIndex = 2; + int sharpBearishBufIndex = 3; + + // + double sharpBullishValue = iCustom( + _Symbol, + _Period, + shpdIndicatorName, + // + // Inputs ... + marketLen, + shpDetectMul, + drwLbls, + shpBullLabel, + shpBullColor, + shpBearLabel, + shpBearColor, + // + sharpBullishBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.isSharpBullishDetected = + (int) sharpBullishValue == 1 + ? true + : false; + + // + double sharpBearishValue = iCustom( + _Symbol, + _Period, + shpdIndicatorName, + // + // Inputs ... + marketLen, + shpDetectMul, + drwLbls, + shpBullLabel, + shpBullColor, + shpBearLabel, + shpBearColor, + // + sharpBearishBufIndex, // Buffer Index ... + bar_index // Bar Index ... + ); + result.isSharpBearishDetected = + (int) sharpBearishValue == 1 + ? true + : false; + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + X_DIRECTION direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction == X_UP ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Verification Functions ... +// +// +// END Signal Verification Functions ... +// + +// +// START Market State Functions ... +// +// +// END Market State Functions ... +// + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[SG:" + signal.comment + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entryPrice, + signal.time, + signal.entryPrice, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "\n", + signal.comment + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor, + // + // Define Signal Identifiers ... + const string oscSignalId, // Signal Identifier ... + const string xmaSignalId, // Signal Identifier ... + const string xshpSignalId, // Signal Identifier ... + const string xmntmSignalId, // Signal Identifier ... + const string xrsiSignalId // Signal Identifier ... +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entryPrice > signal.tp + ) || + ( + !hasLongSignal + && signal.entryPrice < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, + "_", label, + "_", signal.comment + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + // Logging Signal Provider ... + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", signal.comment + ) + ); + + // + // TODO: Add Exit Strategy ... + // // + // if (signal.comment == oscSignalId) { + // // + // ArrayResize( + // oscSignals, + // ArraySize(oscSignals) + 1 + // ); + + // // + // oscSignals[ArraySize(oscSignals) - 1] = signal; + // } else if (signal.comment == xmaSignalId) { + // // + // ArrayResize( + // xmaSignals, + // ArraySize(xmaSignals) + 1 + // ); + + // // + // xmaSignals[ArraySize(xmaSignals) - 1] = signal; + // } else if (signal.comment == xshpSignalId) { + // // + // ArrayResize( + // xshpSignals, + // ArraySize(xshpSignals) + 1 + // ); + + // // + // xshpSignals[ArraySize(xshpSignals) - 1] = signal; + // } + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit > 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entryPrice + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// diff --git a/Bkp/Used/14020420/x-saherelm.cci.ea.mq4 b/Bkp/Used/14020420/x-saherelm.cci.ea.mq4 new file mode 100644 index 0000000..3697d14 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.cci.ea.mq4 @@ -0,0 +1,532 @@ +//+------------------------------------------------------------------+ +//| x-saherelm.ea | +//| Copyright 2023, SaherElm IT Center | +//| https://www.saherelm.ir | +//+------------------------------------------------------------------+ +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Inputs ... +input double riskToReward = 1.5; // Risk To Reward Ratio + +// +// Define Models ... +// +// Signal Providers ... +enum ENUM_XSIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER = 0, + X_CCI_PROVIDER = 1 +}; + +// +// Signal Type ... +enum ENUM_XSIGNAL_TYPE { + X_NONE = 0, + X_BUY = 1, + X_SELL = 2 +}; + +// +// Signal ... +struct XSignal { + // + // Signal Type ... + ENUM_XSIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_XSIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double price; + + // + // Signalling Time ... + datetime time; +}; + +// +// CCI Based Signal Conditions ... +struct XCCILongSignalConditions { + // + datetime start; + + // + datetime crossOverMinusHundredTime; + datetime crossUnderMinusHundredTime; + + // + double crossOverSlope; +}; + +// +bool isNewBar = false; + +// +int countedBars = 0; +int totalSignals = 0; +int lastSignalledBar = 0; + +// +XCCILongSignalConditions cciLongConds = {}; + +//+------------------------------------------------------------------+ +//| Expert initialization function | +//+------------------------------------------------------------------+ +int OnInit() +{ + return(INIT_SUCCEEDED); +} + +//+------------------------------------------------------------------+ +//| Expert tick function | +//+------------------------------------------------------------------+ +void OnTick() +{ + // + isNewBar = IsNewBar(); + + // + if (isNewBar) { + // + countedBars++; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + 0 + ); + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + // Generate Signals Based On iCCI ... + CheckCCILongSignalConditions(0); + + // + // Long Signal ... + hasLongSignal = + // + // Check CCI Long Signal is Valid ... + ValidateCCILongConditions(); + + // + // Signal ... + hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent Going Forward when there is no Signal ... + if (!hasSignal) { + return; + } + + // + if (lastSignalledBar == countedBars) { + return; + } + + // + totalSignals++; + lastSignalledBar = countedBars; + + // + // Get CCI Long Signal ... + XSignal signal = {}; + + // + if (hasLongSignal) { + signal = GenerateCCILongSignal(); + } + + // + TradeOnSignal(signal); + + // + Print("CCI Long Signal ..."); + + // + ClearCCILongSignalConditions(); +} + +// +// Trade Based On Signal ... +void TradeOnSignal( + XSignal &signal +) { + // + if (signal.type == X_NONE) { + return; + } + + // + bool isLongSignal = signal.type == X_BUY; + + // + // Order Operation ... + int operation = isLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = isLongSignal ? + clrAqua : + clrFuchsia; + + // + // Generate Signal Comment ... + string label = isLongSignal ? + "BUY" : + "SELL"; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + "XCCI", + "_", signal.id, + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + 0.01, + signal.price, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + Print("Order: ", orderTicket, " ..."); + } +} + +// +// Convert CCI Long Signal Conditions to XSignal ... +XSignal GenerateCCILongSignal() { + // + XSignal result = {}; + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = GetLowestLow(); + double hh = GetHighestHigh(); + double pSar = iSAR( + _Symbol, + _Period, + 0.002, + 0.02, + 0 + ); + + // + double sl = ll; + + // + double risk = entryPrice - ll; + double reward = risk * riskToReward; + + // + double tp = entryPrice + reward; + + // + if (tp > hh) { + tp = hh; + } + + // + if (tp < entryPrice + priceGap) { + tp = entryPrice + priceGap; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + 0 + ); + + // + result.tp = tp; + result.sl = 0; // sl; + result.type = X_BUY; + result.id = totalSignals; + result.price = entryPrice; + result.provider = X_CCI_PROVIDER; + result.time = barTime; + + // + return result; +} + +// +// Validate CCI Signal Conditions ... +bool ValidateCCILongConditions() { + // + bool result = + cciLongConds.start != 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + && cciLongConds.crossOverMinusHundredTime != 0 + && cciLongConds.crossUnderMinusHundredTime >= cciLongConds.start + && cciLongConds.crossOverMinusHundredTime > cciLongConds.crossUnderMinusHundredTime + && cciLongConds.crossOverSlope > 0; + + // + return result; +} + +// +// Clear CCI Long Signal Conditions for New One ... +void ClearCCILongSignalConditions() { + // + cciLongConds.start = 0; + cciLongConds.crossOverSlope = 0; + cciLongConds.crossOverMinusHundredTime = 0; + cciLongConds.crossUnderMinusHundredTime = 0; +} + +// +// Check and Fill CC Signal Conditions ... +void CheckCCILongSignalConditions( + const int bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // LONG: + // wait for cci cross under -100 + // then wait for cross over -100 + // slope of crossing over ??? ... + if (cciLongConds.start == 0) { + cciLongConds.start = barTime; + } + + // + // Check Start Time ... + if (cciLongConds.start == 0) { + return; + } + + // + // Read current, prev, and prevPrev CCI ... + double cci = GetCCI(bar_index); + double cci1 = GetCCI(bar_index + 1); + double cci2 = GetCCI(bar_index + 2); + + // + // Find Cross Under -100 ... + bool isCrossUnderMinusHundred = + cci < -100 && !(cci1 < -100); + + // + // Fill Conditions ... + if ( + isCrossUnderMinusHundred + && cciLongConds.crossUnderMinusHundredTime == 0 + ) { + // + cciLongConds.crossUnderMinusHundredTime = barTime; + } + + // + // Prevent Going forward untill Cross Under Happens ... + if (cciLongConds.crossUnderMinusHundredTime == 0) { + return; + } + + // + // Find Cross Over -100 ... + bool isCrossOverMinusHundred = + cci > -100 && !(cci1 > -100); + + // + // Fill Conditions ... + if ( + isCrossOverMinusHundred + && cciLongConds.crossOverMinusHundredTime == 0 + ) { + // + cciLongConds.crossOverMinusHundredTime = barTime; + } + + // + // Prevent from Going forward untill Cross Over Happens ... + if (cciLongConds.crossOverMinusHundredTime == 0) { + return; + } + + // + // Calculate Slope ... + double x1 = 0; + double y1 = cci1; + double x2 = 1; + double y2 = cci; + + // + // Calculat Line Slope ... + double tSlope = GetSlope( + x1, y1, x2, y2 + ); + + // + cciLongConds.crossOverSlope = tSlope; +} + + +// +// Retrieve CCI Value ... +double GetCCI( + const int bar_index, + const int marketLength = 504, + const ENUM_APPLIED_PRICE source = PRICE_TYPICAL +) { + // + double result = iCCI( + _Symbol, + _Period, + marketLength, + source, + bar_index + ); + + // + return result; +} + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + static datetime lastbar; + datetime curbar = (datetime)SeriesInfoInteger(_Symbol, _Period, SERIES_LASTBAR_DATE); + + // + if(lastbar != curbar) { + // + lastbar = curbar; + return true; + } + + // + return false; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/(x2 - x1); + return result; +} + +// +// Market Related Functions ... +// +double GetLowestLow() { + // + int index = iLowest( + _Symbol, + _Period, + MODE_LOW, + 14, + 0 + ); + + // + double result = iLow( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +double GetHighestHigh() { + // + int index = iHighest( + _Symbol, + _Period, + MODE_HIGH, + 14, + 0 + ); + + // + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + return result; +} \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.ea.mq4 b/Bkp/Used/14020420/x-saherelm.ea.mq4 new file mode 100644 index 0000000..978d81d --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.ea.mq4 @@ -0,0 +1,1277 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input bool useOSCSignalling = false; // Use XOSC Signalling +input string oscSignalIdentifier = "XOSC"; // XOSC Signal Identifier + +// +input bool useXMASignalling = false; // Use XMA Signalling +input string xmaSignalIdentifier = "XMA"; // XMA Signal Identifier + +// +input bool useXSHPSignalling = true; // Use XSHP Signalling +input string xshpSignalIdentifier = "XSHP"; // XSHP Signal Identifier + +// +input bool useXMNTMSignalling = false; // Use XMNTM Signalling +input string xmntmSignalIdentifier = "XMNTM"; // XMNTM Signal Identifier + +// +input bool useXRSISignalling = true; // Use XRSI Signalling +input string xrsiSignalIdentifier = "XRSI"; // XRSI Signal Identifier + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.01; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 504; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// XMA Inputs ... +// +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 500; // Sharp Detect Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +bool isSharpBullishHappens; +bool isSharpBearishHappens; + +// +datetime startMarketTime; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || slowOSCLength <= fastOSCLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + if (countedBars < (longCycleSlowMultiplier * marketLength)) { + return result; + } + + // + int marketArraySize = shortCycleSlowMultiplier * marketLength; + ArrayResize( + oscStates, + marketArraySize + ); + ArrayResize( + xmaStates, + marketArraySize + ); + ArrayResize( + cciStates, + marketArraySize + ); + + // + // Retrieve Bar Index Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // START Retrieve Statets ... + // + // + // Loop through Market Length ... + int index = 0; + for (int i = bar_index; i < bar_index + marketArraySize; i++) { + // + // Retrieve XMA State ... + XMAState xmaState = {}; + + // + // Short Cycle ... + XMACycleState sc = GetXMASC( + i, + marketLength, + shortCycleFastMultiplier, + shortCycleSlowMultiplier + ); + xmaState.sc = sc; + + // + // Medium Cycle ... + XMACycleState mc = GetXMAMC( + i, + marketLength, + mediumCycleFastMultiplier, + mediumCycleSlowMultiplier + ); + xmaState.mc = mc; + + // + // Long Cycle ... + XMACycleState lc = GetXMAMC( + i, + marketLength, + longCycleFastMultiplier, + longCycleSlowMultiplier + ); + xmaState.lc = lc; + + // + // Market Middleage ... + double marketMiddle = GetXMAMM( + i, + marketLength, + 1.5 + ); + xmaState.marketMiddleage = marketMiddle; + + // + // Parabolic SAR ... + double pSar = GetXMAPSAR( + i, + step, + maximum + ); + xmaState.parabolicSAR = pSar; + + // + xmaStates[index] = xmaState; + + // + // Retrieve OSC State ... + // TODO Complete this ... + XMACycleState oscState = {}; + + // + // Retriec CCI ... + double cciValue = GetMarketCCI( + bar_index, + longCycleSlowMultiplier * marketLength, + PRICE_CLOSE + ); + cciStates[index] = cciValue; + + // + index++; + } + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + + // + // START OSC Calculations ... + // + // + // END OSC Calculations ... + // + + // + // START XMA Calculations ... + // + + // + // END XMA Calculations ... + // + + // + // START Momentum Calculations ... + // + // + // END Momentum Calculations ... + // + + // + // START RSI Calculations ... + // + // + // END RSI Calculations ... + // + + // + // START PRICE Calculations ... + // + RefreshRates(); + + // + double marketLow[]; + double marketOpen[]; + double marketHigh[]; + double marketClose[]; + // + double marketUp[]; + double marketDown[]; + // + ArrayResize( + marketLow, + marketLength + ); + ArrayResize( + marketOpen, + marketLength + ); + ArrayResize( + marketHigh, + marketLength + ); + ArrayResize( + marketClose, + marketLength + ); + // + ArrayResize( + marketUp, + marketLength + ); + ArrayResize( + marketDown, + marketLength + ); + + // + index = 0; + for (int i = bar_index; i < marketLength + bar_index; i++) { + // + marketLow[index] = iLow( + _Symbol, + _Period, + i + ); + + // + marketOpen[index] = iOpen( + _Symbol, + _Period, + i + ); + + // + marketHigh[index] = iHigh( + _Symbol, + _Period, + i + ); + + // + marketClose[index] = iClose( + _Symbol, + _Period, + i + ); + + // + // marketUp[i] = MathMax(marketOpen[i], marketClose[i]); + marketUp[index] = marketHigh[i]; + + // + // marketDown[i] = MathMin(marketOpen[i], marketClose[i]); + marketDown[index] = marketLow[i]; + + // + index++; + } + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + + // + if (startMarketTime == 0) { + startMarketTime = barTime; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startMarketTime + ); + + // + if (startBarIndex > bar_index + marketLength) { + // + startBarIndex = 0; + startMarketTime = 0; + } + + // + bool isSharpBullishDetected = false; + bool isShareBearishDetected = false; + double sharpDetectionValue = sharpDetectMultiplier * _Point; + if (startBarIndex > bar_index + 1) { + // + double marketStartHigh = iHigh( + _Symbol, + _Period, + startBarIndex + ); + + double marketStartLow = iLow( + _Symbol, + _Period, + startBarIndex + ); + + // + double prevCandleOpen = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleHigh = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double prevCandleClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double candleOpen = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double prevCandleComparedPrice = MathMin(prevCandleOpen, prevCandleClose); + isShareBearishDetected = + prevCandleHigh < marketStartHigh + && prevCandleComparedPrice < marketStartHigh + && marketStartHigh - prevCandleComparedPrice >= sharpDetectionValue; + + // // + // isSharpBullishDetected = + // marketStartHigh - MathMin(prevCandleOpen, prevCandleClose) >= sharpDetectionValue; + } + // + if ( + isShareBearishDetected + || isSharpBullishDetected + ) { + startBarIndex = 0; + startMarketTime = 0; + } + // + // + // END PRICE Calculations ... + // + + // + // START Capturing Signal ... + // + + // + // START LONG Signals ... + // + // + // NOTES: + // when MC Fast is Over MC Slow, + // All Long Trades must be down when Market Middle is above MCSlow ... + // and must be paused when Market Middle is Going Under MCSlow ... + double rewardMultiplier = 1; + + // + // OSC ... + bool oscHasLongSignal = false; + if (useOSCSignalling) { + // // + // oscHasLongSignal = + // true + // && ( + // oscStates[0].fastOSC < 0 + // ) + // ; + } + + // + // XMA ... + bool xmaHasLongSignal = false; + if (useXMASignalling) { + // // + // xmaHasLongSignal = + // // + // // Long Cycle Trend Up ... + // xmaStates[0].lcFast > xmaStates[0].lcSlow + // // Lowest Low Must be Higher than lcFast ... + // && xmktStates[0].lowestLow > xmaStates[0].lcFast + // // + // // Medium Cycle in Up Trend ... + // && xmaStates[0].mcFast > xmaStates[0].mcSlow + // // + // // and the Medium Cycle Distance must be at least 100 Point ... + // && (xmaStates[0].mcFast - xmaStates[0].mcSlow) > (100 * _Point) + // // + // // then looking for parabolic sar cross down market middleage ... + // && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR <= xmaStates[1].marketMiddleage) + // // + // && xmaStates[0].scFast > xmaStates[0].marketMiddleage + // // + // // in crossing time Parabolic SAR must be greater than mcFast ... + // && xmaStates[0].parabolicSAR > xmaStates[0].mcFast + // // + // // in this conditions, entry price must below than highest high, in market ... + // && longEntryPrice < xmktStates[0].highestHigh + // ; + } + + // + bool xshpHasLongSignal = false; + if (useXSHPSignalling) { + // + bool condition1 = + // + xmaStates[0].sc.fast > xmaStates[0].sc.slow + && xmaStates[0].mc.fast > xmaStates[0].mc.slow + && xmaStates[0].lc.fast > xmaStates[0].lc.slow + // + && MathAbs(xmaStates[0].mc.fast - xmaStates[0].mc.slow) > (20 * _Point) + // + && ( + cciStates[0] > 0 + || cciStates[0] > cciStates[1] + ) + // + && !( + longEntryPrice < xmaStates[0].lc.fast + && longEntryPrice > xmaStates[0].lc.slow + && ( + ( + longEntryPrice < xmaStates[0].sc.fast + && marketHigh[1] < xmaStates[0].sc.fast + ) || ( + longEntryPrice < xmaStates[0].lc.fast + && marketHigh[1] < xmaStates[0].lc.fast + ) + ) + ) + //&& longEntryPrice < marketHigh[0] + ; + + // + xshpHasLongSignal = + // + isShareBearishDetected + // + && (condition1) + ; + + // + // Check Reward Multiplier ... + if (xshpHasLongSignal) { + // + double prevCandleLow = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double marketLowest = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + if ( + prevCandleLow == marketLowest + || marketLowest < xmaStates[0].mc.slow + || MathAbs(prevCandleLow - marketLowest) < (50 * _Point) + ) { + rewardMultiplier = 0.3; + } + } + } + + // + bool xmntmHasLongSignal = false; + if (useXMNTMSignalling) { + } + + // + bool xrsiHasLongSignal = false; + if (useXRSISignalling) { + } + + // + bool hasLongSignal = + // + // OSC Signals ... + oscHasLongSignal + || xmaHasLongSignal + || xshpHasLongSignal + || xmntmHasLongSignal + || xrsiHasLongSignal + ; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = false; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap = 0; + double sl = 0; + double risk; + double reward; + double tp = 0; + double r2rRatio = riskToRewardRatio; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Fill Signal Related Variables ... + if (hasLongSignal) { + // + price = longEntryPrice; + priceGap = longPriceGap; + + // + // Setting Up SL Based on Last Market Lowest ... + sl = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + risk = price - sl; + reward = risk * r2rRatio; + reward = reward * rewardMultiplier; + tp = price + reward; + + // + // Check TP based on Spread ... + if (tp < price + priceGap) { + tp = tp + priceGap; + } + + // + sl = 0; + + // + totalLongSignals++; + } else if (hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // + risk = sl - price; + reward = risk * r2rRatio; + reward = reward * rewardMultiplier; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + // + // TODO: Fill Signal Comment By Sgnal Provider + signal.comment = + useOSCSignalling && oscHasLongSignal + ? oscSignalIdentifier + : useXMASignalling && xmaHasLongSignal + ? xmaSignalIdentifier + : useXSHPSignalling && xshpHasLongSignal + ? xshpSignalIdentifier + : useXMNTMSignalling && xmntmHasLongSignal + ? xmntmSignalIdentifier + : useXRSISignalling && xrsiHasLongSignal + ? xrsiSignalIdentifier + : "" + ; + // + // END Capturing Signal ... + // + + // + // Fill Result ... + result.hasSignal = hasSignal; + result.signal = signal; + result.type = signal.type; + + // + // Return Result ... + return result; +} + +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // + // Prevent from Checking, if there is no states available ... + if (ArraySize(xmaStates) == 0) { + return; + } + + // // + // closeLongTrades = + // xmaStates[0].parabolicSAR > xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage) + // ; + + // // + // closeLongTrades = + // false + // ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + // + countedBars++; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor, + // + // Signal Identifiers ... + oscSignalIdentifier, + xmaSignalIdentifier, + xshpSignalIdentifier, + xmntmSignalIdentifier, + xrsiSignalIdentifier + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + // waitForLongSignals = false; + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + // waitForShortSignals = false; + } + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + // waitForShortSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.models.lib.mq4 b/Bkp/Used/14020420/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..c772d86 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.models.lib.mq4 @@ -0,0 +1,100 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// +// +// Used Indicators List ... +const string xmaIndicatorName = "x-saherelm.xma"; +const string adxIndicatorName = "x-saherelm.adx"; +const string oscIndicatorName = "x-saherelm.osc"; +const string shpdIndicatorName = "x-saherelm.shpd"; +const string zigZagIndicatorName = "x-saherelm.zigzag"; +const string xmarketIndicatorName = "x-saherelm.xmarket"; +const string momentumIndicatorName = "x-saherelm.momentum"; + +// +// Direction ... +enum X_DIRECTION { + X_UP, + X_DOWN +}; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + int ticket; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + string comment; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +struct XMACycleState { + double fast; + double slow; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XMAState { + // + // SC ... + XMACycleState sc; + + // + // MC ... + XMACycleState mc; + + // + // LC ... + XMACycleState lc; + + // + // MIDDLEAGE ... + double marketMiddleage; + + // + // PARABOLIC-SAR ... + double parabolicSAR; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020420/x-saherelm.osc.mq4 b/Bkp/Used/14020420/x-saherelm.osc.mq4 new file mode 100644 index 0000000..220bd33 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.osc.mq4 @@ -0,0 +1,330 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 5 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 5 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// Power OSC ... +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASHDOTDOT + +// +// Var OSC ... +#property indicator_width4 1 +#property indicator_type4 DRAW_HISTOGRAM +#property indicator_color4 clrBlueViolet +#property indicator_style4 STYLE_SOLID + +// +// Tan Fast/Slow OSC ... +#property indicator_width5 0 +#property indicator_type5 DRAW_NONE +#property indicator_color5 clrNONE +#property indicator_style5 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 +#define powerOSCBufferIndex 2 +#define varOSCBufferIndex 3 +#define fastSlowOSCAngleBufferIndex 4 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; +double fastSlowOSCAngleBuffer[]; +double powerOSCBuffer[]; +double varOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + // Power OSC Buffer ... + SetIndexBuffer(powerOSCBufferIndex, powerOSCBuffer); + SetIndexLabel(powerOSCBufferIndex, "Power OSC"); + + // + // Var OSC Buffer ... + SetIndexBuffer(varOSCBufferIndex, varOSCBuffer); + SetIndexLabel(varOSCBufferIndex, "Var OSC"); + + // + // Tan Fast/Slow OSC Buffer ... + SetIndexBuffer(fastSlowOSCAngleBufferIndex, fastSlowOSCAngleBuffer); + SetIndexLabel(fastSlowOSCAngleBufferIndex, "F/L OSC Angle"); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; + + // + // Signal Power ... + // Difference Variant between FastOSC and Slow OSC ... + double powerOSC = fastOCS - slowOCS; + powerOSCBuffer[bar_index] = powerOSC; + + // + // Var OSC ... + double varOSC = fastOCS - 0.5; + varOSCBuffer[bar_index] = varOSC; + + // + // Calculate Tan Fast/Slow OSC ... + double fastOSCSlope = fastOSCBuffer[bar_index] - fastOSCBuffer[bar_index + 1]; + double slowOSCSlope = slowOSCBuffer[bar_index] - slowOSCBuffer[bar_index + 1]; + double tanFastSlowOSC = MathAbs( + (fastOSCSlope - slowOSCSlope) / (1 + (fastOSCSlope * slowOSCSlope)) + ); + + // + // here we pass Tan of angle ... + // fastSlowOSCAngleBuffer[bar_index] = tanFastSlowOSC; + + // + // here we pass degree of angle ... + fastSlowOSCAngleBuffer[bar_index] = MathArctan(tanFastSlowOSC); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.x.hl.mq4 b/Bkp/Used/14020420/x-saherelm.x.hl.mq4 new file mode 100644 index 0000000..f08a975 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.x.hl.mq4 @@ -0,0 +1,412 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Highest High Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Lowest Low Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Highest High Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Lowest Low Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// HH Buffers ... +#define scHHBufferIndex 0 +#define scLLBufferIndex 1 +#define mcHHBufferIndex 2 +#define mcLLBufferIndex 3 +#define lcHHBufferIndex 4 +#define lcLLBufferIndex 5 + +double scHHBuffer[]; +double scLLBuffer[]; +double mcHHBuffer[]; +double mcLLBuffer[]; +double lcHHBuffer[]; +double lcLLBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Highest High and Lowest Low Buffers ... + // + // Short Cycle Highest High ... + string scHHLbl = StringConcatenate( + "SC HH(", shortCycleLength, ")" + ); + SetIndexBuffer(scHHBufferIndex, scHHBuffer); + SetIndexLabel(scHHBufferIndex, scHHLbl); + + // + // Short Cycle Lowest Low ... + string scLLLbl = StringConcatenate( + "SC LL(", shortCycleLength, ")" + ); + SetIndexBuffer(scLLBufferIndex, scLLBuffer); + SetIndexLabel(scLLBufferIndex, scLLLbl); + + // + // Medium Cycle Highest High ... + string mcHHLbl = StringConcatenate( + "MC HH(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcHHBufferIndex, mcHHBuffer); + SetIndexLabel(mcHHBufferIndex, mcHHLbl); + + // + // Medium Cycle Lowest Low ... + string mcLLLbl = StringConcatenate( + "MC LL(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcLLBufferIndex, mcLLBuffer); + SetIndexLabel(mcLLBufferIndex, mcLLLbl); + + // + // Long Cycle Highest High ... + string lcHHLbl = StringConcatenate( + "LC HH(", longCycleLength, ")" + ); + SetIndexBuffer(lcHHBufferIndex, lcHHBuffer); + SetIndexLabel(lcHHBufferIndex, lcHHLbl); + + // + // Long Cycle Lowest Low ... + string lcLLLbl = StringConcatenate( + "LC LL(", longCycleLength, ")" + ); + SetIndexBuffer(lcLLBufferIndex, lcLLBuffer); + SetIndexLabel(lcLLBufferIndex, lcLLLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + // Short Cycle Highest High ... + // + int scHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + shortCycleLength, + bar_index + ); + + // + double scHH = iHigh( + _Symbol, + _Period, + scHHIdx + ); + + // + scHHBuffer[bar_index] = scHH; + + // + // Short Cycle Lowest Low ... + // + int scLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + shortCycleLength, + bar_index + ); + + // + double scLL = iLow( + _Symbol, + _Period, + scLLIdx + ); + + // + scLLBuffer[bar_index] = scLL; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + // Medium Cycle Highest High ... + // + int mcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + mediumCycleLength, + bar_index + ); + + // + double mcHH = iHigh( + _Symbol, + _Period, + mcHHIdx + ); + + // + mcHHBuffer[bar_index] = mcHH; + + // + // Medium Cycle Lowest Low ... + // + int mcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + mediumCycleLength, + bar_index + ); + + // + double mcLL = iLow( + _Symbol, + _Period, + mcLLIdx + ); + + // + mcLLBuffer[bar_index] = mcLL; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + // Long Cycle Highest High ... + // + int lcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + longCycleLength, + bar_index + ); + + // + double lcHH = iHigh( + _Symbol, + _Period, + lcHHIdx + ); + + // + lcHHBuffer[bar_index] = lcHH; + + // + // Long Cycle Lowest Low ... + // + int lcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + longCycleLength, + bar_index + ); + + // + double lcLL = iLow( + _Symbol, + _Period, + lcLLIdx + ); + + // + lcLLBuffer[bar_index] = lcLL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.x.trend.power.mq4 b/Bkp/Used/14020420/x-saherelm.x.trend.power.mq4 new file mode 100644 index 0000000..dc70f81 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.x.trend.power.mq4 @@ -0,0 +1,265 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 +#define diBufferIndex 3 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; +double diBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + double ema = GetMA( + bar_index, + marketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.x.trend.power.v2.mq4 b/Bkp/Used/14020420/x-saherelm.x.trend.power.v2.mq4 new file mode 100644 index 0000000..de50c39 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.x.trend.power.v2.mq4 @@ -0,0 +1,291 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +input int shift = 0; // Shift +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +// #property indicator_minimum 0 +// #property indicator_maximum 200 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// #property indicator_type4 DRAW_LINE +// #property indicator_color4 clrAqua +// #property indicator_style4 STYLE_DASHDOT +// #property indicator_width4 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 +// #define diBufferIndex 3 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; +// double diBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // // + // SetLevelValue(0, 0.0); + // IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // // + // SetLevelValue(1, 50); + // IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // // + // SetLevelValue(2, 100); + // IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // // + // string pDiLbl = StringConcatenate( + // "P DI (", marketLength, ")" + // ); + // SetIndexLabel(diBufferIndex, pDiLbl); + // SetIndexBuffer(diBufferIndex, diBuffer); + // SetIndexDrawBegin(diBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index + shift; i < bar_index + marketLength + shift; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + + // + double ema = GetMA( + bar_index, + (marketLength * 2), + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + powerUpBuffer[bar_index] = powerUp; + + // + powerDownBuffer[bar_index] = -1 * powerDown; + + // + double emaRate = MathAbs(powerUp - MathAbs(powerDown)) / 100; + double signal = (ema / 100) * emaRate; + + // + bool isPowerUp = powerUp > MathAbs(powerDown); + double signalAddition = isPowerUp ? (-1 * powerDown) : powerUp; + signalBuffer[bar_index] = signal + signalAddition; + // + // double pDiff = powerUpBuffer[bar_index] - powerDownBuffer[bar_index]; + // double cDiValue = pDiff + signalBuffer[bar_index]; + // diBuffer[bar_index] = cDiValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020420/x-saherelm.x.xma.mq4 b/Bkp/Used/14020420/x-saherelm.x.xma.mq4 new file mode 100644 index 0000000..b8c64d7 --- /dev/null +++ b/Bkp/Used/14020420/x-saherelm.x.xma.mq4 @@ -0,0 +1,395 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input double step = 0.02; // P SAR Step +input double maximum = 0.2; // P SAR Maximum + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 7 + +// +#property indicator_plots 7 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Fast Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Slow Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Fast Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Slow Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Fast Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Slow Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 + +// +// Parabolic SAR ... +#property indicator_type7 DRAW_LINE +#property indicator_color7 C'0,174,255' +#property indicator_style7 STYLE_DASHDOT +#property indicator_width7 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// Ma Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define psarBufferIndex 6 + +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double psarBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Ma Buffers ... + // + // Short Cycle ... + string scFLbl = StringConcatenate( + "SC F(", shortCycleLength, ")" + ); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexLabel(scFastBufferIndex, scFLbl); + + // + string scSLbl = StringConcatenate( + "SC S(", shortCycleLength, ")" + ); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexLabel(scSlowBufferIndex, scSLbl); + + // + // Medium Cycle ... + string mcFLbl = StringConcatenate( + "MC F(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexLabel(mcFastBufferIndex, mcFLbl); + + // + string mcSLbl = StringConcatenate( + "MC S(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexLabel(mcSlowBufferIndex, mcSLbl); + + // + // Long Cycle ... + string lcFLbl = StringConcatenate( + "LC F(", longCycleLength, ")" + ); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexLabel(lcFastBufferIndex, lcFLbl); + + // + string lcSLbl = StringConcatenate( + "LC S(", longCycleLength, ")" + ); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexLabel(lcSlowBufferIndex, lcSLbl); + // + // End Set Index Buffers ... + // + + // + // Parabolic Sar ... + SetIndexBuffer(psarBufferIndex, psarBuffer); + SetIndexLabel(psarBufferIndex, "P Sar"); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + + // + // Parabolic SAR ... + CalculateParabolicSAR(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + double scFast = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + scFastBuffer[bar_index] = scFast; + + // + double scSlow = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + scSlowBuffer[bar_index] = scSlow; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + double mcFast = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + mcFastBuffer[bar_index] = mcFast; + + // + double mcSlow = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + mcSlowBuffer[bar_index] = mcSlow; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + double lcFast = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + lcFastBuffer[bar_index] = lcFast; + + // + double lcSlow = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = lcSlow; +} + +// +// Calculate Parabolic SAR ... +void CalculateParabolicSAR( + const int &bar_index +) { + // + double pSar = iSAR( + _Symbol, + _Period, + step, + maximum, + bar_index + ); + + // + psarBuffer[bar_index] = pSar; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020425/21-00/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..7c8692f --- /dev/null +++ b/Bkp/Used/14020425/21-00/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,790 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio +// input double maxTPMultiplier = 1000; // Max Allowed TP + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.05; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 408; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// Indicators ... +// +// CCI Inputs ... +input double step = 0.01; // SAR Step +input double maximum = 0.1; // SAR Maximum + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier + +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 800; // Sharp Detect Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + ClearSignalConditions(); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // // + // closeLongTrades = xCloseLongTrades; + // waitForLongSignals = xWaitForLongSignals; + + // // + // closeShortTrades = xCloseShortTrades; + // waitForShortSignals = xWaitForShortSignals; + + // // + // xCloseLongTrades = false; + // xCloseShortTrades = false; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < longCycleSlowMultiplier * marketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + } + } + + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Retrieve XMA States ... + // based on medium cycle slow ... + XState states[]; + ArrayFree(states); + ArrayResize( + states, + marketLength + ); + + // + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + states[index] = GetXState( + i, + marketLength, + // + step, + maximum, + // + shortCycleFastMultiplier, + shortCycleSlowMultiplier, + mediumCycleFastMultiplier, + mediumCycleSlowMultiplier, + longCycleFastMultiplier, + longCycleSlowMultiplier + ); + + // + index++; + } + + // + CheckXLongSignalConditions( + bar_index, + marketLength, + states + ); + + // + CheckXShortSignalConditions( + bar_index, + marketLength, + states + ); + + // + XSignalRequest xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + XSignalRequest xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } else if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.adx.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.adx.mq4 new file mode 100644 index 0000000..3271a4e --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.adx.mq4 @@ -0,0 +1,220 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +input ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; // Averaging Applied Price +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 3 + +// +#property indicator_level1 0.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_level4 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// ADX ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Positive Direction ... +#property indicator_width2 1 +#property indicator_color2 clrLime +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +// Negative Direction ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// Declare Buffers ... +#define adxBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double adxBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexLabel(positiveBufferIndex, "DI+"); + + // + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + SetIndexLabel(negativeBufferIndex, "DI-"); + + // + SetIndexBuffer(adxBufferIndex, adxBuffer); + SetIndexLabel(adxBufferIndex, "ADX"); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..829f32c --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,257 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 2 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 2 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.shpd.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.shpd.mq4 new file mode 100644 index 0000000..7c02a84 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.shpd.mq4 @@ -0,0 +1,402 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XSHPD Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XSHPD Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length ... +input double sharpDetectMultiplier = 70; // Sharp Detect Multiplier + +// +input bool drawLabels = true; // Draw Labels on Founded Sharps + +// +input string sharpBullishLabel = "SH_BULL"; // Sharp Bullish Label +input color sharpBullishColor = clrAqua; // Sharp Bullish color + +// +input string sharpBearishLabel = "SH_BEAR"; // Sharp Bearish Label +input color sharpBearishColor = clrFuchsia; // Sharp Bearish color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +#property indicator_buffers 4 +#property indicator_plots 4 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketLowestLowBufferIndex 1 +#define sharpBullishBufferIndex 2 +#define sharpBearishBufferIndex 3 + +// +double marketHighestHighBuffer[]; +double marketLowestLowBuffer[]; +double sharpBullishBuffer[]; +double sharpBearishBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + enableLogging = true; + + // + logTag = "X_SHPD"; + + // + // Highest High ... + SetIndexLabel(marketHighestHighBufferIndex, ""); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + DRAW_LINE, // DRAW_NONE, + STYLE_DOT, + 1, // 0, + clrAqua // clrNONE + ); + + // + // Lowest Low ... + SetIndexLabel(marketLowestLowBufferIndex, ""); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bullish Buffer ... + SetIndexLabel(sharpBullishBufferIndex, ""); + SetIndexBuffer(sharpBullishBufferIndex, sharpBullishBuffer); + SetIndexStyle( + sharpBullishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bearish Buffer ... + SetIndexLabel(sharpBearishBufferIndex, ""); + SetIndexBuffer(sharpBearishBufferIndex, sharpBearishBuffer); + SetIndexStyle( + sharpBearishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Sharp ... + CalculateSharp(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Sharp ... +void CalculateSharp( + const int &bar_index +) { + // + int index = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + marketHighestHighBuffer[bar_index] = GetMarketHighestHigh( + bar_index, + marketLength + ); + + // + marketLowestLowBuffer[bar_index] = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + double maHHs[]; + ArrayResize( + maHHs, + marketLength + ); + + // + double maLLs[]; + ArrayResize( + maLLs, + marketLength + ); + + // + index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + maLLs[index] = marketLowestLowBuffer[i]; + maHHs[index] = marketHighestHighBuffer[i]; + + // + index++; + } + + // + int maxHighIdx = ArrayMaximum(maHHs); + double maxHigh = maHHs[maxHighIdx]; + + // + int minHighIdx = ArrayMinimum(maHHs); + double minHigh = maHHs[minHighIdx]; + + // + double highDiffRate = (maxHigh - minHigh) / 100; + + // + int maxLowIdx = ArrayMaximum(maLLs); + double maxLow = maLLs[maxLowIdx]; + + // + int minLowIdx = ArrayMinimum(maLLs); + double minLow = maLLs[minLowIdx]; + + // + double lowDiffRate = (maxLow - minLow) / 100; + + // + bool isSharpBullishDetected = + high == maxHigh + && low > minLow + && marketHighestHighBuffer[bar_index] == maxHigh + && maxHigh - minHigh > highDiffRate * sharpDetectMultiplier + ; + sharpBullishBuffer[bar_index] = isSharpBullishDetected ? 1 : 0; + + // + bool isSharpBearishDetected = + low == minLow + && high < maxHigh + && marketLowestLowBuffer[bar_index] == minLow + && maxLow - minLow > lowDiffRate * sharpDetectMultiplier + ; + sharpBearishBuffer[bar_index] = isSharpBearishDetected ? 1 : 0; + + // + if ( + drawLabels + && ( + isSharpBearishDetected + || isSharpBullishDetected + ) + ) { + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + string lbl = StringConcatenate( + logTag, + isSharpBullishDetected ? "Bullish_" : "Bearish_", + bar_index + ); + + // + double price = + isSharpBullishDetected + ? + marketLowestLowBuffer[bar_index] - (10 * _Point) + : + marketHighestHighBuffer[bar_index] + (10 * _Point) + ; + + // + uchar arrowCode = + isSharpBullishDetected + ? + SYMBOL_ARROWUP + : + SYMBOL_ARROWDOWN + ; + + // + ENUM_ARROW_ANCHOR anchor = + isSharpBullishDetected + ? + ANCHOR_BOTTOM + : + ANCHOR_TOP + ; + + // + color clr = + isSharpBullishDetected + ? + sharpBullishColor + : + sharpBearishColor + ; + + // + string lblText = + isSharpBullishDetected + ? + sharpBullishLabel + : + sharpBearishLabel + ; + + // + DrawText( + 0, + lbl, + 0, + time, + price, + lblText, + "Tahoma", + 5, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.trend.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.trend.mq4 new file mode 100644 index 0000000..17873e7 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.trend.mq4 @@ -0,0 +1,250 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +// #property indicator_buffers 3 + +// +// Declare Buffers ... +// +datetime startTime; +double lHigh; +double lLow; + +// +datetime highTimes[]; + +// +datetime lowTimes[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + return; + } + + // + if ( + startTime > 0 + && startBarIndex - bar_index == length + ) { + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + length, + bar_index + ); + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int hhSize = ArraySize(highTimes); + datetime tempTimes[]; + ArrayResize( + tempTimes, + hhSize + ); + ArrayCopy( + tempTimes, + highTimes + ); + ArrayResize( + highTimes, + hhSize + 1 + ); + highTimes[0] = hhTime; + ArrayCopy( + highTimes, + tempTimes, + 1 + ); + + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + length, + bar_index + ); + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int llSize = ArraySize(lowTimes); + ArrayFree(tempTimes); + ArrayResize( + tempTimes, + llSize + ); + ArrayCopy( + tempTimes, + lowTimes + ); + ArrayResize( + lowTimes, + llSize + 1 + ); + lowTimes[0] = llTime; + ArrayCopy( + lowTimes, + tempTimes, + 1 + ); + + // + startTime = 0; + ArrayFree(tempTimes); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xbnd.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xbnd.mq4 new file mode 100644 index 0000000..5cea8fd --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xbnd.mq4 @@ -0,0 +1,425 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XBand Indicator +// --------------------------------------------- +// saherelm implementation of xBand Indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XBND Indicator" +#property strict + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Inputs ... +// +input int marketLength = 5; // Averaging Length +input int ignoreLastCross = 4; // Ignore Last Cross +input int shift = 0; // Averaging Shift +input ENUM_MA_METHOD method = MODE_SMA; // Averaging Mode +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +#property indicator_buffers 4 + +// +// Declare Buffers ... +// +// High ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_DASHDOT + +// +// Open ... +#property indicator_width2 1 +#property indicator_color2 clrGreen +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DASH + +// +// Close ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DASH + +// +// Low ... +#property indicator_width4 1 +#property indicator_color4 clrFuchsia +#property indicator_type4 DRAW_LINE +#property indicator_style4 STYLE_DASHDOT + +// +#define highBufferIndex 0 +#define openBufferIndex 1 +#define closeBufferIndex 2 +#define lowBufferIndex 3 + +// +double highBuffer[]; +double openBuffer[]; +double closeBuffer[]; +double lowBuffer[]; + +// +datetime lastCrossTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + marketLength < 2 + || ignoreLastCross < 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XBND"; + + // + // High ... + string highLabel = StringConcatenate( + "High(", marketLength, ")" + ); + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, highLabel); + + // + // Open ... + string openLabel = StringConcatenate( + "Open(", marketLength, ")" + ); + SetIndexBuffer(openBufferIndex, openBuffer); + SetIndexLabel(openBufferIndex, openLabel); + + // + // Close ... + string closeLabel = StringConcatenate( + "Close(", marketLength, ")" + ); + SetIndexBuffer(closeBufferIndex, closeBuffer); + SetIndexLabel(closeBufferIndex, closeLabel); + + // + // Low ... + string lowLabel = StringConcatenate( + "Low(", marketLength, ")" + ); + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, lowLabel); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + + // + // Calculate Market Changes ... + CalculateInfo(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // High ... + double high = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_HIGH, + bar_index + ); + + // + highBuffer[bar_index] = high; + + // + // Open ... + double open = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_OPEN, + bar_index + ); + + // + openBuffer[bar_index] = open; + + // + // Close ... + double close = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_CLOSE, + bar_index + ); + + // + closeBuffer[bar_index] = close; + + // + // Low ... + double low = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_LOW, + bar_index + ); + + // + lowBuffer[bar_index] = low; +} + +// +void CalculateInfo( + const int bar_index +) { + // + XOHCL pCandle = GetCandleModel(bar_index); + + // + bool isTrendingUp = + pCandle.low > highBuffer[bar_index] + && pCandle.high > highBuffer[bar_index]; + + // + bool isTrendingDown = + pCandle.high < lowBuffer[bar_index] + && pCandle.low < lowBuffer[bar_index]; + + // + bool isOpenCrossOverClose = + true + // && + // ( + // pCandle.high > highBuffer[bar_index + 1] + // || pCandle.low < lowBuffer[bar_index + 1] + // ) + && openBuffer[bar_index + 1] > closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] >= closeBuffer[bar_index + 2]) + ; + + // + bool isOpenCrossUnderClose = + true + // && + // ( + // pCandle.high > highBuffer[bar_index + 1] + // || pCandle.low < lowBuffer[bar_index + 1] + // ) + && openBuffer[bar_index + 1] < closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] <= closeBuffer[bar_index + 2]) + ; + + // + isTrendingUp = isOpenCrossUnderClose; + isTrendingDown = isOpenCrossOverClose; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + if (lastCrossTime == 0) { + lastCrossTime = time; + } else { + // + int lastCrossBarIndex = iBarShift( + _Symbol, + _Period, + lastCrossTime + ); + + // + int diff = lastCrossBarIndex - bar_index; + if (diff <= ignoreLastCross) { + return; + } else { + lastCrossTime = time; + } + } + } + + // + string lbl = StringConcatenate( + logTag, + "_Arrow_", + isTrendingUp ? "UP" : "Down", + "_", time + ); + + // + color clr = isTrendingUp ? + clrAqua : + clrFuchsia; + + // + ENUM_ARROW_ANCHOR anchor = isTrendingUp ? + ANCHOR_BOTTOM : + ANCHOR_TOP; + + // + uchar arrowCode = isTrendingUp ? + SYMBOL_ARROWUP : + SYMBOL_ARROWDOWN; + + // + double price = isTrendingUp ? + pCandle.low - 20 * _Point : + pCandle.high + 20 * _Point; + + // + if (isTrendingUp) { + // + // this means Market Going Up ... + + } + + // + if (isTrendingDown) { + // + // this means Market Going Downm ... + } + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + bool isDrawn = DrawArrow( + 0, + lbl, + 0, + time, + price, + arrowCode, + anchor, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xhh.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xhh.mq4 new file mode 100644 index 0000000..dfbc2cd --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xhh.mq4 @@ -0,0 +1,410 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XHH Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XHH Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 4; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 14; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 27; // Market Medium Cycle Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Highest High Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Lowest Low Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Highest High Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Lowest Low Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define shortCycleHighestHighBufferIndex 0 +#define shortCycleLowestLowBufferIndex 1 +#define mediumCycleHighestHighBufferIndex 2 +#define mediumCycleLowestLowBufferIndex 3 +#define longCycleHighestHighBufferIndex 4 +#define longCycleLowestLowBufferIndex 5 + +double shortCycleHighestHighBuffer[]; +double shortCycleLowestLowBuffer[]; +double mediumCycleHighestHighBuffer[]; +double mediumCycleLowestLowBuffer[]; +double longCycleHighestHighBuffer[]; +double longCycleLowestLowBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; + +// +double highestHighTimes[]; +double lowestLowTimes[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Short Cycle Highest High ... + string scHHLbl = StringConcatenate( + "SC HH(", shortCycleLength, ")" + ); + SetIndexBuffer(shortCycleHighestHighBufferIndex, shortCycleHighestHighBuffer); + SetIndexLabel(shortCycleHighestHighBufferIndex, scHHLbl); + + // + // Short Cycle Lowest Low ... + string scLLLbl = StringConcatenate( + "SC LL(", shortCycleLength, ")" + ); + SetIndexBuffer(shortCycleLowestLowBufferIndex, shortCycleLowestLowBuffer); + SetIndexLabel(shortCycleLowestLowBufferIndex, scLLLbl); + + // + // Medium Cycle Highest High ... + string mcHHLbl = StringConcatenate( + "MC HH(", mediumCycleLength, ")" + ); + SetIndexBuffer(mediumCycleHighestHighBufferIndex, mediumCycleHighestHighBuffer); + SetIndexLabel(mediumCycleHighestHighBufferIndex, mcHHLbl); + + // + // Medium Cycle Lowest Low ... + string mcLLLbl = StringConcatenate( + "MC LL(", mediumCycleLength, ")" + ); + SetIndexBuffer(mediumCycleLowestLowBufferIndex, mediumCycleLowestLowBuffer); + SetIndexLabel(mediumCycleLowestLowBufferIndex, mcLLLbl); + + // + // Long Cycle Highest High ... + string lcHHLbl = StringConcatenate( + "LC HH(", longCycleLength, ")" + ); + SetIndexBuffer(longCycleHighestHighBufferIndex, longCycleHighestHighBuffer); + SetIndexLabel(longCycleHighestHighBufferIndex, lcHHLbl); + + // + // Long Cycle Lowest Low ... + string lcLLLbl = StringConcatenate( + "LC LL(", longCycleLength, ")" + ); + SetIndexBuffer(longCycleLowestLowBufferIndex, longCycleLowestLowBuffer); + SetIndexLabel(longCycleLowestLowBufferIndex, lcLLLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + // Short Cycle Highest High ... + // + int scHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + shortCycleLength, + bar_index + ); + + // + double scHH = iHigh( + _Symbol, + _Period, + scHHIdx + ); + + // + shortCycleHighestHighBuffer[bar_index] = scHH; + + // + // Short Cycle Lowest Low ... + // + int scLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + shortCycleLength, + bar_index + ); + + // + double scLL = iLow( + _Symbol, + _Period, + scLLIdx + ); + + // + shortCycleLowestLowBuffer[bar_index] = scLL; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + // Medium Cycle Highest High ... + // + int mcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + mediumCycleLength, + bar_index + ); + + // + double mcHH = iHigh( + _Symbol, + _Period, + mcHHIdx + ); + + // + mediumCycleHighestHighBuffer[bar_index] = mcHH; + + // + // Medium Cycle Lowest Low ... + // + int mcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + mediumCycleLength, + bar_index + ); + + // + double mcLL = iLow( + _Symbol, + _Period, + mcLLIdx + ); + + // + mediumCycleLowestLowBuffer[bar_index] = mcLL; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + // Long Cycle Highest High ... + // + int lcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + longCycleLength, + bar_index + ); + + // + double lcHH = iHigh( + _Symbol, + _Period, + lcHHIdx + ); + + // + longCycleHighestHighBuffer[bar_index] = lcHH; + + // + // Long Cycle Lowest Low ... + // + int lcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + longCycleLength, + bar_index + ); + + // + double lcLL = iLow( + _Symbol, + _Period, + lcLLIdx + ); + + // + longCycleLowestLowBuffer[bar_index] = lcLL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..4a599f9 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,695 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +// +// Cycle Definitions ... +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showPSar = true; // Show Parabolic Sar +input bool showMarketMiddle = true; // Show Market Middle +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 +#define pSarBufferIndex 7 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; +double pSarBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + SetIndexLabel(midBufferIndex, "Market Mid"); + + // + // Parabolic Sar ... + SetIndexBuffer(pSarBufferIndex, pSarBuffer); + SetIndexLabel(pSarBufferIndex, "P Sar"); + SetIndexStyle( + pSarBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showPSar ? + pSarColor : + clrNONE + ); + + // + // Market Middle ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexLabel(midBufferIndex, "Mid"); + SetIndexStyle( + midBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMarketMiddle ? + clrAntiqueWhite : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + + // + // Calculate Parabolic Sar ... + CalculateParabolicSar(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} + +void CalculateParabolicSar( + const int bar_index +) { + // + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + pSarBuffer[bar_index] = sarValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmarket.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmarket.mq4 new file mode 100644 index 0000000..71b2e2c --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmarket.mq4 @@ -0,0 +1,394 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMKT Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +// +input bool showHighestHigh = true; // Show Market Highest High +input bool showHighestLow = true; // Show Market Highest Low +input bool showHighestOpen = true; // Show Market Highest Open +input bool showHighestClose = true; // Show Market Highest Close +input bool showLowestHigh = true; // Show Market Lowest High +input bool showLowestLow = true; // Show Market Lowest Low +input bool showLowestOpen = true; // Show Market Lowest Open +input bool showLowestClose = true; // Show Market Lowest Close +// +input color highestHighColor = clrDeepPink; // Market Highest High Color +input color highestLowColor = clrDarkOrange; // Market Highest Low Color +input color highestOpenColor = clrDodgerBlue; // Market Highest Open Color +input color highestCloseColor = clrOrchid; // Market Highest Close Color +input color lowestHighColor = clrHotPink; // Market Lowest High Color +input color lowestLowColor = clrOrange; // Market Lowest Low Color +input color lowestOpenColor = clrPowderBlue; // Market Lowest Open Color +input color lowestCloseColor = clrMediumOrchid; // Market Lowest Close Color +// +input ENUM_LINE_STYLE highestHighStyle = STYLE_DOT; // Market Highest High Line Style +input ENUM_LINE_STYLE highestLowStyle = STYLE_DOT; // Market Highest Low Line Style +input ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT; // Market Highest Open Line Style +input ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT; // Market Highest Close Line Style +input ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT; // Market Lowest High Line Style +input ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT; // Market Lowest Low Line Style +input ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT; // Market Lowest Open Line Style +input ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT; // Market Lowest Close Line Style +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketHighestLowBufferIndex 1 +#define marketHighestOpenBufferIndex 2 +#define marketHighestCloseBufferIndex 3 +#define marketLowestHighBufferIndex 4 +#define marketLowestLowBufferIndex 5 +#define marketLowestOpenBufferIndex 6 +#define marketLowestCloseBufferIndex 7 + +// +double marketHighestHighBuffer[]; +double marketHighestLowBuffer[]; +double marketHighestOpenBuffer[]; +double marketHighestCloseBuffer[]; +double marketLowestHighBuffer[]; +double marketLowestLowBuffer[]; +double marketLowestOpenBuffer[]; +double marketLowestCloseBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMKT"; + + // + // Highest High ... + string highestHighLbl = StringConcatenate("HH(", marketLength,")"); + SetIndexLabel(marketHighestHighBufferIndex, highestHighLbl); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + showHighestHigh ? + DRAW_LINE : + DRAW_NONE, + highestHighStyle, + 1, + showHighestHigh ? + highestHighColor : + clrNONE + ); + + // + // Highest Low ... + string highestLowLbl = StringConcatenate("HL(", marketLength,")"); + SetIndexLabel(marketHighestLowBufferIndex, highestLowLbl); + SetIndexBuffer(marketHighestLowBufferIndex, marketHighestLowBuffer); + SetIndexStyle( + marketHighestLowBufferIndex, + showHighestLow ? + DRAW_LINE : + DRAW_NONE, + highestLowStyle, + 1, + showHighestLow ? + highestLowColor : + clrNONE + ); + + // + // Highest Open ... + string highestOpenLbl = StringConcatenate("HO(", marketLength,")"); + SetIndexLabel(marketHighestOpenBufferIndex, highestOpenLbl); + SetIndexBuffer(marketHighestOpenBufferIndex, marketHighestOpenBuffer); + SetIndexStyle( + marketHighestOpenBufferIndex, + showHighestOpen ? + DRAW_LINE : + DRAW_NONE, + highestOpenStyle, + 1, + showHighestOpen ? + highestOpenColor : + clrNONE + ); + + // + // Highest Close ... + string highestCloseLbl = StringConcatenate("HC(", marketLength,")"); + SetIndexLabel(marketHighestCloseBufferIndex, highestCloseLbl); + SetIndexBuffer(marketHighestCloseBufferIndex, marketHighestCloseBuffer); + SetIndexStyle( + marketHighestCloseBufferIndex, + showHighestClose ? + DRAW_LINE : + DRAW_NONE, + highestCloseStyle, + 1, + showHighestClose ? + highestCloseColor : + clrNONE + ); + + // + // Lowest High ... + string lowestHighLbl = StringConcatenate("LH(", marketLength,")"); + SetIndexLabel(marketLowestHighBufferIndex, lowestHighLbl); + SetIndexBuffer(marketLowestHighBufferIndex, marketLowestHighBuffer); + SetIndexStyle( + marketLowestHighBufferIndex, + showLowestHigh ? + DRAW_LINE : + DRAW_NONE, + lowestHighStyle, + 1, + showLowestHigh ? + lowestHighColor : + clrNONE + ); + + // + // Lowest Low ... + string lowestLowLbl = StringConcatenate("LL(", marketLength,")"); + SetIndexLabel(marketLowestLowBufferIndex, lowestLowLbl); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + showLowestLow ? + DRAW_LINE : + DRAW_NONE, + lowestLowStyle, + 1, + showLowestLow ? + lowestLowColor : + clrNONE + ); + + // + // Lowest Open ... + string lowestOpenLbl = StringConcatenate("LO(", marketLength,")"); + SetIndexLabel(marketLowestOpenBufferIndex, lowestOpenLbl); + SetIndexBuffer(marketLowestOpenBufferIndex, marketLowestOpenBuffer); + SetIndexStyle( + marketLowestOpenBufferIndex, + showLowestOpen ? + DRAW_LINE : + DRAW_NONE, + lowestOpenStyle, + 1, + showLowestOpen ? + lowestOpenColor : + clrNONE + ); + + // + // Lowest Close ... + string lowestCloseLbl = StringConcatenate("LC(", marketLength,")"); + SetIndexLabel(marketLowestCloseBufferIndex, lowestCloseLbl); + SetIndexBuffer(marketLowestCloseBufferIndex, marketLowestCloseBuffer); + SetIndexStyle( + marketLowestCloseBufferIndex, + showLowestClose ? + DRAW_LINE : + DRAW_NONE, + lowestCloseStyle, + 1, + showLowestClose ? + lowestCloseColor : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index +) { + // + // Highest High ... + double highestHighValue = GetMarketHighestHigh( + bar_index, + marketLength + ); + marketHighestHighBuffer[bar_index] = highestHighValue; + + // + // Highest Low ... + double highestLowValue = GetMarketHighestLow( + bar_index, + marketLength + ); + marketHighestLowBuffer[bar_index] = highestLowValue; + + // + // Highest Open ... + double highestOpenValue = GetMarketHighestOpen( + bar_index, + marketLength + ); + marketHighestOpenBuffer[bar_index] = highestOpenValue; + + // + // Highest Close ... + double highestCloseValue = GetMarketHighestClose( + bar_index, + marketLength + ); + marketHighestCloseBuffer[bar_index] = highestCloseValue; + + // + // Lowest High ... + double lowestHighValue = GetMarketLowestHigh( + bar_index, + marketLength + ); + marketLowestHighBuffer[bar_index] = lowestHighValue; + + // + // Lowest Low ... + double lowestLowValue = GetMarketLowestLow( + bar_index, + marketLength + ); + marketLowestLowBuffer[bar_index] = lowestLowValue; + + // + // Lowest Open ... + double lowestOpenValue = GetMarketLowestOpen( + bar_index, + marketLength + ); + marketLowestOpenBuffer[bar_index] = lowestOpenValue; + + // + // Lowest Close ... + double lowestCloseValue = GetMarketLowestClose( + bar_index, + marketLength + ); + marketLowestCloseBuffer[bar_index] = lowestCloseValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmtrend.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmtrend.mq4 new file mode 100644 index 0000000..aa89e7b --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.xmtrend.mq4 @@ -0,0 +1,221 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMTR Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 20; // Market Length +input int atrMultiplier = 1; // ATR Multiplier +input int atrLength = 5; // ATR Period +input ENUM_APPLIED_PRICE source = PRICE_CLOSE; // Source +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 3 +#property indicator_plots 3 + +// +// Declare Buffers ... +#define trendBufferIndex 0 +#define upTrendBufferIndex 1 +#define downTrendBufferIndex 2 + +// +double trendBuffer[]; +double upTrendBuffer[]; +double downTrendBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XMTR"; + + // + // TREND ... + SetIndexLabel(trendBufferIndex, "Trend"); + SetIndexBuffer(trendBufferIndex, trendBuffer); + SetIndexStyle( + trendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // UP Trend ... + SetIndexLabel(upTrendBufferIndex, "Up Trend"); + SetIndexBuffer(upTrendBufferIndex, upTrendBuffer); + SetIndexStyle( + upTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // DOWN Trend ... + SetIndexLabel(downTrendBufferIndex, "Down Trend"); + SetIndexBuffer(downTrendBufferIndex, downTrendBuffer); + SetIndexStyle( + downTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers( + i, + low + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index, + const double &low[] +) { + // + double atr = GetMarketTRSMA( + bar_index, + atrLength + ); + + // + double smoothedAtr = (atr * atrMultiplier); + double upTrend = low[bar_index] - smoothedAtr; + double downTrend = low[bar_index] + smoothedAtr; + + // + double cciValue = GetMarketCCI( + bar_index, + marketLength, + source + ); + + // + // TODO: Complete this ... +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/14020425/21-00/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.cci.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.cci.signal.lib.mq4 new file mode 100644 index 0000000..c572f3d --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.cci.signal.lib.mq4 @@ -0,0 +1,472 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 CCI Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Based Signal Conditions ... +struct XCCILongSignalConditions { + // + datetime start; + + // + datetime crossOverMinusHundredTime; + datetime crossUnderMinusHundredTime; + + // + double crossOverSlope; +}; + +// +static XCCILongSignalConditions cciLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Signal Conditions ... +void CheckCCILongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 10 +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // LONG: + // wait for cci cross under -100 + // then wait for cross over -100 + // slope of crossing over ??? ... + if (cciLongConds.start == 0) { + // LogMessage("Start"); + cciLongConds.start = barTime; + return; + } + + // + // Check Start Time ... + if (cciLongConds.start == 0) { + return; + } + + // + // Read current, prev, and prevPrev CCI ... + double cci = GetMarketCCI( + bar_index, + marketLen + ); + double cci1 = GetMarketCCI( + bar_index + 1, + marketLen + ); + double cci2 = GetMarketCCI( + bar_index + 2, + marketLen + ); + + // + // Find Cross Under -100 ... + bool isCrossUnderMinusHundred = + cci < -105 && !(cci1 < -105) + && MathAbs(MathAbs(cci) - MathAbs(cci1)) > smoother + ; + + // + // Find Cross Over -100 ... + bool isCrossOverMinusHundred = + cci > -105 && !(cci1 > -105) + && MathAbs(cci - cci1) > smoother + ; + + // + // Fill Conditions ... + if ( + isCrossUnderMinusHundred + && cciLongConds.crossUnderMinusHundredTime == 0 + && cciLongConds.crossOverMinusHundredTime == 0 + ) { + // LogMessage("Cross Under ..."); + cciLongConds.crossUnderMinusHundredTime = barTime; + return; + } + + // + // Fill Conditions ... + if ( + isCrossOverMinusHundred + && cciLongConds.crossOverMinusHundredTime == 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + ) { + // + // LogMessage("Cross Over ..."); + cciLongConds.crossOverMinusHundredTime = barTime; + } + + // + // Prevent Going forward untill Cross Under Happens ... + if (cciLongConds.crossUnderMinusHundredTime == 0) { + return; + } + + // + // Prevent from Going forward untill Cross Over Happens ... + if (cciLongConds.crossOverMinusHundredTime == 0) { + return; + } + + // + // Calculate Slope ... + double x1 = 0; + double y1 = cci1; + double x2 = 1; + double y2 = cci; + + // + // Calculat Line Slope ... + double tSlope = GetSlope( + x1, y1, x2, y2 + ); + + // + cciLongConds.crossOverSlope = tSlope; + // LogMessage("Slope: " + tSlope); +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateCCILongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateCCILongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + int llIdx = GetLowestLowOFCCILongPeriodIndex(); + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + // GetLowestLowOFCCILongPeriod(); + + // + int hhIdx = GetHighestHighOfCCILongPeriodIndex(); + double hh = GetHighestHighOfCCILongPeriod(); + // GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_CCI_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_CCI_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateCCILongConditions() { + // + int crossUnderBarIndex = + cciLongConds.crossUnderMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ) + : -1 + ; + + // + int crossOverBarIndex = + cciLongConds.crossOverMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ) + : -1 + ; + + // + bool isConditionsFilled = + // + cciLongConds.start != 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + && cciLongConds.crossOverMinusHundredTime != 0 + && cciLongConds.crossUnderMinusHundredTime >= cciLongConds.start + && cciLongConds.crossOverMinusHundredTime > cciLongConds.crossUnderMinusHundredTime + ; + + // + bool isLogicPassed = + // + crossOverBarIndex > 0 + && crossUnderBarIndex > 0 + && crossUnderBarIndex > crossOverBarIndex + && (crossUnderBarIndex - crossOverBarIndex) >= 5 + ; + + // + bool result = + // + isConditionsFilled + && isLogicPassed + && cciLongConds.crossOverSlope > 0 + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearCCILongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearCCILongSignalConditions() { + // + cciLongConds.start = 0; + cciLongConds.crossOverSlope = 0; + cciLongConds.crossOverMinusHundredTime = 0; + cciLongConds.crossUnderMinusHundredTime = 0; +} + +// +int GetHighestHighOfCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iHighest( + _Symbol, + _Period, + MODE_HIGH, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetHighestHighOfCCILongPeriod() { + // + int index = GetHighestHighOfCCILongPeriodIndex(); + + // + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +int GetLowestLowOFCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iLowest( + _Symbol, + _Period, + MODE_LOW, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetLowestLowOFCCILongPeriod() { + // + int index = GetLowestLowOFCCILongPeriodIndex(); + + // + double result = iLow( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForCCILongSignals( + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + result = + // + true + // + // && states[1].mc.fast > states[1].mc.slow + // && MathAbs(states[1].mc.fast - states[1].mc.slow) > 100 * _Point + // && states[1].marketMiddleage > states[1].sc.fast + // && states[1].marketMiddleage > states[1].mc.fast + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..28beaf9 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,948 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +static double zigZags[]; +// +// END Global Requirement Functions ... +// + +// +// START Indicator Reading Data ... +// +// +// START XMKT Data ... +// +XMKTState GetXMKT( + const int bar_index, + const int marketLen, + // + const bool showHighestHigh = true, + const bool showHighestLow = true, + const bool showHighestOpen = true, + const bool showHighestClose = true, + const bool showLowestHigh = true, + const bool showLowestLow = true, + const bool showLowestOpen = true, + const bool showLowestClose = true, + const color highestHighColor = clrDeepPink, + const color highestLowColor = clrDarkOrange, + const color highestOpenColor = clrDodgerBlue, + const color highestCloseColor = clrOrchid, + const color lowestHighColor = clrHotPink, + const color lowestLowColor = clrOrange, + const color lowestOpenColor = clrPowderBlue, + const color lowestCloseColor = clrMediumOrchid, + const ENUM_LINE_STYLE highestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT +) { + // + XMKTState result = {}; + + // + string xmktIndName = "x-saherelm.xmarket"; + + // + int highestHighBufferIndex = 0; + int highestLowBufferIndex = 1; + int highestOpenBufferIndex = 2; + int highestCloseBufferIndex = 3; + int lowestHighBufferIndex = 4; + int lowestLowBufferIndex = 5; + int lowestOpenBufferIndex = 6; + int lowestCloseBufferIndex = 7; + + // + // Highest High ... + double highestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.highestHigh = highestHigh; + + // + // Highest Low ... + double highestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.highestLow = highestLow; + + // + // Highest Open ... + double highestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.highestOpen = highestOpen; + + // + // Highest Close ... + double highestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.highestClose = highestClose; + + // + // Lowest High ... + double lowestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestHigh = lowestHigh; + + // + // Lowest Low ... + double lowestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestLow = lowestLow; + + // + // Lowest Open ... + double lowestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestOpen = lowestOpen; + + // + // Lowest Close ... + double lowestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestClose = lowestClose; + + // + return result; +} +// +// END XMKT Data ... +// + +// +// START XOSC Data ... +// +XCycleState GetXOSC( + const int bar_index, + const int marketLen, + // + const int fastMult, + const int slowMult, + // + const double fastMMul = 1.0, + const double slowMMul = 3.0 +) { + // + XCycleState result = {}; + + // + string oscIndName = "x-saherelm.osc"; + + // + // Prepare OSC Inputs ... + // + int fastLength = fastMult * marketLen; + int slowLength = slowMult * marketLen; + + // + // Fast ... + double fast = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 0, // Buffer Index ... + bar_index + ); + result.fast = fast; + + // + // Slow ... + double slow = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 1, // Buffer Index ... + bar_index + ); + result.slow = slow; + + // + return result; +} +// +// END XOSC Data ... +// + +// +// START XBND Data ... +// +XBndState GetXBND( + const int bar_index, + // + const int marketLen = 10, // Market Length ... + const int shift = 0, // MA Shift ... + const ENUM_MA_METHOD method = MODE_SMA // MA Method ... +) { + // + XBndState result = {}; + + // + double high = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_HIGH + ); + result.high = high; + + // + double open = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_OPEN + ); + result.open = open; + + // + double close = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_CLOSE + ); + result.close = close; + + // + double low = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_LOW + ); + result.low = low; + + // + return result; +} +// +// END XBND Data ... +// + +// +// START ZigZag Data ... +// +void PrepareZigZagState( + const int bar_index, + // + const int depth = 12, + const int deviation = 5, + const int backStep = 3 +) { + // + string zigzagIndName = "x-saherelm.zigzag"; + + // + ArrayFree(zigZags); + ArrayResize( + zigZags, + 3 + ); + + // + double zigZag = 0; + int index = 0; + int i = bar_index; + while (index < 3) { + // + zigZag = iCustom( + _Symbol, + _Period, + zigzagIndName, + // + // Inputs ... + depth, + deviation, + backStep, + // + 0, // Buffer Index ... + i + ); + + // + if (zigZag > 0) { + // + zigZags[index] = zigZag; + index++; + } + + // + i++; + } +} +// +// END ZigZag Data ... +// + +// +// START XMA Data ... +// +// +// Retrieve Short Cycle ... +XCycleState GetXMASC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Medium Cycle ... +XCycleState GetXMAMC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMALC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMANN( + const int bar_index, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = 10; + int slowLength = 50; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Middle ... +double GetXMAMM( + const int bar_index, + const int marketLen, + const double multiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_EMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_MEDIAN +) { + // + double result = 0; + + // + int length = (int)(marketLen * multiplier); + + // + double middle = iMA( + _Symbol, + _Period, + length, + shift, + method, + appliedPrice, + bar_index + ); + result = middle; + + // + return result; +} + +// +// Retrieve XMA Parabolic SAR ... +double GetXMAPSAR( + const int bar_index, + // + double stp = 0.02, + double mxm = 0.2 +) { + // + double result = 0; + + // + double pSar = iSAR( + _Symbol, + _Period, + stp, + mxm, + bar_index + ); + result = pSar; + + // + return result; +} + +// +XState GetXState( + const int bar_index, + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleFastMult, + const int shortCycleSlowMult, + const int mediumCycleFastMult, + const int mediumCycleSlowMult, + const int longCycleFastMult, + const int longCycleSlowMult +) { + // + XState result = {}; + + // + // Short Cycle ... + XCycleState sc = GetXMASC( + bar_index, + marketLen, + shortCycleFastMult, + shortCycleSlowMult + ); + result.sc = sc; + + // + // Medium Cycle ... + XCycleState mc = GetXMAMC( + bar_index, + marketLen, + mediumCycleFastMult, + mediumCycleSlowMult + ); + result.mc = mc; + + // + // Long Cycle ... + XCycleState lc = GetXMALC( + bar_index, + marketLen, + longCycleFastMult, + longCycleSlowMult + ); + result.lc = lc; + + // + // OSC ... + XCycleState osc = GetXOSC( + // + bar_index, + marketLen, + // + shortCycleFastMult, + shortCycleSlowMult + ); + result.osc = osc; + + // + // Market Middleage ... + double marketMiddleage = GetXMAMM( + bar_index, + marketLen, + 1.5 + ); + result.marketMiddleage = marketMiddleage; + + // + // Parabolic SAR ... + double parabolicSAR = GetXMAPSAR( + bar_index, + stp, + mxm + ); + result.parabolicSAR = parabolicSAR; + + // // + // int cciMarketLength = longCycleSlowMult * marketLen; + // double cci = GetMarketCCI( + // bar_index, + // cciMarketLength + // ); + // result.cci = cci; + + // + XBndState bnd = GetXBND( + bar_index + ); + result.bnd = bnd; + + // + XMKTState mkt = GetXMKT( + bar_index, + marketLen + ); + result.mkt = mkt; + + // + double longCycleHighestHigh = GetMarketHighestHigh( + bar_index, + longCycleFastMult * marketLen + ); + result.longCycleHighestHigh = longCycleHighestHigh; + + // + return result; +} +// +// END XMA Data ... +// +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..658c90a --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1502 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +static datetime lastBarTime; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..58e1e25 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,225 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_OSC_PROVIDER, + X_CCI_PROVIDER, + X_SHP_PROVIDER, + X_XMA_PROVIDER, + X_RMA_PROVIDER, + X_XXX_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XBndState { + double high; + double open; + double close; + double low; +}; + +// +struct XMKTState { + // + double highestHigh; + double highestLow; + double highestOpen; + double highestClose; + + // + double lowestHigh; + double lowestLow; + double lowestOpen; + double lowestClose; +}; + +// +struct XCycleState { + double fast; + double slow; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XState { + // + // SC ... + XCycleState sc; + + // + // MC ... + XCycleState mc; + + // + // LC ... + XCycleState lc; + + // + // OSC ... + XCycleState osc; + + // + // MIDDLEAGE ... + double marketMiddleage; + + // + // PARABOLIC-SAR ... + double parabolicSAR; + + // + double cci; + + // + XBndState bnd; + + // + XMKTState mkt; + + // + double longCycleHighestHigh; +}; + +// +// Parsed XMA Buffer ... +struct XStateInfo { + // + // Check Market Cross Exists or not ... + // + bool isSCFastCrossOverSlow; + bool isSCFastCrossUnderSlow; + + // + double scMin; + double scMax; + + // + bool isMCFastCrossOverSlow; + bool isMCFastCrossUnderSlow; + + // + double mcMin; + double mcMax; + + bool isLCFastCrossOverSlow; + bool isLCFastCrossUnderSlow; + + // + double lcMin; + double lcMax; + + // + bool isMMCrossOverSCFast; + bool isMMCrossUnderSCFast; + + // + bool isMMCrossOverMCFast; + bool isMMCrossUnderMCFast; + + // + double mmMin; + double mmMax; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..84f0386 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 OSC Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XOSCLongSignalConditions { + // + datetime crossOverTime; + double slowOnCrossOver; + + // + datetime crossUnderTime; + double slowOnCrossUnder; +}; + +// +static XOSCLongSignalConditions oscLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckOSCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[0].osc.fast < 0 + && !(states[1].osc.fast < 0) + ; + + // + bool isCrossOver = + states[0].osc.fast > 0 + && !(states[1].osc.fast > 0) + ; + + // + int oneTouches = 0; + int halfTouches = 0; + int minusOneTouches = 0; + for (int i = 0; i < marketLen - 1; i++) { + // + // One Touches ... + if ( + states[i].osc.fast > 1 + && !(states[i + 1].osc.fast > 1) + ) { + oneTouches++; + } + + // + // Half Touches ... + if ( + states[i].osc.fast > 0.5 + && !(states[i + 1].osc.fast > 0.5) + ) { + halfTouches++; + } + + // + // Minus One Touches ... + if ( + states[i].osc.fast < -1 + && !(states[i + 1].osc.fast < -1) + ) { + minusOneTouches++; + } + } + + // + if ( + isCrossUnder + && oscLongConds.crossUnderTime == 0 + ) { + // + oscLongConds.crossUnderTime = barTime; + oscLongConds.slowOnCrossUnder = states[0].osc.slow; + return; + } + + // + if ( + isCrossOver + && oscLongConds.crossUnderTime > 0 + && oscLongConds.crossOverTime == 0 + ) { + // + oscLongConds.crossOverTime = barTime; + oscLongConds.slowOnCrossOver = states[0].osc.slow; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateOSCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateOSCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_OSC_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_OSC_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateOSCLongConditions() { + // + bool isConditionsFilled = + oscLongConds.crossOverTime > 0 + && oscLongConds.crossUnderTime > 0 + && oscLongConds.slowOnCrossOver > 0 + && oscLongConds.slowOnCrossUnder > 0 + && oscLongConds.crossOverTime > oscLongConds.crossUnderTime + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossUnderTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossOverTime + ); + + // + isBLFilled = + crossUnderBarIndex > crossOverBarIndex + // && oscLongConds.slowOnCrossOver > oscLongConds.slowOnCrossUnder + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearOSCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearOSCLongSignalConditions() { + // + oscLongConds.crossOverTime = 0;; + oscLongConds.crossUnderTime = 0;; +} + +// +// Check State for Long Signals ... +bool IsReadyForOSCLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.rma.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.rma.signal.lib.mq4 new file mode 100644 index 0000000..4b9637a --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.rma.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 RMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// RMA Based Signal Conditions ... +struct XRMALongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XRMALongSignalConditions xrmaLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXRMALongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XCycleState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XCycleState state = GetXMANN(i); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].fast < states[1].slow + && !(states[2].fast < states[2].slow) + ; + + // + bool isCrossOver = + states[1].fast > states[1].slow + && !(states[2].fast > states[2].slow) + ; + + // + if ( + isCrossUnder + && xrmaLongConds.crossUnderTime == 0 + ) { + // + xrmaLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xrmaLongConds.crossUnderTime > 0 + && xrmaLongConds.crossOverTime == 0 + ) { + // + xrmaLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRMALongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXRMALongConditions(marketLen)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_RMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_RMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXRMALongConditions( + const int marketLen +) { + // + bool isConditionsFilled = + true + && xrmaLongConds.crossOverTime > 0 + && xrmaLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossUnderTime + ); + + // + XCycleState stateOnCrossUnder = GetXMANN( + crossUnderBarIndex + ); + + // + XCycleState stateOnCrossOver = GetXMANN( + crossOverBarIndex + ); + + // + double maC = iMA( + _Symbol, + _Period, + 14, + 0, + MODE_SMA, + PRICE_CLOSE, + crossOverBarIndex + ); + + // // + // double rmaOnCrossOver = GetRMA( + // crossOverBarIndex, + // 10 + // ); + + // // + // double rmaOnMarketLength = GetRMA( + // crossOverBarIndex + marketLen, + // 10 + // ); + + // // + // double prevCandleHigh = iHigh( + // _Symbol, + // _Period, + // crossOverBarIndex + // ); + + // // + // PrepareZigZagState(crossOverBarIndex); + // double zigZagDelta = zigZags[1] - zigZags[2]; + // bool isZigZagWaitForHigh = zigZagDelta < 0; + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xrmaLongConds.crossOverTime > xrmaLongConds.crossUnderTime + // + && stateOnCrossOver.slow < stateOnCrossUnder.slow + // + && MathAbs(stateOnCrossOver.fast - stateOnCrossOver.slow) > (70 * _Point) + // + && maC >= stateOnCrossOver.slow + // // + // && !(rmaOnCrossOver < stateOnCrossOver.slow) + // // + // && MathAbs(rmaOnCrossOver - rmaOnMarketLength) < (600 * _Point) + // // + // && !isZigZagWaitForHigh + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRMALongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRMALongSignalConditions() { + // + xrmaLongConds.crossOverTime = 0; + xrmaLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXRMALongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.shp.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.shp.signal.lib.mq4 new file mode 100644 index 0000000..dd0f767 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.shp.signal.lib.mq4 @@ -0,0 +1,391 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 SHP Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XSHPLongSignalConditions { + // + datetime start; + datetime stop; +}; + +// +static XSHPLongSignalConditions shpLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckSHPLongSignalConditions( + const int bar_index, + const int marketLen, + const double shpDetectMult, + const double smoother = 30 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double mHH = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double mLL = GetMarketLowestLow( + bar_index, + marketLen + ); + + double m2LL = GetMarketLowestLow( + bar_index, + marketLen * 2 + ); + + // + int mHLIdx = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + datetime mHLTime = iTime( + _Symbol, + _Period, + mHLIdx + ); + double mHL = iHigh( + _Symbol, + _Period, + mHLIdx + ); + + // + double hlDiff = (mHL - mLL); + double sharpDetectValue = shpDetectMult * _Point; + + // + bool isSharpDetected = + // ( + // low == mLL + // || MathAbs(mLL - low) < (smoother * _Point) + // ) + // && + // !( + // mLL > m2LL + // && MathAbs(m2LL - mLL) > sharpDetectValue / 2 + // ) + // && + ( + hlDiff > sharpDetectValue + || hlDiff > sharpDetectValue - (smoother * _Point) + ) + ; + + // + if (isSharpDetected) { + // + shpLongConds.start = mHLTime; + shpLongConds.stop = barTime; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateSHPLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMultiplier // Sharp Detect Multiplier ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateSHPLongConditions(shpDetectMultiplier)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // ll; + + // + // this means Market Lowest Low ... + double shpValue = shpDetectMultiplier * _Point; + if ( + reward == 0 + || reward < 20 * _Point + ) { + reward = shpValue; + } + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_SHP_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_SHP_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateSHPLongConditions( + const double shpDetectMultiplier +) { + // + double shpDetectValue = shpDetectMultiplier * _Point; + + // + bool isConditionsFilled = + shpLongConds.stop != 0 + && shpLongConds.start != 0 + && shpLongConds.stop > shpLongConds.start + ; + + // + bool isBLFilled = true; + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearSHPLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearSHPLongSignalConditions() { + // + shpLongConds.stop = 0; + shpLongConds.start = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForSHPLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + int xmaMarketLen = ArraySize(states); + double mHH = GetMarketHighestHigh(0, xmaMarketLen); + double m2HH = GetMarketHighestHigh(0, (int) (xmaMarketLen * 1.5)); + + // + int lcUpDownTouches = 0; + int cciHundredTouches = 0; + for (int i = 0; i < xmaMarketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + double up = MathMax(states[i].lc.fast, states[i].lc.slow); + double down = MathMax(states[i].lc.fast, states[i].lc.slow); + + // + if (high >= up && low <= down) { + lcUpDownTouches++; + } + + // + if ( + i < xmaMarketLen - 1 + && i < 10 + ) { + if ( + states[i].cci < 100 + && states[i + 1].cci > 100 + ) { + cciHundredTouches++; + } + } + } + + // + result = + // + true + // + && states[0].mc.fast > states[0].mc.slow + && states[0].lc.fast > states[0].lc.slow + // + && states[0].sc.fast < states[0].sc.slow + && states[1].sc.fast < states[1].sc.slow + // + && states[0].marketMiddleage < states[0].sc.fast + && states[1].marketMiddleage < states[1].sc.fast + && !( + states[1].sc.fast < states[1].mc.fast + && states[1].sc.slow < states[1].mc.fast + && states[1].sc.fast > states[1].mc.slow + && states[1].sc.slow > states[1].mc.slow + ) + && !( + states[0].marketMiddleage < states[0].mc.fast + && states[0].marketMiddleage > states[0].mc.slow + ) + // + && mHH != m2HH + && lcUpDownTouches == 0 + && cciHundredTouches == 0 + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..2b4fa56 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1456 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) + { + case X_XXX_PROVIDER: + result = "XXX"; + break; + + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, + "_", GetProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + // + // ClearOSCLongSignalConditions(); + // ClearCCILongSignalConditions(); + // ClearSHPLongSignalConditions(); + // ClearXRMALongSignalConditions(); + // // + // ClearXMASCLongSignalConditions(); + // ClearXMAMCLongSignalConditions(); + // ClearXMAMMLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..3863381 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,676 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; +}; + +// +static XSignalConditions xLongConds; +static XSignalConditions xShortConds; + +// +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; +static datetime xWaitForLongSignalChangeTime; + +// +static bool xWaitForShortSignals = true; +static bool xCloseShortTrades = false; + +// +bool isLastTrendUp = false; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // // + // bool isCrossUnder = + // states[1].osc.fast < states[1].osc.slow + // && !(states[2].osc.fast < states[2].osc.slow) + // ; + + // // + // bool isCrossOver = + // states[1].osc.fast > states[1].osc.slow + // && !(states[2].osc.fast > states[2].osc.slow) + // ; + + // + XOHCL pCandle = GetCandleModel(1); + + // // + // bool isTrendingUp = + // pCandle.low > states[0].bnd.high + // && pCandle.high > states[0].bnd.high; + + // // + // bool isTrendingDown = + // pCandle.high < states[0].bnd.low + // && pCandle.low < states[0].bnd.low; + + // + bool isTrendingUp = + states[1].bnd.open < states[1].bnd.close + && !(states[2].bnd.open < states[2].bnd.close) + ; + + // + bool isTrendingDown = + states[1].bnd.open > states[1].bnd.close + && !(states[2].bnd.open > states[2].bnd.close) + ; + + // + bool isCrossUnder = + isTrendingDown + && !isTrendingUp + ; + + // + bool isCrossOver = + isTrendingUp + && !isTrendingDown + ; + + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + if (xWaitForLongSignals) { + // + bool isLCFastOnTrendingUpTouchLowestLow = + // + // LC Trending Up ... + states[1].lc.fast > states[1].lc.slow + && states[2].lc.fast > states[2].lc.slow + // + // LC Fast Touch Market Lowest Low ... + && states[1].lc.fast > states[1].mkt.lowestLow + && !(states[2].lc.fast > states[2].mkt.lowestLow) + ; + + // + bool isMCSlowCrossOverBNDHigh = + states[1].mc.fast > states[1].mc.slow + && states[1].mc.slow > states[1].bnd.high + && !(states[2].mc.slow > states[2].bnd.high) + ; + + // + // Disable Long Trade Handlers ... + if ( + isMCSlowCrossOverBNDHigh + || isLCFastOnTrendingUpTouchLowestLow + ) { + // + xWaitForLongSignals = false; + xWaitForLongSignalChangeTime = TimeCurrent(); + LogMessage("Disable Long: " + TimeCurrent()); + } + } else { + // + bool isAllTrendingUp = + // + // SC ... + states[1].sc.fast > states[1].sc.slow + // + // MC ... + && states[1].mc.fast > states[1].mc.slow + && !(states[2].mc.fast > states[2].mc.slow) + // + // LC ... + && states[1].lc.fast > states[1].lc.slow + ; + + // + int lastWaitChangeBarIndex = iBarShift( + _Symbol, + _Period, + xWaitForLongSignalChangeTime + ); + + // + // Enable Long Trade Handlers ... + if ( + isAllTrendingUp + && lastWaitChangeBarIndex - bar_index >= marketLen + ) { + xWaitForLongSignals = true; + LogMessage("Enable Long: " + TimeCurrent()); + } + } + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossUnder = + states[1].osc.fast < states[1].osc.slow + && !(states[2].osc.fast < states[2].osc.slow) + ; + + // + bool isCrossOver = + states[1].osc.fast > states[1].osc.slow + && !(states[2].osc.fast > states[2].osc.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const XState &states[], + // + const double smoother = 5 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double hh = + GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * r2r; // risk * r2r; // 300 * _Point; + // if (risk > (500 * _Point)) { + // reward = 300 * _Point; + // } + + // + double sl = 0; // ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = type; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XXX_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +bool ValidateXShortConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal, + const XState &states[], + const int marketLen, + // + double smoother = 100 +) { + // + bool result = false; + + // + bool isSCTrendUp = + states[1].sc.fast > states[1].sc.slow + && states[2].sc.fast > states[2].sc.slow; + + // // + // bool isSCTrendDown = + // states[1].sc.fast < states[1].sc.slow + // && states[2].sc.fast < states[2].sc.slow; + + // + bool isMCTrendUp = + states[1].mc.fast > states[1].mc.slow + && states[2].mc.fast > states[2].mc.slow; + + // // + // bool isMCTrendDown = + // states[1].mc.fast < states[1].mc.slow + // && states[2].mc.fast < states[2].mc.slow; + + // + bool isLCTrendUp = + states[1].lc.fast > states[1].lc.slow + && states[2].lc.fast > states[2].lc.slow; + + // // + // bool isLCTrendDown = + // states[1].lc.fast < states[1].lc.slow + // && states[2].lc.fast < states[2].lc.slow; + + // // + // bool isTrendingUp = + // pCandle.low > states[0].bnd.high + // && pCandle.high > states[0].bnd.high; + + // // + // bool isTrendingDown = + // pCandle.high < states[0].bnd.low + // && pCandle.low < states[0].bnd.low; + + // // + // if (isTrendingUp && !isTrendingDown) { + // isLastTrendUp = true; + // } else if (isTrendingDown && !isTrendingUp) { + // isLastTrendUp = false; + // } + + // // + // if (isLastTrendUp) { + // // + // LogMessage( + // StringConcatenate( + // "isLastTrendUp: ", isLastTrendUp + // ) + // ); + // } + + // + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + true + // + && isSCTrendUp + && isMCTrendUp + && isLCTrendUp + // + && + ( + pCandle.high < states[1].longCycleHighestHigh + && !(MathAbs(states[1].longCycleHighestHigh - pCandle.high) < 20 * _Point) + ) + // + && ( + states[1].lc.fast > states[1].mc.fast + && states[1].lc.slow > states[1].mc.fast + ? + states[1].lc.slow < states[1].mkt.lowestLow + : + true + ) + // + // && signal.entry <= states[1].mkt.highestOpen + // // + // && ( + // ( + // states[1].mc.slow < states[1].bnd.low + // && states[1].mc.fast < MathMin(states[1].bnd.open, states[1].bnd.close) + // ) || ( + // states[1].lc.fast > states[1].bnd.low + // && states[1].lc.fast > states[1].mc.fast + // ) + // ) + // && MathAbs(states[1].mc.fast - states[1].bnd.low) > 50 * _Point + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mc.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mc.signal.lib.mq4 new file mode 100644 index 0000000..13b787e --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mc.signal.lib.mq4 @@ -0,0 +1,490 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMCLongSignalConditions { + // + datetime mcFastCrossUnderSlowTime; + double crossUnderMCFast; + double crossUnderMCSlow; + + // + datetime mcFastCrossOverSlowTime; + double crossOverMCFast; + double crossOverMCSlow; + + // + datetime mcFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMAMCLongSignalConditions xmaMCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState mcs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + mcs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState mc = GetXMAMC( + i, + marketLen, + mcFMult, + mcSMult + ); + mcs[index] = mc; + + // + index++; + } + + // + bool isMCFastCrossUnderSlow = + mcs[0].fast < mcs[0].slow + && !(mcs[1].fast <= mcs[1].slow) + ; + bool isMCFastCrossOverSlow = + mcs[0].fast > mcs[0].slow + && !(mcs[1].fast >= mcs[1].slow) + ; + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + ) { + // + ClearXMAMCLongSignalConditions(); + + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossOverSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime == 0 + ) { + // + xmaMCLongConds.crossOverMCFast = mcs[0].fast; + xmaMCLongConds.crossOverMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime > 0 + && mcs[0].fast > xmaMCLongConds.crossUnderMCSlow + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMult, + const double smoother = 50 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !ValidateXMAMCLongConditions( + marketLen, + shpDetectMult, + smoother + ) + ) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + 3 + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMCLongConditions( + const int marketLen, + const double shpDetectMult, + const double smoother = 50 +) { + // + bool isConditionsFilled = + xmaMCLongConds.crossOverMCSlow > 0 + && xmaMCLongConds.crossOverMCFast > 0 + && xmaMCLongConds.crossUnderMCFast > 0 + && xmaMCLongConds.crossUnderMCSlow > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime != 0 + && xmaMCLongConds.mcFastCrossUnderSlowTime != 0 + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime != 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastCrossUnderSlowTime + ); + + // + int crossOverAndBiggerBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime + ); + + // + int cycleMarketLen = MathMin( + MathAbs(crossUnderBarIndex - crossOverAndBiggerBarIndex), + marketLen * 2 + ); + double hh = GetMarketHighestHigh( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + double ll = GetMarketLowestLow( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + + // + double high = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + ); + double pcHigh = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + 1 + ); + + // + double diff = (hh - ll); + double shpValue = shpDetectMult * _Point; + + // + bool isPriceRegular = + // + true + // + && + ( + diff < shpValue + || diff < shpValue - (smoother * _Point) + ) + && + !( + high == hh + || pcHigh == hh + || MathAbs(hh - high) < (smoother * _Point) + || MathAbs(hh - pcHigh) < (smoother * _Point) + ) + ; + + // + // LogMessage("Price Regular: " + isPriceRegular); + + // + isBLFilled = + isPriceRegular + && xmaMCLongConds.mcFastCrossUnderSlowTime < xmaMCLongConds.mcFastCrossOverSlowTime + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime >= xmaMCLongConds.mcFastCrossUnderSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMCLongSignalConditions() { + // + xmaMCLongConds.mcFastCrossUnderSlowTime = 0; + xmaMCLongConds.crossUnderMCFast = 0; + xmaMCLongConds.crossUnderMCSlow = 0; + + // + xmaMCLongConds.mcFastCrossOverSlowTime = 0; + xmaMCLongConds.crossOverMCFast = 0; + xmaMCLongConds.crossOverMCSlow = 0; + + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + int countRangedCandles = 0; + bool isMarketRanging = false; + for (int i = 1; i < marketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + bool isRanging = + // + high > states[i].mc.fast + && high > states[i].mc.slow + // + && low < states[i].mc.fast + && low < states[i].mc.slow + ; + if (isRanging) { + countRangedCandles++; + } + } + + // + XStateInfo info = ParseXMAStates(states); + double mmSlope = GetSlope( + 1, + states[1].marketMiddleage, + 2, + states[0].marketMiddleage + ); + double mmSlope1 = GetSlope( + 1, + states[2].marketMiddleage, + 2, + states[1].marketMiddleage + ); + double mmSlopeDiff = mmSlope - mmSlope1; + + // + isMarketRanging = countRangedCandles > 0; + + // + result = + // + true + // + && mmSlope > 0 + && mmSlope1 > 0 + && mmSlopeDiff > 0 + && !isMarketRanging + && states[0].marketMiddleage < info.mmMax + ; + // if (result) { + // LogMessage("mmSlope: " + mmSlope + ", mmSlope1: " + mmSlope1 + ", Diff: " + mmSlopeDiff); + // } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mm.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mm.signal.lib.mq4 new file mode 100644 index 0000000..d883803 --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.mm.signal.lib.mq4 @@ -0,0 +1,338 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMMLongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XMAMMLongSignalConditions xmaMMLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMMLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].marketMiddleage < states[1].sc.fast + && !(states[2].marketMiddleage < states[2].sc.fast) + ; + + // + bool isCrossOver = + states[1].marketMiddleage > states[1].sc.fast + && !(states[2].marketMiddleage > states[2].sc.fast) + ; + + // + if ( + isCrossUnder + && xmaMMLongConds.crossUnderTime == 0 + ) { + // + xmaMMLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xmaMMLongConds.crossUnderTime > 0 + && xmaMMLongConds.crossOverTime == 0 + ) { + // + xmaMMLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMMLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMAMMLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMMLongConditions() { + // + bool isConditionsFilled = + true + && xmaMMLongConds.crossOverTime > 0 + && xmaMMLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossUnderTime + ); + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xmaMMLongConds.crossOverTime > xmaMMLongConds.crossUnderTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMMLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMMLongSignalConditions() { + // + xmaMMLongConds.crossOverTime = 0; + xmaMMLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMMLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + // && states[0].parabolicSAR < states[0].marketMiddleage + // && !( + // states[0].parabolicSAR < states[0].mc.fast + // && states[0].parabolicSAR < states[0].mc.slow + // ) + // + // && states[0].mc.fast > states[0].mc.slow + // + // && MathAbs(states[0].mc.fast - states[0].mc.slow) > (150 * _Point) + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.sc.signal.lib.mq4 b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.sc.signal.lib.mq4 new file mode 100644 index 0000000..218759c --- /dev/null +++ b/Bkp/Used/14020425/21-00/Libraries/x-saherelm.xma.sc.signal.lib.mq4 @@ -0,0 +1,360 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMASCLongSignalConditions { + // + datetime scFastCrossUnderSlowTime; + double crossUnderSCFast; + double crossUnderSCSlow; + + // + datetime scFastCrossOverSlowTime; + double crossOverSCFast; + double crossOverSCSlow; + + // + datetime scFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMASCLongSignalConditions xmaSCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMASCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState scs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + scs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState sc = GetXMASC( + i, + marketLen, + scFMult, + scSMult + ); + scs[index] = sc; + + // + index++; + } + + // + bool isSCFastCrossUnderSlow = + scs[0].fast < scs[0].slow + && !(scs[1].fast <= scs[1].slow) + ; + bool isSCFastCrossOverSlow = + scs[0].fast > scs[0].slow + && !(scs[1].fast >= scs[1].slow) + ; + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.crossUnderSCFast = scs[0].fast; + xmaSCLongConds.crossUnderSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossOverSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime == 0 + ) { + // + xmaSCLongConds.crossOverSCFast = scs[0].fast; + xmaSCLongConds.crossOverSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + && scs[0].fast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + ) { + // + ClearXMASCLongSignalConditions(); + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMASCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... + // + // const double shpDetectMultiplier +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMASCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // // + // double sharpDetectValue = shpDetectMultiplier * _Point; + // double lowPrice = iLow( + // _Symbol, + // _Period, + // bar_index + 1 + // ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMASCLongConditions() { + // + bool isConditionsFilled = + xmaSCLongConds.crossOverSCSlow > 0 + && xmaSCLongConds.crossOverSCFast > 0 + && xmaSCLongConds.crossUnderSCFast > 0 + && xmaSCLongConds.crossUnderSCSlow > 0 + && xmaSCLongConds.scFastCrossOverSlowTime != 0 + && xmaSCLongConds.scFastCrossUnderSlowTime != 0 + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime !=0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + xmaSCLongConds.crossOverSCFast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastCrossUnderSlowTime < xmaSCLongConds.scFastCrossOverSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMASCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMASCLongSignalConditions() { + // + xmaSCLongConds.crossUnderSCFast = 0; + xmaSCLongConds.crossUnderSCSlow = 0; + xmaSCLongConds.scFastCrossUnderSlowTime = 0; + + // + xmaSCLongConds.crossOverSCFast = 0; + xmaSCLongConds.crossOverSCSlow = 0; + xmaSCLongConds.scFastCrossOverSlowTime = 0; + + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMASCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + && states[0].sc.fast > states[0].sc.slow + && states[1].sc.fast > states[1].sc.slow + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020425/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..26c92ca --- /dev/null +++ b/Bkp/Used/14020425/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,780 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio +// input double maxTPMultiplier = 1000; // Max Allowed TP + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.05; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 408; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// Indicators ... +// +// CCI Inputs ... +input double step = 0.01; // SAR Step +input double maximum = 0.1; // SAR Maximum + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier + +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 800; // Sharp Detect Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + ClearSignalConditions(); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // // + // closeLongTrades = xCloseLongTrades; + // waitForLongSignals = xWaitForLongSignals; + + // // + // closeShortTrades = xCloseShortTrades; + // waitForShortSignals = xWaitForShortSignals; + + // // + // xCloseLongTrades = false; + // xCloseShortTrades = false; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < longCycleSlowMultiplier * marketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + } + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Retrieve XMA States ... + // based on medium cycle slow ... + XState states[]; + ArrayFree(states); + ArrayResize( + states, + marketLength + ); + + // + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + states[index] = GetXState( + i, + marketLength, + // + step, + maximum, + // + shortCycleFastMultiplier, + shortCycleSlowMultiplier, + mediumCycleFastMultiplier, + mediumCycleSlowMultiplier, + longCycleFastMultiplier, + longCycleSlowMultiplier + ); + + // + index++; + } + + // + CheckXLongSignalConditions( + bar_index, + marketLength, + states + ); + + // + CheckXShortSignalConditions( + bar_index, + marketLength, + states + ); + + // + XSignalRequest xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + XSignalRequest xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } else if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.adx.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.adx.mq4 new file mode 100644 index 0000000..3271a4e --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.adx.mq4 @@ -0,0 +1,220 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +input ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; // Averaging Applied Price +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 3 + +// +#property indicator_level1 0.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_level4 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// ADX ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Positive Direction ... +#property indicator_width2 1 +#property indicator_color2 clrLime +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +// Negative Direction ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// Declare Buffers ... +#define adxBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double adxBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexLabel(positiveBufferIndex, "DI+"); + + // + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + SetIndexLabel(negativeBufferIndex, "DI-"); + + // + SetIndexBuffer(adxBufferIndex, adxBuffer); + SetIndexLabel(adxBufferIndex, "ADX"); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..829f32c --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,257 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 2 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 2 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.shpd.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.shpd.mq4 new file mode 100644 index 0000000..7c02a84 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.shpd.mq4 @@ -0,0 +1,402 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XSHPD Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XSHPD Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length ... +input double sharpDetectMultiplier = 70; // Sharp Detect Multiplier + +// +input bool drawLabels = true; // Draw Labels on Founded Sharps + +// +input string sharpBullishLabel = "SH_BULL"; // Sharp Bullish Label +input color sharpBullishColor = clrAqua; // Sharp Bullish color + +// +input string sharpBearishLabel = "SH_BEAR"; // Sharp Bearish Label +input color sharpBearishColor = clrFuchsia; // Sharp Bearish color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +#property indicator_buffers 4 +#property indicator_plots 4 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketLowestLowBufferIndex 1 +#define sharpBullishBufferIndex 2 +#define sharpBearishBufferIndex 3 + +// +double marketHighestHighBuffer[]; +double marketLowestLowBuffer[]; +double sharpBullishBuffer[]; +double sharpBearishBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + enableLogging = true; + + // + logTag = "X_SHPD"; + + // + // Highest High ... + SetIndexLabel(marketHighestHighBufferIndex, ""); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + DRAW_LINE, // DRAW_NONE, + STYLE_DOT, + 1, // 0, + clrAqua // clrNONE + ); + + // + // Lowest Low ... + SetIndexLabel(marketLowestLowBufferIndex, ""); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bullish Buffer ... + SetIndexLabel(sharpBullishBufferIndex, ""); + SetIndexBuffer(sharpBullishBufferIndex, sharpBullishBuffer); + SetIndexStyle( + sharpBullishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bearish Buffer ... + SetIndexLabel(sharpBearishBufferIndex, ""); + SetIndexBuffer(sharpBearishBufferIndex, sharpBearishBuffer); + SetIndexStyle( + sharpBearishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Sharp ... + CalculateSharp(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Sharp ... +void CalculateSharp( + const int &bar_index +) { + // + int index = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + marketHighestHighBuffer[bar_index] = GetMarketHighestHigh( + bar_index, + marketLength + ); + + // + marketLowestLowBuffer[bar_index] = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + double maHHs[]; + ArrayResize( + maHHs, + marketLength + ); + + // + double maLLs[]; + ArrayResize( + maLLs, + marketLength + ); + + // + index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + maLLs[index] = marketLowestLowBuffer[i]; + maHHs[index] = marketHighestHighBuffer[i]; + + // + index++; + } + + // + int maxHighIdx = ArrayMaximum(maHHs); + double maxHigh = maHHs[maxHighIdx]; + + // + int minHighIdx = ArrayMinimum(maHHs); + double minHigh = maHHs[minHighIdx]; + + // + double highDiffRate = (maxHigh - minHigh) / 100; + + // + int maxLowIdx = ArrayMaximum(maLLs); + double maxLow = maLLs[maxLowIdx]; + + // + int minLowIdx = ArrayMinimum(maLLs); + double minLow = maLLs[minLowIdx]; + + // + double lowDiffRate = (maxLow - minLow) / 100; + + // + bool isSharpBullishDetected = + high == maxHigh + && low > minLow + && marketHighestHighBuffer[bar_index] == maxHigh + && maxHigh - minHigh > highDiffRate * sharpDetectMultiplier + ; + sharpBullishBuffer[bar_index] = isSharpBullishDetected ? 1 : 0; + + // + bool isSharpBearishDetected = + low == minLow + && high < maxHigh + && marketLowestLowBuffer[bar_index] == minLow + && maxLow - minLow > lowDiffRate * sharpDetectMultiplier + ; + sharpBearishBuffer[bar_index] = isSharpBearishDetected ? 1 : 0; + + // + if ( + drawLabels + && ( + isSharpBearishDetected + || isSharpBullishDetected + ) + ) { + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + string lbl = StringConcatenate( + logTag, + isSharpBullishDetected ? "Bullish_" : "Bearish_", + bar_index + ); + + // + double price = + isSharpBullishDetected + ? + marketLowestLowBuffer[bar_index] - (10 * _Point) + : + marketHighestHighBuffer[bar_index] + (10 * _Point) + ; + + // + uchar arrowCode = + isSharpBullishDetected + ? + SYMBOL_ARROWUP + : + SYMBOL_ARROWDOWN + ; + + // + ENUM_ARROW_ANCHOR anchor = + isSharpBullishDetected + ? + ANCHOR_BOTTOM + : + ANCHOR_TOP + ; + + // + color clr = + isSharpBullishDetected + ? + sharpBullishColor + : + sharpBearishColor + ; + + // + string lblText = + isSharpBullishDetected + ? + sharpBullishLabel + : + sharpBearishLabel + ; + + // + DrawText( + 0, + lbl, + 0, + time, + price, + lblText, + "Tahoma", + 5, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.trend.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.trend.mq4 new file mode 100644 index 0000000..17873e7 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.trend.mq4 @@ -0,0 +1,250 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +// #property indicator_buffers 3 + +// +// Declare Buffers ... +// +datetime startTime; +double lHigh; +double lLow; + +// +datetime highTimes[]; + +// +datetime lowTimes[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + return; + } + + // + if ( + startTime > 0 + && startBarIndex - bar_index == length + ) { + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + length, + bar_index + ); + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int hhSize = ArraySize(highTimes); + datetime tempTimes[]; + ArrayResize( + tempTimes, + hhSize + ); + ArrayCopy( + tempTimes, + highTimes + ); + ArrayResize( + highTimes, + hhSize + 1 + ); + highTimes[0] = hhTime; + ArrayCopy( + highTimes, + tempTimes, + 1 + ); + + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + length, + bar_index + ); + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int llSize = ArraySize(lowTimes); + ArrayFree(tempTimes); + ArrayResize( + tempTimes, + llSize + ); + ArrayCopy( + tempTimes, + lowTimes + ); + ArrayResize( + lowTimes, + llSize + 1 + ); + lowTimes[0] = llTime; + ArrayCopy( + lowTimes, + tempTimes, + 1 + ); + + // + startTime = 0; + ArrayFree(tempTimes); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.xbnd.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.xbnd.mq4 new file mode 100644 index 0000000..b8d2b43 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.xbnd.mq4 @@ -0,0 +1,422 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XBand Indicator +// --------------------------------------------- +// saherelm implementation of xBand Indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XBND Indicator" +#property strict + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Inputs ... +// +input int marketLength = 5; // Averaging Length +input int ignoreLastCross = 4; // Ignore Last Cross +input int shift = 0; // Averaging Shift +input ENUM_MA_METHOD method = MODE_SMA; // Averaging Mode +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +#property indicator_buffers 4 + +// +// Declare Buffers ... +// +// High ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_DASHDOT + +// +// Open ... +#property indicator_width2 1 +#property indicator_color2 clrGreen +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DASH + +// +// Close ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DASH + +// +// Low ... +#property indicator_width4 1 +#property indicator_color4 clrFuchsia +#property indicator_type4 DRAW_LINE +#property indicator_style4 STYLE_DASHDOT + +// +#define highBufferIndex 0 +#define openBufferIndex 1 +#define closeBufferIndex 2 +#define lowBufferIndex 3 + +// +double highBuffer[]; +double openBuffer[]; +double closeBuffer[]; +double lowBuffer[]; + +// +datetime lastCrossTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength < 5) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XBND"; + + // + // High ... + string highLabel = StringConcatenate( + "High(", marketLength, ")" + ); + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, highLabel); + + // + // Open ... + string openLabel = StringConcatenate( + "Open(", marketLength, ")" + ); + SetIndexBuffer(openBufferIndex, openBuffer); + SetIndexLabel(openBufferIndex, openLabel); + + // + // Close ... + string closeLabel = StringConcatenate( + "Close(", marketLength, ")" + ); + SetIndexBuffer(closeBufferIndex, closeBuffer); + SetIndexLabel(closeBufferIndex, closeLabel); + + // + // Low ... + string lowLabel = StringConcatenate( + "Low(", marketLength, ")" + ); + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, lowLabel); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + + // + // Calculate Market Changes ... + CalculateInfo(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // High ... + double high = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_HIGH, + bar_index + ); + + // + highBuffer[bar_index] = high; + + // + // Open ... + double open = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_OPEN, + bar_index + ); + + // + openBuffer[bar_index] = open; + + // + // Close ... + double close = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_CLOSE, + bar_index + ); + + // + closeBuffer[bar_index] = close; + + // + // Low ... + double low = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_LOW, + bar_index + ); + + // + lowBuffer[bar_index] = low; +} + +// +void CalculateInfo( + const int bar_index +) { + // + XOHCL pCandle = GetCandleModel(bar_index); + + // + bool isTrendingUp = + pCandle.low > highBuffer[bar_index] + && pCandle.high > highBuffer[bar_index]; + + // + bool isTrendingDown = + pCandle.high < lowBuffer[bar_index] + && pCandle.low < lowBuffer[bar_index]; + + // + bool isOpenCrossOverClose = + true + && + ( + pCandle.high > highBuffer[bar_index + 1] + || pCandle.low < lowBuffer[bar_index + 1] + ) + && openBuffer[bar_index + 1] > closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] >= closeBuffer[bar_index + 2]) + ; + + // + bool isOpenCrossUnderClose = + true + && + ( + pCandle.high > highBuffer[bar_index + 1] + || pCandle.low < lowBuffer[bar_index + 1] + ) + && openBuffer[bar_index + 1] < closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] <= closeBuffer[bar_index + 2]) + ; + + // + isTrendingUp = isOpenCrossUnderClose; + isTrendingDown = isOpenCrossOverClose; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + if (lastCrossTime == 0) { + lastCrossTime = time; + } else { + // + int lastCrossBarIndex = iBarShift( + _Symbol, + _Period, + lastCrossTime + ); + + // + int diff = lastCrossBarIndex - bar_index; + if (diff <= ignoreLastCross) { + return; + } else { + lastCrossTime = time; + } + } + } + + // + string lbl = StringConcatenate( + logTag, + "_Arrow_", + isTrendingUp ? "UP" : "Down", + "_", time + ); + + // + color clr = isTrendingUp ? + clrAqua : + clrFuchsia; + + // + ENUM_ARROW_ANCHOR anchor = isTrendingUp ? + ANCHOR_BOTTOM : + ANCHOR_TOP; + + // + uchar arrowCode = isTrendingUp ? + SYMBOL_ARROWUP : + SYMBOL_ARROWDOWN; + + // + double price = isTrendingUp ? + pCandle.low - 20 * _Point : + pCandle.high + 20 * _Point; + + // + if (isTrendingUp) { + // + // this means Market Going Up ... + + } + + // + if (isTrendingDown) { + // + // this means Market Going Downm ... + } + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + bool isDrawn = DrawArrow( + 0, + lbl, + 0, + time, + price, + arrowCode, + anchor, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..4a599f9 --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,695 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +// +// Cycle Definitions ... +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showPSar = true; // Show Parabolic Sar +input bool showMarketMiddle = true; // Show Market Middle +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 +#define pSarBufferIndex 7 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; +double pSarBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + SetIndexLabel(midBufferIndex, "Market Mid"); + + // + // Parabolic Sar ... + SetIndexBuffer(pSarBufferIndex, pSarBuffer); + SetIndexLabel(pSarBufferIndex, "P Sar"); + SetIndexStyle( + pSarBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showPSar ? + pSarColor : + clrNONE + ); + + // + // Market Middle ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexLabel(midBufferIndex, "Mid"); + SetIndexStyle( + midBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMarketMiddle ? + clrAntiqueWhite : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + + // + // Calculate Parabolic Sar ... + CalculateParabolicSar(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} + +void CalculateParabolicSar( + const int bar_index +) { + // + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + pSarBuffer[bar_index] = sarValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.xmarket.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.xmarket.mq4 new file mode 100644 index 0000000..71b2e2c --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.xmarket.mq4 @@ -0,0 +1,394 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMKT Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +// +input bool showHighestHigh = true; // Show Market Highest High +input bool showHighestLow = true; // Show Market Highest Low +input bool showHighestOpen = true; // Show Market Highest Open +input bool showHighestClose = true; // Show Market Highest Close +input bool showLowestHigh = true; // Show Market Lowest High +input bool showLowestLow = true; // Show Market Lowest Low +input bool showLowestOpen = true; // Show Market Lowest Open +input bool showLowestClose = true; // Show Market Lowest Close +// +input color highestHighColor = clrDeepPink; // Market Highest High Color +input color highestLowColor = clrDarkOrange; // Market Highest Low Color +input color highestOpenColor = clrDodgerBlue; // Market Highest Open Color +input color highestCloseColor = clrOrchid; // Market Highest Close Color +input color lowestHighColor = clrHotPink; // Market Lowest High Color +input color lowestLowColor = clrOrange; // Market Lowest Low Color +input color lowestOpenColor = clrPowderBlue; // Market Lowest Open Color +input color lowestCloseColor = clrMediumOrchid; // Market Lowest Close Color +// +input ENUM_LINE_STYLE highestHighStyle = STYLE_DOT; // Market Highest High Line Style +input ENUM_LINE_STYLE highestLowStyle = STYLE_DOT; // Market Highest Low Line Style +input ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT; // Market Highest Open Line Style +input ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT; // Market Highest Close Line Style +input ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT; // Market Lowest High Line Style +input ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT; // Market Lowest Low Line Style +input ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT; // Market Lowest Open Line Style +input ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT; // Market Lowest Close Line Style +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketHighestLowBufferIndex 1 +#define marketHighestOpenBufferIndex 2 +#define marketHighestCloseBufferIndex 3 +#define marketLowestHighBufferIndex 4 +#define marketLowestLowBufferIndex 5 +#define marketLowestOpenBufferIndex 6 +#define marketLowestCloseBufferIndex 7 + +// +double marketHighestHighBuffer[]; +double marketHighestLowBuffer[]; +double marketHighestOpenBuffer[]; +double marketHighestCloseBuffer[]; +double marketLowestHighBuffer[]; +double marketLowestLowBuffer[]; +double marketLowestOpenBuffer[]; +double marketLowestCloseBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMKT"; + + // + // Highest High ... + string highestHighLbl = StringConcatenate("HH(", marketLength,")"); + SetIndexLabel(marketHighestHighBufferIndex, highestHighLbl); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + showHighestHigh ? + DRAW_LINE : + DRAW_NONE, + highestHighStyle, + 1, + showHighestHigh ? + highestHighColor : + clrNONE + ); + + // + // Highest Low ... + string highestLowLbl = StringConcatenate("HL(", marketLength,")"); + SetIndexLabel(marketHighestLowBufferIndex, highestLowLbl); + SetIndexBuffer(marketHighestLowBufferIndex, marketHighestLowBuffer); + SetIndexStyle( + marketHighestLowBufferIndex, + showHighestLow ? + DRAW_LINE : + DRAW_NONE, + highestLowStyle, + 1, + showHighestLow ? + highestLowColor : + clrNONE + ); + + // + // Highest Open ... + string highestOpenLbl = StringConcatenate("HO(", marketLength,")"); + SetIndexLabel(marketHighestOpenBufferIndex, highestOpenLbl); + SetIndexBuffer(marketHighestOpenBufferIndex, marketHighestOpenBuffer); + SetIndexStyle( + marketHighestOpenBufferIndex, + showHighestOpen ? + DRAW_LINE : + DRAW_NONE, + highestOpenStyle, + 1, + showHighestOpen ? + highestOpenColor : + clrNONE + ); + + // + // Highest Close ... + string highestCloseLbl = StringConcatenate("HC(", marketLength,")"); + SetIndexLabel(marketHighestCloseBufferIndex, highestCloseLbl); + SetIndexBuffer(marketHighestCloseBufferIndex, marketHighestCloseBuffer); + SetIndexStyle( + marketHighestCloseBufferIndex, + showHighestClose ? + DRAW_LINE : + DRAW_NONE, + highestCloseStyle, + 1, + showHighestClose ? + highestCloseColor : + clrNONE + ); + + // + // Lowest High ... + string lowestHighLbl = StringConcatenate("LH(", marketLength,")"); + SetIndexLabel(marketLowestHighBufferIndex, lowestHighLbl); + SetIndexBuffer(marketLowestHighBufferIndex, marketLowestHighBuffer); + SetIndexStyle( + marketLowestHighBufferIndex, + showLowestHigh ? + DRAW_LINE : + DRAW_NONE, + lowestHighStyle, + 1, + showLowestHigh ? + lowestHighColor : + clrNONE + ); + + // + // Lowest Low ... + string lowestLowLbl = StringConcatenate("LL(", marketLength,")"); + SetIndexLabel(marketLowestLowBufferIndex, lowestLowLbl); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + showLowestLow ? + DRAW_LINE : + DRAW_NONE, + lowestLowStyle, + 1, + showLowestLow ? + lowestLowColor : + clrNONE + ); + + // + // Lowest Open ... + string lowestOpenLbl = StringConcatenate("LO(", marketLength,")"); + SetIndexLabel(marketLowestOpenBufferIndex, lowestOpenLbl); + SetIndexBuffer(marketLowestOpenBufferIndex, marketLowestOpenBuffer); + SetIndexStyle( + marketLowestOpenBufferIndex, + showLowestOpen ? + DRAW_LINE : + DRAW_NONE, + lowestOpenStyle, + 1, + showLowestOpen ? + lowestOpenColor : + clrNONE + ); + + // + // Lowest Close ... + string lowestCloseLbl = StringConcatenate("LC(", marketLength,")"); + SetIndexLabel(marketLowestCloseBufferIndex, lowestCloseLbl); + SetIndexBuffer(marketLowestCloseBufferIndex, marketLowestCloseBuffer); + SetIndexStyle( + marketLowestCloseBufferIndex, + showLowestClose ? + DRAW_LINE : + DRAW_NONE, + lowestCloseStyle, + 1, + showLowestClose ? + lowestCloseColor : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index +) { + // + // Highest High ... + double highestHighValue = GetMarketHighestHigh( + bar_index, + marketLength + ); + marketHighestHighBuffer[bar_index] = highestHighValue; + + // + // Highest Low ... + double highestLowValue = GetMarketHighestLow( + bar_index, + marketLength + ); + marketHighestLowBuffer[bar_index] = highestLowValue; + + // + // Highest Open ... + double highestOpenValue = GetMarketHighestOpen( + bar_index, + marketLength + ); + marketHighestOpenBuffer[bar_index] = highestOpenValue; + + // + // Highest Close ... + double highestCloseValue = GetMarketHighestClose( + bar_index, + marketLength + ); + marketHighestCloseBuffer[bar_index] = highestCloseValue; + + // + // Lowest High ... + double lowestHighValue = GetMarketLowestHigh( + bar_index, + marketLength + ); + marketLowestHighBuffer[bar_index] = lowestHighValue; + + // + // Lowest Low ... + double lowestLowValue = GetMarketLowestLow( + bar_index, + marketLength + ); + marketLowestLowBuffer[bar_index] = lowestLowValue; + + // + // Lowest Open ... + double lowestOpenValue = GetMarketLowestOpen( + bar_index, + marketLength + ); + marketLowestOpenBuffer[bar_index] = lowestOpenValue; + + // + // Lowest Close ... + double lowestCloseValue = GetMarketLowestClose( + bar_index, + marketLength + ); + marketLowestCloseBuffer[bar_index] = lowestCloseValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.xmtrend.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.xmtrend.mq4 new file mode 100644 index 0000000..aa89e7b --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.xmtrend.mq4 @@ -0,0 +1,221 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMTR Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 20; // Market Length +input int atrMultiplier = 1; // ATR Multiplier +input int atrLength = 5; // ATR Period +input ENUM_APPLIED_PRICE source = PRICE_CLOSE; // Source +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 3 +#property indicator_plots 3 + +// +// Declare Buffers ... +#define trendBufferIndex 0 +#define upTrendBufferIndex 1 +#define downTrendBufferIndex 2 + +// +double trendBuffer[]; +double upTrendBuffer[]; +double downTrendBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XMTR"; + + // + // TREND ... + SetIndexLabel(trendBufferIndex, "Trend"); + SetIndexBuffer(trendBufferIndex, trendBuffer); + SetIndexStyle( + trendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // UP Trend ... + SetIndexLabel(upTrendBufferIndex, "Up Trend"); + SetIndexBuffer(upTrendBufferIndex, upTrendBuffer); + SetIndexStyle( + upTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // DOWN Trend ... + SetIndexLabel(downTrendBufferIndex, "Down Trend"); + SetIndexBuffer(downTrendBufferIndex, downTrendBuffer); + SetIndexStyle( + downTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers( + i, + low + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index, + const double &low[] +) { + // + double atr = GetMarketTRSMA( + bar_index, + atrLength + ); + + // + double smoothedAtr = (atr * atrMultiplier); + double upTrend = low[bar_index] - smoothedAtr; + double downTrend = low[bar_index] + smoothedAtr; + + // + double cciValue = GetMarketCCI( + bar_index, + marketLength, + source + ); + + // + // TODO: Complete this ... +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/14020425/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/14020425/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.cci.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.cci.signal.lib.mq4 new file mode 100644 index 0000000..c572f3d --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.cci.signal.lib.mq4 @@ -0,0 +1,472 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 CCI Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Based Signal Conditions ... +struct XCCILongSignalConditions { + // + datetime start; + + // + datetime crossOverMinusHundredTime; + datetime crossUnderMinusHundredTime; + + // + double crossOverSlope; +}; + +// +static XCCILongSignalConditions cciLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Signal Conditions ... +void CheckCCILongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 10 +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // LONG: + // wait for cci cross under -100 + // then wait for cross over -100 + // slope of crossing over ??? ... + if (cciLongConds.start == 0) { + // LogMessage("Start"); + cciLongConds.start = barTime; + return; + } + + // + // Check Start Time ... + if (cciLongConds.start == 0) { + return; + } + + // + // Read current, prev, and prevPrev CCI ... + double cci = GetMarketCCI( + bar_index, + marketLen + ); + double cci1 = GetMarketCCI( + bar_index + 1, + marketLen + ); + double cci2 = GetMarketCCI( + bar_index + 2, + marketLen + ); + + // + // Find Cross Under -100 ... + bool isCrossUnderMinusHundred = + cci < -105 && !(cci1 < -105) + && MathAbs(MathAbs(cci) - MathAbs(cci1)) > smoother + ; + + // + // Find Cross Over -100 ... + bool isCrossOverMinusHundred = + cci > -105 && !(cci1 > -105) + && MathAbs(cci - cci1) > smoother + ; + + // + // Fill Conditions ... + if ( + isCrossUnderMinusHundred + && cciLongConds.crossUnderMinusHundredTime == 0 + && cciLongConds.crossOverMinusHundredTime == 0 + ) { + // LogMessage("Cross Under ..."); + cciLongConds.crossUnderMinusHundredTime = barTime; + return; + } + + // + // Fill Conditions ... + if ( + isCrossOverMinusHundred + && cciLongConds.crossOverMinusHundredTime == 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + ) { + // + // LogMessage("Cross Over ..."); + cciLongConds.crossOverMinusHundredTime = barTime; + } + + // + // Prevent Going forward untill Cross Under Happens ... + if (cciLongConds.crossUnderMinusHundredTime == 0) { + return; + } + + // + // Prevent from Going forward untill Cross Over Happens ... + if (cciLongConds.crossOverMinusHundredTime == 0) { + return; + } + + // + // Calculate Slope ... + double x1 = 0; + double y1 = cci1; + double x2 = 1; + double y2 = cci; + + // + // Calculat Line Slope ... + double tSlope = GetSlope( + x1, y1, x2, y2 + ); + + // + cciLongConds.crossOverSlope = tSlope; + // LogMessage("Slope: " + tSlope); +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateCCILongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateCCILongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + int llIdx = GetLowestLowOFCCILongPeriodIndex(); + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + // GetLowestLowOFCCILongPeriod(); + + // + int hhIdx = GetHighestHighOfCCILongPeriodIndex(); + double hh = GetHighestHighOfCCILongPeriod(); + // GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_CCI_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_CCI_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateCCILongConditions() { + // + int crossUnderBarIndex = + cciLongConds.crossUnderMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ) + : -1 + ; + + // + int crossOverBarIndex = + cciLongConds.crossOverMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ) + : -1 + ; + + // + bool isConditionsFilled = + // + cciLongConds.start != 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + && cciLongConds.crossOverMinusHundredTime != 0 + && cciLongConds.crossUnderMinusHundredTime >= cciLongConds.start + && cciLongConds.crossOverMinusHundredTime > cciLongConds.crossUnderMinusHundredTime + ; + + // + bool isLogicPassed = + // + crossOverBarIndex > 0 + && crossUnderBarIndex > 0 + && crossUnderBarIndex > crossOverBarIndex + && (crossUnderBarIndex - crossOverBarIndex) >= 5 + ; + + // + bool result = + // + isConditionsFilled + && isLogicPassed + && cciLongConds.crossOverSlope > 0 + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearCCILongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearCCILongSignalConditions() { + // + cciLongConds.start = 0; + cciLongConds.crossOverSlope = 0; + cciLongConds.crossOverMinusHundredTime = 0; + cciLongConds.crossUnderMinusHundredTime = 0; +} + +// +int GetHighestHighOfCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iHighest( + _Symbol, + _Period, + MODE_HIGH, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetHighestHighOfCCILongPeriod() { + // + int index = GetHighestHighOfCCILongPeriodIndex(); + + // + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +int GetLowestLowOFCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iLowest( + _Symbol, + _Period, + MODE_LOW, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetLowestLowOFCCILongPeriod() { + // + int index = GetLowestLowOFCCILongPeriodIndex(); + + // + double result = iLow( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForCCILongSignals( + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + result = + // + true + // + // && states[1].mc.fast > states[1].mc.slow + // && MathAbs(states[1].mc.fast - states[1].mc.slow) > 100 * _Point + // && states[1].marketMiddleage > states[1].sc.fast + // && states[1].marketMiddleage > states[1].mc.fast + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..01424b5 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,941 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +static double zigZags[]; +// +// END Global Requirement Functions ... +// + +// +// START Indicator Reading Data ... +// +// +// START XMKT Data ... +// +XMKTState GetXMKT( + const int bar_index, + const int marketLen, + // + const bool showHighestHigh = true, + const bool showHighestLow = true, + const bool showHighestOpen = true, + const bool showHighestClose = true, + const bool showLowestHigh = true, + const bool showLowestLow = true, + const bool showLowestOpen = true, + const bool showLowestClose = true, + const color highestHighColor = clrDeepPink, + const color highestLowColor = clrDarkOrange, + const color highestOpenColor = clrDodgerBlue, + const color highestCloseColor = clrOrchid, + const color lowestHighColor = clrHotPink, + const color lowestLowColor = clrOrange, + const color lowestOpenColor = clrPowderBlue, + const color lowestCloseColor = clrMediumOrchid, + const ENUM_LINE_STYLE highestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT +) { + // + XMKTState result = {}; + + // + string xmktIndName = "x-saherelm.xmarket"; + + // + int highestHighBufferIndex = 0; + int highestLowBufferIndex = 1; + int highestOpenBufferIndex = 2; + int highestCloseBufferIndex = 3; + int lowestHighBufferIndex = 4; + int lowestLowBufferIndex = 5; + int lowestOpenBufferIndex = 6; + int lowestCloseBufferIndex = 7; + + // + // Highest High ... + double highestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.highestHigh = highestHigh; + + // + // Highest Low ... + double highestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.highestLow = highestLow; + + // + // Highest Open ... + double highestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.highestOpen = highestOpen; + + // + // Highest Close ... + double highestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.highestClose = highestClose; + + // + // Lowest High ... + double lowestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestHigh = lowestHigh; + + // + // Lowest Low ... + double lowestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestLow = lowestLow; + + // + // Lowest Open ... + double lowestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestOpen = lowestOpen; + + // + // Lowest Close ... + double lowestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestClose = lowestClose; + + // + return result; +} +// +// END XMKT Data ... +// + +// +// START XOSC Data ... +// +XCycleState GetXOSC( + const int bar_index, + const int marketLen, + // + const int fastMult, + const int slowMult, + // + const double fastMMul = 1.0, + const double slowMMul = 3.0 +) { + // + XCycleState result = {}; + + // + string oscIndName = "x-saherelm.osc"; + + // + // Prepare OSC Inputs ... + // + int fastLength = fastMult * marketLen; + int slowLength = slowMult * marketLen; + + // + // Fast ... + double fast = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 0, // Buffer Index ... + bar_index + ); + result.fast = fast; + + // + // Slow ... + double slow = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 1, // Buffer Index ... + bar_index + ); + result.slow = slow; + + // + return result; +} +// +// END XOSC Data ... +// + +// +// START XBND Data ... +// +XBndState GetXBND( + const int bar_index, + // + const int marketLen = 10, // Market Length ... + const int shift = 0, // MA Shift ... + const ENUM_MA_METHOD method = MODE_SMA // MA Method ... +) { + // + XBndState result = {}; + + // + double high = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_HIGH + ); + result.high = high; + + // + double open = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_OPEN + ); + result.open = open; + + // + double close = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_CLOSE + ); + result.close = close; + + // + double low = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_LOW + ); + result.low = low; + + // + return result; +} +// +// END XBND Data ... +// + +// +// START ZigZag Data ... +// +void PrepareZigZagState( + const int bar_index, + // + const int depth = 12, + const int deviation = 5, + const int backStep = 3 +) { + // + string zigzagIndName = "x-saherelm.zigzag"; + + // + ArrayFree(zigZags); + ArrayResize( + zigZags, + 3 + ); + + // + double zigZag = 0; + int index = 0; + int i = bar_index; + while (index < 3) { + // + zigZag = iCustom( + _Symbol, + _Period, + zigzagIndName, + // + // Inputs ... + depth, + deviation, + backStep, + // + 0, // Buffer Index ... + i + ); + + // + if (zigZag > 0) { + // + zigZags[index] = zigZag; + index++; + } + + // + i++; + } +} +// +// END ZigZag Data ... +// + +// +// START XMA Data ... +// +// +// Retrieve Short Cycle ... +XCycleState GetXMASC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Medium Cycle ... +XCycleState GetXMAMC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMALC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMANN( + const int bar_index, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = 10; + int slowLength = 50; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Middle ... +double GetXMAMM( + const int bar_index, + const int marketLen, + const double multiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_EMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_MEDIAN +) { + // + double result = 0; + + // + int length = (int)(marketLen * multiplier); + + // + double middle = iMA( + _Symbol, + _Period, + length, + shift, + method, + appliedPrice, + bar_index + ); + result = middle; + + // + return result; +} + +// +// Retrieve XMA Parabolic SAR ... +double GetXMAPSAR( + const int bar_index, + // + double stp = 0.02, + double mxm = 0.2 +) { + // + double result = 0; + + // + double pSar = iSAR( + _Symbol, + _Period, + stp, + mxm, + bar_index + ); + result = pSar; + + // + return result; +} + +// +XState GetXState( + const int bar_index, + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleFastMult, + const int shortCycleSlowMult, + const int mediumCycleFastMult, + const int mediumCycleSlowMult, + const int longCycleFastMult, + const int longCycleSlowMult +) { + // + XState result = {}; + + // + // Short Cycle ... + XCycleState sc = GetXMASC( + bar_index, + marketLen, + shortCycleFastMult, + shortCycleSlowMult + ); + result.sc = sc; + + // + // Medium Cycle ... + XCycleState mc = GetXMAMC( + bar_index, + marketLen, + mediumCycleFastMult, + mediumCycleSlowMult + ); + result.mc = mc; + + // + // Long Cycle ... + XCycleState lc = GetXMALC( + bar_index, + marketLen, + longCycleFastMult, + longCycleSlowMult + ); + result.lc = lc; + + // + // OSC ... + XCycleState osc = GetXOSC( + // + bar_index, + marketLen, + // + shortCycleFastMult, + shortCycleSlowMult + ); + result.osc = osc; + + // + // Parabolic SAR ... + double parabolicSAR = GetXMAPSAR( + bar_index, + stp, + mxm + ); + result.parabolicSAR = parabolicSAR; + + // + // Market Middleage ... + double marketMiddleage = GetXMAMM( + bar_index, + marketLen, + 1.5 + ); + result.marketMiddleage = marketMiddleage; + + // // + // int cciMarketLength = longCycleSlowMult * marketLen; + // double cci = GetMarketCCI( + // bar_index, + // cciMarketLength + // ); + // result.cci = cci; + + // + XBndState bnd = GetXBND( + bar_index + ); + result.bnd = bnd; + + // + XMKTState mkt = GetXMKT( + bar_index, + marketLen + ); + result.mkt = mkt; + + // + return result; +} +// +// END XMA Data ... +// +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..658c90a --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1502 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +static datetime lastBarTime; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..d068d53 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,222 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_OSC_PROVIDER, + X_CCI_PROVIDER, + X_SHP_PROVIDER, + X_XMA_PROVIDER, + X_RMA_PROVIDER, + X_XXX_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XBndState { + double high; + double open; + double close; + double low; +}; + +// +struct XMKTState { + // + double highestHigh; + double highestLow; + double highestOpen; + double highestClose; + + // + double lowestHigh; + double lowestLow; + double lowestOpen; + double lowestClose; +}; + +// +struct XCycleState { + double fast; + double slow; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XState { + // + // SC ... + XCycleState sc; + + // + // MC ... + XCycleState mc; + + // + // LC ... + XCycleState lc; + + // + // OSC ... + XCycleState osc; + + // + // MIDDLEAGE ... + double marketMiddleage; + + // + // PARABOLIC-SAR ... + double parabolicSAR; + + // + double cci; + + // + XBndState bnd; + + // + XMKTState mkt; +}; + +// +// Parsed XMA Buffer ... +struct XStateInfo { + // + // Check Market Cross Exists or not ... + // + bool isSCFastCrossOverSlow; + bool isSCFastCrossUnderSlow; + + // + double scMin; + double scMax; + + // + bool isMCFastCrossOverSlow; + bool isMCFastCrossUnderSlow; + + // + double mcMin; + double mcMax; + + bool isLCFastCrossOverSlow; + bool isLCFastCrossUnderSlow; + + // + double lcMin; + double lcMax; + + // + bool isMMCrossOverSCFast; + bool isMMCrossUnderSCFast; + + // + bool isMMCrossOverMCFast; + bool isMMCrossUnderMCFast; + + // + double mmMin; + double mmMax; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..84f0386 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 OSC Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XOSCLongSignalConditions { + // + datetime crossOverTime; + double slowOnCrossOver; + + // + datetime crossUnderTime; + double slowOnCrossUnder; +}; + +// +static XOSCLongSignalConditions oscLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckOSCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[0].osc.fast < 0 + && !(states[1].osc.fast < 0) + ; + + // + bool isCrossOver = + states[0].osc.fast > 0 + && !(states[1].osc.fast > 0) + ; + + // + int oneTouches = 0; + int halfTouches = 0; + int minusOneTouches = 0; + for (int i = 0; i < marketLen - 1; i++) { + // + // One Touches ... + if ( + states[i].osc.fast > 1 + && !(states[i + 1].osc.fast > 1) + ) { + oneTouches++; + } + + // + // Half Touches ... + if ( + states[i].osc.fast > 0.5 + && !(states[i + 1].osc.fast > 0.5) + ) { + halfTouches++; + } + + // + // Minus One Touches ... + if ( + states[i].osc.fast < -1 + && !(states[i + 1].osc.fast < -1) + ) { + minusOneTouches++; + } + } + + // + if ( + isCrossUnder + && oscLongConds.crossUnderTime == 0 + ) { + // + oscLongConds.crossUnderTime = barTime; + oscLongConds.slowOnCrossUnder = states[0].osc.slow; + return; + } + + // + if ( + isCrossOver + && oscLongConds.crossUnderTime > 0 + && oscLongConds.crossOverTime == 0 + ) { + // + oscLongConds.crossOverTime = barTime; + oscLongConds.slowOnCrossOver = states[0].osc.slow; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateOSCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateOSCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_OSC_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_OSC_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateOSCLongConditions() { + // + bool isConditionsFilled = + oscLongConds.crossOverTime > 0 + && oscLongConds.crossUnderTime > 0 + && oscLongConds.slowOnCrossOver > 0 + && oscLongConds.slowOnCrossUnder > 0 + && oscLongConds.crossOverTime > oscLongConds.crossUnderTime + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossUnderTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossOverTime + ); + + // + isBLFilled = + crossUnderBarIndex > crossOverBarIndex + // && oscLongConds.slowOnCrossOver > oscLongConds.slowOnCrossUnder + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearOSCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearOSCLongSignalConditions() { + // + oscLongConds.crossOverTime = 0;; + oscLongConds.crossUnderTime = 0;; +} + +// +// Check State for Long Signals ... +bool IsReadyForOSCLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.rma.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.rma.signal.lib.mq4 new file mode 100644 index 0000000..4b9637a --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.rma.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 RMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// RMA Based Signal Conditions ... +struct XRMALongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XRMALongSignalConditions xrmaLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXRMALongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XCycleState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XCycleState state = GetXMANN(i); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].fast < states[1].slow + && !(states[2].fast < states[2].slow) + ; + + // + bool isCrossOver = + states[1].fast > states[1].slow + && !(states[2].fast > states[2].slow) + ; + + // + if ( + isCrossUnder + && xrmaLongConds.crossUnderTime == 0 + ) { + // + xrmaLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xrmaLongConds.crossUnderTime > 0 + && xrmaLongConds.crossOverTime == 0 + ) { + // + xrmaLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRMALongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXRMALongConditions(marketLen)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_RMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_RMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXRMALongConditions( + const int marketLen +) { + // + bool isConditionsFilled = + true + && xrmaLongConds.crossOverTime > 0 + && xrmaLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossUnderTime + ); + + // + XCycleState stateOnCrossUnder = GetXMANN( + crossUnderBarIndex + ); + + // + XCycleState stateOnCrossOver = GetXMANN( + crossOverBarIndex + ); + + // + double maC = iMA( + _Symbol, + _Period, + 14, + 0, + MODE_SMA, + PRICE_CLOSE, + crossOverBarIndex + ); + + // // + // double rmaOnCrossOver = GetRMA( + // crossOverBarIndex, + // 10 + // ); + + // // + // double rmaOnMarketLength = GetRMA( + // crossOverBarIndex + marketLen, + // 10 + // ); + + // // + // double prevCandleHigh = iHigh( + // _Symbol, + // _Period, + // crossOverBarIndex + // ); + + // // + // PrepareZigZagState(crossOverBarIndex); + // double zigZagDelta = zigZags[1] - zigZags[2]; + // bool isZigZagWaitForHigh = zigZagDelta < 0; + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xrmaLongConds.crossOverTime > xrmaLongConds.crossUnderTime + // + && stateOnCrossOver.slow < stateOnCrossUnder.slow + // + && MathAbs(stateOnCrossOver.fast - stateOnCrossOver.slow) > (70 * _Point) + // + && maC >= stateOnCrossOver.slow + // // + // && !(rmaOnCrossOver < stateOnCrossOver.slow) + // // + // && MathAbs(rmaOnCrossOver - rmaOnMarketLength) < (600 * _Point) + // // + // && !isZigZagWaitForHigh + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRMALongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRMALongSignalConditions() { + // + xrmaLongConds.crossOverTime = 0; + xrmaLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXRMALongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.shp.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.shp.signal.lib.mq4 new file mode 100644 index 0000000..dd0f767 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.shp.signal.lib.mq4 @@ -0,0 +1,391 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 SHP Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XSHPLongSignalConditions { + // + datetime start; + datetime stop; +}; + +// +static XSHPLongSignalConditions shpLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckSHPLongSignalConditions( + const int bar_index, + const int marketLen, + const double shpDetectMult, + const double smoother = 30 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double mHH = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double mLL = GetMarketLowestLow( + bar_index, + marketLen + ); + + double m2LL = GetMarketLowestLow( + bar_index, + marketLen * 2 + ); + + // + int mHLIdx = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + datetime mHLTime = iTime( + _Symbol, + _Period, + mHLIdx + ); + double mHL = iHigh( + _Symbol, + _Period, + mHLIdx + ); + + // + double hlDiff = (mHL - mLL); + double sharpDetectValue = shpDetectMult * _Point; + + // + bool isSharpDetected = + // ( + // low == mLL + // || MathAbs(mLL - low) < (smoother * _Point) + // ) + // && + // !( + // mLL > m2LL + // && MathAbs(m2LL - mLL) > sharpDetectValue / 2 + // ) + // && + ( + hlDiff > sharpDetectValue + || hlDiff > sharpDetectValue - (smoother * _Point) + ) + ; + + // + if (isSharpDetected) { + // + shpLongConds.start = mHLTime; + shpLongConds.stop = barTime; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateSHPLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMultiplier // Sharp Detect Multiplier ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateSHPLongConditions(shpDetectMultiplier)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // ll; + + // + // this means Market Lowest Low ... + double shpValue = shpDetectMultiplier * _Point; + if ( + reward == 0 + || reward < 20 * _Point + ) { + reward = shpValue; + } + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_SHP_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_SHP_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateSHPLongConditions( + const double shpDetectMultiplier +) { + // + double shpDetectValue = shpDetectMultiplier * _Point; + + // + bool isConditionsFilled = + shpLongConds.stop != 0 + && shpLongConds.start != 0 + && shpLongConds.stop > shpLongConds.start + ; + + // + bool isBLFilled = true; + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearSHPLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearSHPLongSignalConditions() { + // + shpLongConds.stop = 0; + shpLongConds.start = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForSHPLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + int xmaMarketLen = ArraySize(states); + double mHH = GetMarketHighestHigh(0, xmaMarketLen); + double m2HH = GetMarketHighestHigh(0, (int) (xmaMarketLen * 1.5)); + + // + int lcUpDownTouches = 0; + int cciHundredTouches = 0; + for (int i = 0; i < xmaMarketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + double up = MathMax(states[i].lc.fast, states[i].lc.slow); + double down = MathMax(states[i].lc.fast, states[i].lc.slow); + + // + if (high >= up && low <= down) { + lcUpDownTouches++; + } + + // + if ( + i < xmaMarketLen - 1 + && i < 10 + ) { + if ( + states[i].cci < 100 + && states[i + 1].cci > 100 + ) { + cciHundredTouches++; + } + } + } + + // + result = + // + true + // + && states[0].mc.fast > states[0].mc.slow + && states[0].lc.fast > states[0].lc.slow + // + && states[0].sc.fast < states[0].sc.slow + && states[1].sc.fast < states[1].sc.slow + // + && states[0].marketMiddleage < states[0].sc.fast + && states[1].marketMiddleage < states[1].sc.fast + && !( + states[1].sc.fast < states[1].mc.fast + && states[1].sc.slow < states[1].mc.fast + && states[1].sc.fast > states[1].mc.slow + && states[1].sc.slow > states[1].mc.slow + ) + && !( + states[0].marketMiddleage < states[0].mc.fast + && states[0].marketMiddleage > states[0].mc.slow + ) + // + && mHH != m2HH + && lcUpDownTouches == 0 + && cciHundredTouches == 0 + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..439d9ad --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1463 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia, + string provider = "" +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + provider + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + string provider = + // signal.provider == X_CCI_PROVIDER + // ? cciSignalId : + // signal.provider == X_SHP_PROVIDER + // ? shpSignalId : + // signal.provider == X_XMA_PROVIDER + // ? xmaSignalId : + // signal.provider == X_OSC_PROVIDER + // ? oscSignalId : + // signal.provider == X_RMA_PROVIDER + // ? rmaSignalId : + "" + ; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, + "_", provider, + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor, + provider + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", provider + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal( + // + // Define Signal Identifiers ... + const string cciSignalId, // Signal Identifier ... + const string shpSignalId, // Signal Identifier ... + const string xmaSignalId // Signal Identifier ... +) { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = + StringFind( + comment, + cciSignalId + ) ? + X_CCI_PROVIDER : + StringFind( + comment, + shpSignalId + ) ? + X_SHP_PROVIDER : + StringFind( + comment, + xmaSignalId + ) ? + X_XMA_PROVIDER : + X_UNKNOWN_PROVIDER + ; + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + const ENUM_X_SIGNAL_PROVIDER provider, + // + // Define Signal Identifiers ... + const string cciSignalId, // Signal Identifier ... + const string shpSignalId, // Signal Identifier ... + const string xmaSignalId // Signal Identifier ... +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal( + cciSignalId, + shpSignalId, + xmaSignalId + ); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + // + // ClearOSCLongSignalConditions(); + // ClearCCILongSignalConditions(); + // ClearSHPLongSignalConditions(); + // ClearXRMALongSignalConditions(); + // // + // ClearXMASCLongSignalConditions(); + // ClearXMAMCLongSignalConditions(); + // ClearXMAMMLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..d147bf1 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,592 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; +}; + +// +static XSignalConditions xLongConds; +static XSignalConditions xShortConds; + +// +static bool xWaitForLongSignals = true; +static bool xCloseLongTrades = false; + +// +static bool xWaitForShortSignals = true; +static bool xCloseShortTrades = false; + +// +bool isLastTrendUp = false; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // // + // bool isCrossUnder = + // states[1].osc.fast < states[1].osc.slow + // && !(states[2].osc.fast < states[2].osc.slow) + // ; + + // // + // bool isCrossOver = + // states[1].osc.fast > states[1].osc.slow + // && !(states[2].osc.fast > states[2].osc.slow) + // ; + + // + XOHCL pCandle = GetCandleModel(1); + + // + bool isTrendingUp = + pCandle.low > states[0].bnd.high + && pCandle.high > states[0].bnd.high; + + // + bool isTrendingDown = + pCandle.high < states[0].bnd.low + && pCandle.low < states[0].bnd.low; + + // + bool isCrossUnder = + isTrendingDown + && !isTrendingUp + ; + + // + bool isCrossOver = + isTrendingUp + && !isTrendingDown + ; + + // // + // if (isTrendingUp && !isTrendingDown) { + // isLastTrendUp = true; + // } else if (isTrendingDown && !isTrendingUp) { + // isLastTrendUp = false; + // } + + // + // if (isLastTrendUp) { + // + // LogMessage( + // StringConcatenate( + // "isLastTrendUp: ", isLastTrendUp + // ) + // ); + // } + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossUnder = + states[1].osc.fast < states[1].osc.slow + && !(states[2].osc.fast < states[2].osc.slow) + ; + + // + bool isCrossOver = + states[1].osc.fast > states[1].osc.slow + && !(states[2].osc.fast > states[2].osc.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const XState &states[], + // + const double smoother = 5 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double hh = + GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * r2r; // risk * r2r; // 300 * _Point; + // if (risk > (500 * _Point)) { + // reward = 300 * _Point; + // } + + // + double sl = 0; // ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = type; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XXX_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +bool ValidateXShortConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal, + const XState &states[], + const int marketLen, + // + double smoother = 100 +) { + // + bool result = false; + + // + bool isSCTrendUp = + states[1].sc.fast > states[1].sc.slow + && states[2].sc.fast > states[2].sc.slow; + + // // + // bool isSCTrendDown = + // states[1].sc.fast < states[1].sc.slow + // && states[2].sc.fast < states[2].sc.slow; + + // + bool isMCTrendUp = + states[1].mc.fast > states[1].mc.slow + && states[2].mc.fast > states[2].mc.slow; + + // // + // bool isMCTrendDown = + // states[1].mc.fast < states[1].mc.slow + // && states[2].mc.fast < states[2].mc.slow; + + // + bool isLCTrendUp = + states[1].lc.fast > states[1].lc.slow + && states[2].lc.fast > states[2].lc.slow; + + // // + // bool isLCTrendDown = + // states[1].lc.fast < states[1].lc.slow + // && states[2].lc.fast < states[2].lc.slow; + + // // + // bool isTrendingUp = + // pCandle.low > states[0].bnd.high + // && pCandle.high > states[0].bnd.high; + + // // + // bool isTrendingDown = + // pCandle.high < states[0].bnd.low + // && pCandle.low < states[0].bnd.low; + + // // + // if (isTrendingUp && !isTrendingDown) { + // isLastTrendUp = true; + // } else if (isTrendingDown && !isTrendingUp) { + // isLastTrendUp = false; + // } + + // // + // if (isLastTrendUp) { + // // + // LogMessage( + // StringConcatenate( + // "isLastTrendUp: ", isLastTrendUp + // ) + // ); + // } + + // + // XOHCL pCandle = GetCandleModel(1); + + // + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + true + // + && isSCTrendUp + && isMCTrendUp + && isLCTrendUp + // + && ( + ( + states[1].mc.slow < states[1].bnd.low + && states[1].mc.fast < MathMin(states[1].bnd.open, states[1].bnd.close) + ) || ( + states[1].lc.fast > states[1].bnd.low + && states[1].lc.fast > states[1].mc.fast + ) + ) + && MathAbs(states[1].mc.fast - states[1].bnd.low) > 50 * _Point + ; + } else if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.xma.mc.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.xma.mc.signal.lib.mq4 new file mode 100644 index 0000000..13b787e --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.xma.mc.signal.lib.mq4 @@ -0,0 +1,490 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMCLongSignalConditions { + // + datetime mcFastCrossUnderSlowTime; + double crossUnderMCFast; + double crossUnderMCSlow; + + // + datetime mcFastCrossOverSlowTime; + double crossOverMCFast; + double crossOverMCSlow; + + // + datetime mcFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMAMCLongSignalConditions xmaMCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState mcs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + mcs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState mc = GetXMAMC( + i, + marketLen, + mcFMult, + mcSMult + ); + mcs[index] = mc; + + // + index++; + } + + // + bool isMCFastCrossUnderSlow = + mcs[0].fast < mcs[0].slow + && !(mcs[1].fast <= mcs[1].slow) + ; + bool isMCFastCrossOverSlow = + mcs[0].fast > mcs[0].slow + && !(mcs[1].fast >= mcs[1].slow) + ; + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + ) { + // + ClearXMAMCLongSignalConditions(); + + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossOverSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime == 0 + ) { + // + xmaMCLongConds.crossOverMCFast = mcs[0].fast; + xmaMCLongConds.crossOverMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime > 0 + && mcs[0].fast > xmaMCLongConds.crossUnderMCSlow + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMult, + const double smoother = 50 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !ValidateXMAMCLongConditions( + marketLen, + shpDetectMult, + smoother + ) + ) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + 3 + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMCLongConditions( + const int marketLen, + const double shpDetectMult, + const double smoother = 50 +) { + // + bool isConditionsFilled = + xmaMCLongConds.crossOverMCSlow > 0 + && xmaMCLongConds.crossOverMCFast > 0 + && xmaMCLongConds.crossUnderMCFast > 0 + && xmaMCLongConds.crossUnderMCSlow > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime != 0 + && xmaMCLongConds.mcFastCrossUnderSlowTime != 0 + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime != 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastCrossUnderSlowTime + ); + + // + int crossOverAndBiggerBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime + ); + + // + int cycleMarketLen = MathMin( + MathAbs(crossUnderBarIndex - crossOverAndBiggerBarIndex), + marketLen * 2 + ); + double hh = GetMarketHighestHigh( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + double ll = GetMarketLowestLow( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + + // + double high = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + ); + double pcHigh = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + 1 + ); + + // + double diff = (hh - ll); + double shpValue = shpDetectMult * _Point; + + // + bool isPriceRegular = + // + true + // + && + ( + diff < shpValue + || diff < shpValue - (smoother * _Point) + ) + && + !( + high == hh + || pcHigh == hh + || MathAbs(hh - high) < (smoother * _Point) + || MathAbs(hh - pcHigh) < (smoother * _Point) + ) + ; + + // + // LogMessage("Price Regular: " + isPriceRegular); + + // + isBLFilled = + isPriceRegular + && xmaMCLongConds.mcFastCrossUnderSlowTime < xmaMCLongConds.mcFastCrossOverSlowTime + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime >= xmaMCLongConds.mcFastCrossUnderSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMCLongSignalConditions() { + // + xmaMCLongConds.mcFastCrossUnderSlowTime = 0; + xmaMCLongConds.crossUnderMCFast = 0; + xmaMCLongConds.crossUnderMCSlow = 0; + + // + xmaMCLongConds.mcFastCrossOverSlowTime = 0; + xmaMCLongConds.crossOverMCFast = 0; + xmaMCLongConds.crossOverMCSlow = 0; + + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + int countRangedCandles = 0; + bool isMarketRanging = false; + for (int i = 1; i < marketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + bool isRanging = + // + high > states[i].mc.fast + && high > states[i].mc.slow + // + && low < states[i].mc.fast + && low < states[i].mc.slow + ; + if (isRanging) { + countRangedCandles++; + } + } + + // + XStateInfo info = ParseXMAStates(states); + double mmSlope = GetSlope( + 1, + states[1].marketMiddleage, + 2, + states[0].marketMiddleage + ); + double mmSlope1 = GetSlope( + 1, + states[2].marketMiddleage, + 2, + states[1].marketMiddleage + ); + double mmSlopeDiff = mmSlope - mmSlope1; + + // + isMarketRanging = countRangedCandles > 0; + + // + result = + // + true + // + && mmSlope > 0 + && mmSlope1 > 0 + && mmSlopeDiff > 0 + && !isMarketRanging + && states[0].marketMiddleage < info.mmMax + ; + // if (result) { + // LogMessage("mmSlope: " + mmSlope + ", mmSlope1: " + mmSlope1 + ", Diff: " + mmSlopeDiff); + // } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.xma.mm.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.xma.mm.signal.lib.mq4 new file mode 100644 index 0000000..d883803 --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.xma.mm.signal.lib.mq4 @@ -0,0 +1,338 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMMLongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XMAMMLongSignalConditions xmaMMLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMMLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].marketMiddleage < states[1].sc.fast + && !(states[2].marketMiddleage < states[2].sc.fast) + ; + + // + bool isCrossOver = + states[1].marketMiddleage > states[1].sc.fast + && !(states[2].marketMiddleage > states[2].sc.fast) + ; + + // + if ( + isCrossUnder + && xmaMMLongConds.crossUnderTime == 0 + ) { + // + xmaMMLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xmaMMLongConds.crossUnderTime > 0 + && xmaMMLongConds.crossOverTime == 0 + ) { + // + xmaMMLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMMLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMAMMLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMMLongConditions() { + // + bool isConditionsFilled = + true + && xmaMMLongConds.crossOverTime > 0 + && xmaMMLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossUnderTime + ); + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xmaMMLongConds.crossOverTime > xmaMMLongConds.crossUnderTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMMLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMMLongSignalConditions() { + // + xmaMMLongConds.crossOverTime = 0; + xmaMMLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMMLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + // && states[0].parabolicSAR < states[0].marketMiddleage + // && !( + // states[0].parabolicSAR < states[0].mc.fast + // && states[0].parabolicSAR < states[0].mc.slow + // ) + // + // && states[0].mc.fast > states[0].mc.slow + // + // && MathAbs(states[0].mc.fast - states[0].mc.slow) > (150 * _Point) + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/Libraries/x-saherelm.xma.sc.signal.lib.mq4 b/Bkp/Used/14020425/Libraries/x-saherelm.xma.sc.signal.lib.mq4 new file mode 100644 index 0000000..218759c --- /dev/null +++ b/Bkp/Used/14020425/Libraries/x-saherelm.xma.sc.signal.lib.mq4 @@ -0,0 +1,360 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMASCLongSignalConditions { + // + datetime scFastCrossUnderSlowTime; + double crossUnderSCFast; + double crossUnderSCSlow; + + // + datetime scFastCrossOverSlowTime; + double crossOverSCFast; + double crossOverSCSlow; + + // + datetime scFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMASCLongSignalConditions xmaSCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMASCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState scs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + scs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState sc = GetXMASC( + i, + marketLen, + scFMult, + scSMult + ); + scs[index] = sc; + + // + index++; + } + + // + bool isSCFastCrossUnderSlow = + scs[0].fast < scs[0].slow + && !(scs[1].fast <= scs[1].slow) + ; + bool isSCFastCrossOverSlow = + scs[0].fast > scs[0].slow + && !(scs[1].fast >= scs[1].slow) + ; + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.crossUnderSCFast = scs[0].fast; + xmaSCLongConds.crossUnderSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossOverSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime == 0 + ) { + // + xmaSCLongConds.crossOverSCFast = scs[0].fast; + xmaSCLongConds.crossOverSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + && scs[0].fast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + ) { + // + ClearXMASCLongSignalConditions(); + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMASCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... + // + // const double shpDetectMultiplier +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMASCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // // + // double sharpDetectValue = shpDetectMultiplier * _Point; + // double lowPrice = iLow( + // _Symbol, + // _Period, + // bar_index + 1 + // ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMASCLongConditions() { + // + bool isConditionsFilled = + xmaSCLongConds.crossOverSCSlow > 0 + && xmaSCLongConds.crossOverSCFast > 0 + && xmaSCLongConds.crossUnderSCFast > 0 + && xmaSCLongConds.crossUnderSCSlow > 0 + && xmaSCLongConds.scFastCrossOverSlowTime != 0 + && xmaSCLongConds.scFastCrossUnderSlowTime != 0 + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime !=0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + xmaSCLongConds.crossOverSCFast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastCrossUnderSlowTime < xmaSCLongConds.scFastCrossOverSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMASCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMASCLongSignalConditions() { + // + xmaSCLongConds.crossUnderSCFast = 0; + xmaSCLongConds.crossUnderSCSlow = 0; + xmaSCLongConds.scFastCrossUnderSlowTime = 0; + + // + xmaSCLongConds.crossOverSCFast = 0; + xmaSCLongConds.crossOverSCSlow = 0; + xmaSCLongConds.scFastCrossOverSlowTime = 0; + + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMASCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + && states[0].sc.fast > states[0].sc.slow + && states[1].sc.fast > states[1].sc.slow + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020425/x-saherelm.ea.mq4 b/Bkp/Used/14020425/x-saherelm.ea.mq4 new file mode 100644 index 0000000..4e5ea07 --- /dev/null +++ b/Bkp/Used/14020425/x-saherelm.ea.mq4 @@ -0,0 +1,1130 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// // +// input bool useCCISignalling = false; // Use XCCI Signalling +// input string cciSignalIdentifier = "XCCI"; // XCCI Signal Identifier + +// // +// input bool useOSCSignalling = false; // Use XOSC Signalling +// input string oscSignalIdentifier = "XOSC"; // XOSC Signal Identifier + +// // +// input bool useSHPSignalling = false; // Use XSHP Signalling +// input string shpSignalIdentifier = "XSHP"; // XSHP Signal Identifier + +// // +// input bool useRMASignalling = false; // Use RMA Signalling +// input string rmaSignalIdentifier = "XRMA"; // XRMA Signal Identifier + +// // +// input bool useXMASCSignalling = false; // Use XMA SC Signalling +// input bool useXMAMCSignalling = false; // Use XMA MC Signalling +// input bool useXMAMMSignalling = false; // Use XMA MM Signalling +// input string xmaSignalIdentifier = "XMA"; // XMA MM Signal Identifier + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio +// input double maxTPMultiplier = 1000; // Max Allowed TP + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.01; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 504; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// Indicators ... +// +// CCI Inputs ... +input double step = 0.01; // SAR Step +input double maximum = 0.1; // SAR Maximum + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier + +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 800; // Sharp Detect Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// bool waitForXMAMMLongSignal = true; +// bool waitForXMAMCLongSignal = true; +// bool waitForXMASCLongSignal = true; +// bool waitForOSCLongSignal = true; +// bool waitForSHPLongSignal = true; +// bool waitForCCILongSignal = true; +// bool waitForRMALongSignal = true; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + ClearSignalConditions(); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // + // Prevent from Checking, if there is no states available ... + // if (ArraySize(mStates) == 0) { + // return; + // } + + // // + // // XMA MM Long ... + // if (waitForXMAMMLongSignal) { + // } else { + // } + + // // + // // XMA MC Long ... + // if (waitForXMAMCLongSignal) { + // } else { + // } + + // // + // // OSC Long ... + // if (waitForOSCLongSignal) { + // } else { + // } + + // // + // // SHP Long ... + // if (waitForSHPLongSignal) { + // } else { + // } + + // // + // // CCI Long ... + // if (waitForCCILongSignal) { + // } else { + // } + + // // + // closeLongTrades = + // xmaStates[0].parabolicSAR > xmaStates[0].marketMiddleage + // && !(xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage) + // ; + + // // + // closeLongTrades = + // false + // ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < longCycleSlowMultiplier * marketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + // , + // // + // cciSignalIdentifier, + // shpSignalIdentifier, + // xmaSignalIdentifier, + // oscSignalIdentifier, + // rmaSignalIdentifier + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + // waitForLongSignals = false; + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + // waitForShortSignals = false; + } + } + + // // + // bool closeAllXMALongTrades = CloseAllXMALongTrades( + // mStates + // ); + // if (closeAllXMALongTrades) { + // CloseAllProviderLongTrades( + // X_XMA_PROVIDER, + // // + // cciSignalIdentifier, + // shpSignalIdentifier, + // xmaSignalIdentifier + // ); + // } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + // waitForShortSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Retrieve XMA States ... + // based on medium cycle slow ... + XState states[]; + // int xmaMarketSize = 2 * marketLength; + ArrayFree(states); + ArrayResize( + states, + marketLength + ); + + // + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + states[index] = GetXState( + i, + marketLength, + // + step, + maximum, + // + shortCycleFastMultiplier, + shortCycleSlowMultiplier, + mediumCycleFastMultiplier, + mediumCycleSlowMultiplier, + longCycleFastMultiplier, + longCycleSlowMultiplier + ); + + // + index++; + } + + // // + // // Check if Use CCI Signalling true ... + // if (useCCISignalling) { + // // + // int cciMarketLength = longCycleSlowMultiplier * marketLength; + + // // + // if (waitForOSCLongSignal) { + // // + // CheckCCILongSignalConditions( + // bar_index + 1, + // cciMarketLength + // ); + + // // + // XSignalRequest cciLongSignalRequest = GenerateCCILongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio + // ); + + // // + // if (cciLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForCCILongSignals(mStates); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = cciLongSignalRequest.signal; + // } else { + // // LogMessage("CCi Has Long Signal, but XMA not Verify ..."); + // ClearCCILongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useSHPSignalling) { + // // + // if (waitForSHPLongSignal) { + // CheckSHPLongSignalConditions( + // bar_index, + // marketLength, + // sharpDetectMultiplier + // ); + + // // + // XSignalRequest shpLongSignalRequest = GenerateSHPLongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio, + // sharpDetectMultiplier + // ); + + // // + // if (shpLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForSHPLongSignals( + // shpLongSignalRequest.signal, + // mStates + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = shpLongSignalRequest.signal; + // } else { + // // LogMessage("SHP Has Long Signal, but XMA not Verify ..."); + // ClearSHPLongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useOSCSignalling) { + // // + // if (waitForOSCLongSignal) { + // // + // CheckOSCLongSignalConditions( + // bar_index, + // marketLength, + // step, + // maximum, + // shortCycleFastMultiplier, + // shortCycleSlowMultiplier, + // mediumCycleFastMultiplier, + // mediumCycleSlowMultiplier, + // longCycleFastMultiplier, + // longCycleSlowMultiplier + // ); + + // // + // XSignalRequest oscLongSignalRequest = GenerateOSCLongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio + // ); + + // // + // if (oscLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForOSCLongSignals( + // oscLongSignalRequest.signal, + // mStates + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = oscLongSignalRequest.signal; + // } else { + // ClearOSCLongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useRMASignalling) { + // // + // if (waitForRMALongSignal) { + // // + // CheckXRMALongSignalConditions( + // bar_index, + // marketLength + // ); + + // // + // XSignalRequest rmaLongSignalRequest = GenerateXRMALongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio + // ); + + // // + // if (rmaLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForXRMALongSignals( + // rmaLongSignalRequest.signal, + // mStates, + // marketLength + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = rmaLongSignalRequest.signal; + // } else { + // ClearXRMALongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useXMASCSignalling) { + // // + // if (waitForXMASCLongSignal) { + // // + // CheckXMASCLongSignalConditions( + // bar_index, + // marketLength, + // step, + // maximum, + // shortCycleFastMultiplier, + // shortCycleSlowMultiplier, + // mediumCycleFastMultiplier, + // mediumCycleSlowMultiplier + // ); + + // // + // XSignalRequest xmaLongSignalRequest = GenerateXMASCLongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio + // ); + + // // + // if (xmaLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForXMASCLongSignals( + // xmaLongSignalRequest.signal, + // mStates, + // marketLength + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = xmaLongSignalRequest.signal; + // } else { + // ClearXMASCLongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useXMAMCSignalling) { + // // + // if (waitForXMAMCLongSignal) { + // // + // CheckXMAMCLongSignalConditions( + // bar_index, + // marketLength, + // step, + // maximum, + // shortCycleFastMultiplier, + // shortCycleSlowMultiplier, + // mediumCycleFastMultiplier, + // mediumCycleSlowMultiplier + // ); + + // // + // XSignalRequest xmaLongSignalRequest = GenerateXMAMCLongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio, + // sharpDetectMultiplier + // ); + + // // + // if (xmaLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForXMAMCLongSignals( + // xmaLongSignalRequest.signal, + // mStates, + // marketLength + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = xmaLongSignalRequest.signal; + // } else { + // ClearXMAMCLongSignalConditions(); + // } + // } + // } + // } + + // // + // if (useXMAMMSignalling) { + // // + // if (waitForXMAMMLongSignal) { + // // + // CheckXMAMMLongSignalConditions( + // bar_index, + // marketLength, + // step, + // maximum, + // shortCycleFastMultiplier, + // shortCycleSlowMultiplier, + // mediumCycleFastMultiplier, + // mediumCycleSlowMultiplier, + // longCycleFastMultiplier, + // longCycleSlowMultiplier + // ); + + // // + // XSignalRequest xmaLongSignalRequest = GenerateXMAMMLongSignal( + // bar_index, + // marketLength, + // riskToRewardRatio + // ); + + // // + // if (xmaLongSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On XMA State ... + // bool isReady = IsReadyForXMAMMLongSignals( + // xmaLongSignalRequest.signal, + // mStates, + // marketLength + // ); + + // // + // if (isReady) { + // // + // hasLongSignal = true; + // signal = xmaLongSignalRequest.signal; + // } else { + // ClearXMAMMLongSignalConditions(); + // } + // } + // } + // } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + if (hasLongSignal) { + // // + // // Check TP and Fix it if it's too high ... + // double maxAllowedTP = signal.entry + (maxTPMultiplier * _Point); + // if (signal.tp > maxAllowedTP) { + // signal.tp = maxAllowedTP; + // } + + // // + // bool increaseTP = + // mStates[1].sc.fast < mStates[1].sc.slow + // && mStates[1].mc.fast < mStates[1].mc.slow + // ; + // if (increaseTP) { + // signal.tp = signal.entry + ((signal.tp - signal.entry) / 3); + // } + + // // + // bool decreaseTP = false; + // if (decreaseTP) { + // signal.tp = maxAllowedTP; + // } + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020425/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020425/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..19fef2b --- /dev/null +++ b/Bkp/Used/14020425/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1478 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +// #include "../Libraries/x-saherelm.osc.signal.lib.mq4" +// #include "../Libraries/x-saherelm.cci.signal.lib.mq4" +// #include "../Libraries/x-saherelm.shp.signal.lib.mq4" +// #include "../Libraries/x-saherelm.rma.signal.lib.mq4" +// #include "../Libraries/x-saherelm.xma.mm.signal.lib.mq4" +// #include "../Libraries/x-saherelm.xma.sc.signal.lib.mq4" +// #include "../Libraries/x-saherelm.xma.mc.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia, + string provider = "" +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + provider + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor + // , + // + // Define Signal Identifiers ... + // const string cciSignalId, // Signal Identifier ... + // const string shpSignalId, // Signal Identifier ... + // const string xmaSignalId, // Signal Identifier ... + // const string oscSignalId, // Signal Identifier ... + // const string rmaSignalId // Signal Identifier ... +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + string provider = + // signal.provider == X_CCI_PROVIDER + // ? cciSignalId : + // signal.provider == X_SHP_PROVIDER + // ? shpSignalId : + // signal.provider == X_XMA_PROVIDER + // ? xmaSignalId : + // signal.provider == X_OSC_PROVIDER + // ? oscSignalId : + // signal.provider == X_RMA_PROVIDER + // ? rmaSignalId : + "" + ; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, + "_", provider, + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor, + provider + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", provider + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal( + // + // Define Signal Identifiers ... + const string cciSignalId, // Signal Identifier ... + const string shpSignalId, // Signal Identifier ... + const string xmaSignalId // Signal Identifier ... +) { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = + StringFind( + comment, + cciSignalId + ) ? + X_CCI_PROVIDER : + StringFind( + comment, + shpSignalId + ) ? + X_SHP_PROVIDER : + StringFind( + comment, + xmaSignalId + ) ? + X_XMA_PROVIDER : + X_UNKNOWN_PROVIDER + ; + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + const ENUM_X_SIGNAL_PROVIDER provider, + // + // Define Signal Identifiers ... + const string cciSignalId, // Signal Identifier ... + const string shpSignalId, // Signal Identifier ... + const string xmaSignalId // Signal Identifier ... +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal( + cciSignalId, + shpSignalId, + xmaSignalId + ); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + // + // ClearOSCLongSignalConditions(); + // ClearCCILongSignalConditions(); + // ClearSHPLongSignalConditions(); + // ClearXRMALongSignalConditions(); + // // + // ClearXMASCLongSignalConditions(); + // ClearXMAMCLongSignalConditions(); + // ClearXMAMMLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020428/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020428/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..7c8692f --- /dev/null +++ b/Bkp/Used/14020428/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,790 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio +// input double maxTPMultiplier = 1000; // Max Allowed TP + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.05; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 408; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// Indicators ... +// +// CCI Inputs ... +input double step = 0.01; // SAR Step +input double maximum = 0.1; // SAR Maximum + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 2; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 6; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 12; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 36; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 72; // Long Cycle Slow Multiplier + +// +// SHPD Indicator ... +input double sharpDetectMultiplier = 800; // Sharp Detect Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + ClearSignalConditions(); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day: ", TimeCurrent() + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... + + // // + // closeLongTrades = xCloseLongTrades; + // waitForLongSignals = xWaitForLongSignals; + + // // + // closeShortTrades = xCloseShortTrades; + // waitForShortSignals = xWaitForShortSignals; + + // // + // xCloseLongTrades = false; + // xCloseShortTrades = false; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < longCycleSlowMultiplier * marketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + } + } + + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Retrieve XMA States ... + // based on medium cycle slow ... + XState states[]; + ArrayFree(states); + ArrayResize( + states, + marketLength + ); + + // + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + states[index] = GetXState( + i, + marketLength, + // + step, + maximum, + // + shortCycleFastMultiplier, + shortCycleSlowMultiplier, + mediumCycleFastMultiplier, + mediumCycleSlowMultiplier, + longCycleFastMultiplier, + longCycleSlowMultiplier + ); + + // + index++; + } + + // + CheckXLongSignalConditions( + bar_index, + marketLength, + states + ); + + // + CheckXShortSignalConditions( + bar_index, + marketLength, + states + ); + + // + XSignalRequest xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + XSignalRequest xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + bar_index, + marketLength, + riskToRewardRatio, + states + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } else if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal, + states, + marketLength + ); + + // + if (isReady) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020428/Indicators/ROCv2.2.mq4 b/Bkp/Used/14020428/Indicators/ROCv2.2.mq4 new file mode 100644 index 0000000..5308449 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/ROCv2.2.mq4 @@ -0,0 +1,335 @@ +//+------------------------------------------------------------------+ +//| ROCv2.1.mq4 | +//| Copyright 2015, mrak297. | +//| https://www.mql5.com/ru/users/mrak297 | +//+------------------------------------------------------------------+ +#property copyright "Copyright 2015, mrak297." +#property link "https://www.mql5.com/ru/users/mrak297" +#property version "2.1" +#property strict +#property indicator_separate_window +//--- input parameters +input string Pairs="USDJPY,AUDUSD,EURJPY,EURCHF,EURGBP,EURUSD,GBPUSD,USDCHF,USDCAD"; +input ENUM_TIMEFRAMES TimeFrame=PERIOD_D1;//Period for calculating +input ENUM_TIMEFRAMES Per = PERIOD_M15; //Period for new opened charts +input color UPcolor = clrLimeGreen; //Color when moved up +input color DownColor = clrTomato; //Color when moved down +input int PSize = 6; // Pair string size including pre- & suffix +input bool InverseUSD = false; // Invert USDXXX pairs to XXXUSD +//--- +int Size=10; //Font size +string Font= "Arial Black"; +int BGcolor; //Bars background color +int cF = 100; //Coefficient of scale +int num,Zero,Wbar,Hbar,Xsize,Ysize; +string PairsArray[]; //Array for Pairs Name +double ChangeArray[]; //Array for Pairs Change +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +int OnInit() + { + EventSetMillisecondTimer(250); +//--- + IndicatorShortName("Rate Of Change ("+PeriodToString(TimeFrame)+")"); + IndicatorSetDouble(INDICATOR_MAXIMUM,1); + IndicatorSetDouble(INDICATOR_MINIMUM,-1); +//--- + BGcolor=(int)ChartGetInteger(0,CHART_COLOR_BACKGROUND); +//--- + ushort sep=StringGetCharacter(Pairs,PSize); + num=StringSplit(Pairs,sep,PairsArray); +//--- + ArrayResize(ChangeArray,num,num); +//--- + Xsize = (int)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS,1); + Ysize = (int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,1); +//--- + Zero=(int)MathRound(ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,1)/2); +//--- + Wbar=(int)MathRound((Xsize-15)/num); +//--- + if(MathRound(Wbar/5)MathAbs(ChangeArray[min])) tmp=ChangeArray[max]; + else tmp=MathAbs(ChangeArray[min]); +//--- + if(tmp*cF>Ysize/2) cF--; + if((Ysize/2-tmp*cF)>20) cF++; + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +void OnChartEvent(const int id, + const long &lparam, + const double &dparam, + const string &sparam) + { + if(id==CHARTEVENT_OBJECT_CLICK) + { + string name=StringSubstr(sparam,0,6); + ChartOpen(name,Per); + } + if(id==CHARTEVENT_CHART_CHANGE) OnInit(); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +double SymbolChange(string symbol,ENUM_TIMEFRAMES period) + { + SymbolSelect(symbol,true); + double perf = 0; + double open = iOpen(symbol, period, 0); + double close = iClose(symbol, period, 0); +//--- + if(open!=0) + { + perf=(close-open); + perf /= open; + perf *= 100; + } + else Print("Change NaN"); +//--- + return(NormalizeDouble(perf, 2)); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +double SymbolChange2(string symbol,ENUM_TIMEFRAMES period) + { + SymbolSelect(symbol,true); + double perf = 0; + double open = iOpen(symbol, period, 0); + double close = iClose(symbol, period, 0); +//--- + if(open!=0) + { + perf=(open-close); + perf /= open; + perf *= 100; + } + else Print("Change NaN"); +//--- + return(NormalizeDouble(perf, 2)); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +void CreateTextLabel(string name,int x,int y,string text,ENUM_ANCHOR_POINT anchor) + { + ObjectDelete(0,name); + ResetLastError(); +//--- + if(ObjectCreate(0,name,OBJ_LABEL,1,0,0)) + { + ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x); + ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y); + ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER); + ObjectSetString(0,name,OBJPROP_TEXT,text); + ObjectSetString(0,name,OBJPROP_FONT,Font); + ObjectSetInteger(0,name,OBJPROP_FONTSIZE,Size); + ObjectSetDouble(0,name,OBJPROP_ANGLE,0.0); + ObjectSetInteger(0,name,OBJPROP_ANCHOR,anchor); + ObjectSetInteger(0,name,OBJPROP_COLOR,clrBlue); + ObjectSetInteger(0,name,OBJPROP_BACK,false); + ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false); + ObjectSetInteger(0,name,OBJPROP_HIDDEN,true); + ObjectSetInteger(0,name,OBJPROP_ZORDER,1); + ObjectSetString(0,name,OBJPROP_TOOLTIP,"\n"); + } + else Print("ERROR Creating object.",GetLastError()); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +void CreateRecLabel(string name,int x,int y,int xsize,int ysize) + { + ObjectDelete(0,name); + ResetLastError(); +//--- + if(ObjectCreate(0,name,OBJ_RECTANGLE_LABEL,1,0,0)) + { + ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x); + ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y); + ObjectSetInteger(0,name,OBJPROP_XSIZE,xsize); + ObjectSetInteger(0,name,OBJPROP_YSIZE,ysize); + ObjectSetInteger(0,name,OBJPROP_BGCOLOR,BGcolor); + ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT); + ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_UPPER); + ObjectSetInteger(0,name,OBJPROP_COLOR,clrDodgerBlue); + ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID); + ObjectSetInteger(0,name,OBJPROP_WIDTH,1); + ObjectSetInteger(0,name,OBJPROP_BACK,false); + ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false); + ObjectSetInteger(0,name,OBJPROP_HIDDEN,true); + ObjectSetInteger(0,name,OBJPROP_ZORDER,0); + ObjectSetString(0,name,OBJPROP_TOOLTIP,"\n"); + } + else Print("ERROR Creating object.",GetLastError()); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +int PixToPoints(int pix) + { + int pt=0; + int ems[28][2]= + { + 6,8,7,9,7,10,8,11,9,12,10,13,10,14,11,15,12,16,13,17,13,18,14,19,14,20,15,21,16,22, + 17,23,18,24,20,26,22,29,24,32,26,35,27,36,28,37,29,38,30,40,32,42,34,45,36,48 + }; +//--- + if(pix<8) + return(6); + if(pix>48) + return(36); +//--- + for(int i=0; i<28; i++) + { + if(pix==ems[i][1]) + { + pt=ems[i][0]; + break; + } + } + return(pt); + } +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +string PeriodToString(ENUM_TIMEFRAMES tframe) + { + string result=" "; + string PeriodArray[9][2]= + { + "M1","1", + "M5","5", + "M15","15", + "M30","30", + "H1","60", + "H4","240", + "D1","1440", + "W1","10080", + "MN1","43200" + }; + for(int i=0; i<9; i++) + { + if((string)tframe==PeriodArray[i][1]) + { + result=PeriodArray[i][0]; + break; + } + } + return(result); + } +//+--------------------------------------------------------------------+ diff --git a/Bkp/Used/14020428/Indicators/roc2.mq4 b/Bkp/Used/14020428/Indicators/roc2.mq4 new file mode 100644 index 0000000..2f025b0 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/roc2.mq4 @@ -0,0 +1,62 @@ +#property copyright "www.forex-station.com" +#property link "www.forex-station.com" +//---- indicator settings +#property indicator_separate_window +#property indicator_buffers 1 +#property indicator_color1 Red +//---- indicator parameters +extern int RPeriod = 10; +extern bool UsePercent = false; +//---- indicator buffers +double RateOfChange[]; +//+------------------------------------------------------------------+ +//| Custom indicator initialization function | +//+------------------------------------------------------------------+ +int init() + { +//---- drawing settings + SetIndexStyle(0, DRAW_LINE); + SetIndexDrawBegin(0, RPeriod); + IndicatorDigits(Digits + 1); +//---- indicator buffers mapping + if(!SetIndexBuffer(0, RateOfChange)) + Print("cannot set indicator buffers!"); +//---- name for DataWindow and indicator subwindow label + IndicatorShortName("ROC(" + RPeriod + ")"); +//---- initialization done + return(0); + } +//+------------------------------------------------------------------+ +//| Moving Averages Convergence/Divergence | +//+------------------------------------------------------------------+ +int start() + { + int limit; + double ROC, CurrentClose, PrevClose; + int counted_bars = IndicatorCounted(); +//---- check for possible errors + if(counted_bars < 0) + return(-1); +//---- last counted bar will be recounted + if(counted_bars > 0) + counted_bars--; + limit = MathMin(Bars - counted_bars,Bars-1); +//---- ROC calculation + for(int i = 0; i < limit; i++) + { + CurrentClose = iClose(NULL, 0, i); + PrevClose = iClose(NULL, 0, i + RPeriod); + ROC = CurrentClose - PrevClose; + //---- + if(UsePercent) + { + if(PrevClose != 0) + RateOfChange[i] = 100 * ROC / PrevClose; + } + else + RateOfChange[i] = ROC; + } +//---- done + return(0); + } +//+------------------------------------------------------------------+ \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/roc_smoothed.mq4 b/Bkp/Used/14020428/Indicators/roc_smoothed.mq4 new file mode 100644 index 0000000..da2e3bf --- /dev/null +++ b/Bkp/Used/14020428/Indicators/roc_smoothed.mq4 @@ -0,0 +1,190 @@ +#property copyright "www.forex-station.com" +#property link "www.forex-station.com" +//---- indicator settings +#property indicator_separate_window +#property indicator_buffers 1 +#property indicator_color1 Red +//---- indicator parameters +extern string strROC = "ROC Period for lookback"; +extern int RPeriod = 10; +extern string sep0 = "----------------------------------"; +extern string strMA = "MA input parameters"; +extern int MAPeriod=14; +extern string sep1 = "----------------------------------"; +extern string strType = "Moving Average Types" ; +extern string str0 = "0 = SMA, 1 = EMA, 2 = SMMA"; +extern string str1 = "3 = LWMA, 4 = LSMA, 5 = NLMA"; +extern int MAType = 1; +extern string sep2 = "----------------------------------"; +extern string strAP = "Applied Price Types"; +extern string str2 = "0=close, 1=open, 2=high"; +extern string str3 = "3=low, 4=median(high+low)/2"; +extern string str4 = " 5=typical(high+low+close)/3"; +extern string str5 = "6=weighted(high+low+close+close)/4"; +extern int MAAppliedPrice = 0; +extern string sep3 = "----------------------------------"; +extern string str6 = "NonLagMA Deviation"; +extern double Deviation = 0; +extern bool UsePercent = false; + +//---- indicator buffers +double RateOfChange[]; + +//---- variables + +int MAMode; +string strMAType; + +// Variables for NonLag +int Phase; +double Len; +double Cycle = 4; +double pi = 3.1415926535; +//+------------------------------------------------------------------+ +//| Custom indicator initialization function | +//+------------------------------------------------------------------+ +int init() + { +//---- drawing settings + SetIndexStyle(0,DRAW_LINE); + SetIndexDrawBegin(0,RPeriod); + IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1); +//---- indicator buffers mapping + if(!SetIndexBuffer(0,RateOfChange)) + Print("cannot set indicator buffers!"); +switch (MAType) + { + case 1: strMAType="EMA"; MAMode=MODE_EMA; break; + case 2: strMAType="SMMA"; MAMode=MODE_SMMA; break; + case 3: strMAType="LWMA"; MAMode=MODE_LWMA; break; + case 4: strMAType="LSMA"; break; + case 5: strMAType="NLMA";break; + default: strMAType="SMA"; MAMode=MODE_SMA; break; + } + IndicatorShortName( "ROC (" + RPeriod + ")_Smoothed_" + strMAType+ " (" +MAPeriod + ") "); +//---- name for DataWindow and indicator subwindow label + SetIndexLabel(0,"ROC_Smoothed"); + +// Variables for NonLag + Phase = MAPeriod-1; + Len = MAPeriod*Cycle + Phase; + +//---- initialization done + return(0); + } + +//+------------------------------------------------------------------+ +//| LSMA with PriceMode | +//| PrMode 0=close, 1=open, 2=high, 3=low, 4=median(high+low)/2, | +//| 5=typical(high+low+close)/3, 6=weighted(high+low+close+close)/4 | +//+------------------------------------------------------------------+ + +double LSMA(int Rperiod, int prMode, int shift) +{ + int i; + double sum, pr; + int length; + double lengthvar; + double tmp; + double wt; + + length = Rperiod; + + sum = 0; + for(i = length; i >= 1 ; i--) + { + lengthvar = length + 1; + lengthvar /= 3; + tmp = 0; + switch (prMode) + { + case 0: pr = Close[length-i+shift];break; + case 1: pr = Open[length-i+shift];break; + case 2: pr = High[length-i+shift];break; + case 3: pr = Low[length-i+shift];break; + case 4: pr = (High[length-i+shift] + Low[length-i+shift])/2;break; + case 5: pr = (High[length-i+shift] + Low[length-i+shift] + Close[length-i+shift])/3;break; + case 6: pr = (High[length-i+shift] + Low[length-i+shift] + Close[length-i+shift] + Close[length-i+shift])/4;break; + } + tmp = ( i - lengthvar)*pr; + sum+=tmp; + } + + wt = MathFloor(sum*6/(length*(length+1))/Point)*Point; + + return(wt); +} + +double NonLag(int RPeriod, int myLen, double myPhase, int myShift) +{ + + int i; + double alfa, beta, t, Sum, Weight,g; + double myPrice; + double Coeff = 3*pi; + + Weight=0; Sum=0; t=0; + + for (i=0;i<=myLen-1;i++) + { + g = 1.0/(Coeff*t+1); + if (t <= 0.5 ) g = 1; + beta = MathCos(pi*t); + alfa = g * beta; + myPrice = iMA(NULL,0,1,0,MODE_SMA,MAAppliedPrice,myShift+i); + Sum += alfa*myPrice; + Weight += alfa; + if ( t < 1 ) t += 1.0/(myPhase-1); + else if ( t < myLen-1 ) t += (2*Cycle-1)/(Cycle*RPeriod-1); + } + if (Weight > 0) Weight = (1.0+Deviation/100)*Sum/Weight; + Weight = MathFloor(Weight/Point)*Point; + return (Weight); + +} + +//+------------------------------------------------------------------+ +//| Rate of Change Smoothed | +//+------------------------------------------------------------------+ +int start() + { + int limit; + double ROC, MA_Cur, MA_Prev; + int counted_bars=IndicatorCounted(); +//---- check for possible errors + if(counted_bars<0) return(-1); +//---- last counted bar will be recounted + if(counted_bars>0) counted_bars--; + limit=Bars-counted_bars; +//---- ROC calculation + for(int i=0; i= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..829f32c --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,257 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 2 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 2 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.shpd.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.shpd.mq4 new file mode 100644 index 0000000..7c02a84 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.shpd.mq4 @@ -0,0 +1,402 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XSHPD Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XSHPD Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length ... +input double sharpDetectMultiplier = 70; // Sharp Detect Multiplier + +// +input bool drawLabels = true; // Draw Labels on Founded Sharps + +// +input string sharpBullishLabel = "SH_BULL"; // Sharp Bullish Label +input color sharpBullishColor = clrAqua; // Sharp Bullish color + +// +input string sharpBearishLabel = "SH_BEAR"; // Sharp Bearish Label +input color sharpBearishColor = clrFuchsia; // Sharp Bearish color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +#property indicator_buffers 4 +#property indicator_plots 4 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketLowestLowBufferIndex 1 +#define sharpBullishBufferIndex 2 +#define sharpBearishBufferIndex 3 + +// +double marketHighestHighBuffer[]; +double marketLowestLowBuffer[]; +double sharpBullishBuffer[]; +double sharpBearishBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + enableLogging = true; + + // + logTag = "X_SHPD"; + + // + // Highest High ... + SetIndexLabel(marketHighestHighBufferIndex, ""); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + DRAW_LINE, // DRAW_NONE, + STYLE_DOT, + 1, // 0, + clrAqua // clrNONE + ); + + // + // Lowest Low ... + SetIndexLabel(marketLowestLowBufferIndex, ""); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bullish Buffer ... + SetIndexLabel(sharpBullishBufferIndex, ""); + SetIndexBuffer(sharpBullishBufferIndex, sharpBullishBuffer); + SetIndexStyle( + sharpBullishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + // Sharp Bearish Buffer ... + SetIndexLabel(sharpBearishBufferIndex, ""); + SetIndexBuffer(sharpBearishBufferIndex, sharpBearishBuffer); + SetIndexStyle( + sharpBearishBufferIndex, + DRAW_NONE, + STYLE_DOT, + 0, + clrNONE + ); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Sharp ... + CalculateSharp(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Sharp ... +void CalculateSharp( + const int &bar_index +) { + // + int index = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + marketHighestHighBuffer[bar_index] = GetMarketHighestHigh( + bar_index, + marketLength + ); + + // + marketLowestLowBuffer[bar_index] = GetMarketLowestLow( + bar_index, + marketLength + ); + + // + double maHHs[]; + ArrayResize( + maHHs, + marketLength + ); + + // + double maLLs[]; + ArrayResize( + maLLs, + marketLength + ); + + // + index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + maLLs[index] = marketLowestLowBuffer[i]; + maHHs[index] = marketHighestHighBuffer[i]; + + // + index++; + } + + // + int maxHighIdx = ArrayMaximum(maHHs); + double maxHigh = maHHs[maxHighIdx]; + + // + int minHighIdx = ArrayMinimum(maHHs); + double minHigh = maHHs[minHighIdx]; + + // + double highDiffRate = (maxHigh - minHigh) / 100; + + // + int maxLowIdx = ArrayMaximum(maLLs); + double maxLow = maLLs[maxLowIdx]; + + // + int minLowIdx = ArrayMinimum(maLLs); + double minLow = maLLs[minLowIdx]; + + // + double lowDiffRate = (maxLow - minLow) / 100; + + // + bool isSharpBullishDetected = + high == maxHigh + && low > minLow + && marketHighestHighBuffer[bar_index] == maxHigh + && maxHigh - minHigh > highDiffRate * sharpDetectMultiplier + ; + sharpBullishBuffer[bar_index] = isSharpBullishDetected ? 1 : 0; + + // + bool isSharpBearishDetected = + low == minLow + && high < maxHigh + && marketLowestLowBuffer[bar_index] == minLow + && maxLow - minLow > lowDiffRate * sharpDetectMultiplier + ; + sharpBearishBuffer[bar_index] = isSharpBearishDetected ? 1 : 0; + + // + if ( + drawLabels + && ( + isSharpBearishDetected + || isSharpBullishDetected + ) + ) { + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + string lbl = StringConcatenate( + logTag, + isSharpBullishDetected ? "Bullish_" : "Bearish_", + bar_index + ); + + // + double price = + isSharpBullishDetected + ? + marketLowestLowBuffer[bar_index] - (10 * _Point) + : + marketHighestHighBuffer[bar_index] + (10 * _Point) + ; + + // + uchar arrowCode = + isSharpBullishDetected + ? + SYMBOL_ARROWUP + : + SYMBOL_ARROWDOWN + ; + + // + ENUM_ARROW_ANCHOR anchor = + isSharpBullishDetected + ? + ANCHOR_BOTTOM + : + ANCHOR_TOP + ; + + // + color clr = + isSharpBullishDetected + ? + sharpBullishColor + : + sharpBearishColor + ; + + // + string lblText = + isSharpBullishDetected + ? + sharpBullishLabel + : + sharpBearishLabel + ; + + // + DrawText( + 0, + lbl, + 0, + time, + price, + lblText, + "Tahoma", + 5, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.trend.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.trend.mq4 new file mode 100644 index 0000000..17873e7 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.trend.mq4 @@ -0,0 +1,250 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +// #property indicator_buffers 3 + +// +// Declare Buffers ... +// +datetime startTime; +double lHigh; +double lLow; + +// +datetime highTimes[]; + +// +datetime lowTimes[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + return; + } + + // + if ( + startTime > 0 + && startBarIndex - bar_index == length + ) { + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + length, + bar_index + ); + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int hhSize = ArraySize(highTimes); + datetime tempTimes[]; + ArrayResize( + tempTimes, + hhSize + ); + ArrayCopy( + tempTimes, + highTimes + ); + ArrayResize( + highTimes, + hhSize + 1 + ); + highTimes[0] = hhTime; + ArrayCopy( + highTimes, + tempTimes, + 1 + ); + + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + length, + bar_index + ); + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int llSize = ArraySize(lowTimes); + ArrayFree(tempTimes); + ArrayResize( + tempTimes, + llSize + ); + ArrayCopy( + tempTimes, + lowTimes + ); + ArrayResize( + lowTimes, + llSize + 1 + ); + lowTimes[0] = llTime; + ArrayCopy( + lowTimes, + tempTimes, + 1 + ); + + // + startTime = 0; + ArrayFree(tempTimes); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.x.hl.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.x.hl.mq4 new file mode 100644 index 0000000..f08a975 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.x.hl.mq4 @@ -0,0 +1,412 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Highest High Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Lowest Low Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Highest High Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Lowest Low Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// HH Buffers ... +#define scHHBufferIndex 0 +#define scLLBufferIndex 1 +#define mcHHBufferIndex 2 +#define mcLLBufferIndex 3 +#define lcHHBufferIndex 4 +#define lcLLBufferIndex 5 + +double scHHBuffer[]; +double scLLBuffer[]; +double mcHHBuffer[]; +double mcLLBuffer[]; +double lcHHBuffer[]; +double lcLLBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Highest High and Lowest Low Buffers ... + // + // Short Cycle Highest High ... + string scHHLbl = StringConcatenate( + "SC HH(", shortCycleLength, ")" + ); + SetIndexBuffer(scHHBufferIndex, scHHBuffer); + SetIndexLabel(scHHBufferIndex, scHHLbl); + + // + // Short Cycle Lowest Low ... + string scLLLbl = StringConcatenate( + "SC LL(", shortCycleLength, ")" + ); + SetIndexBuffer(scLLBufferIndex, scLLBuffer); + SetIndexLabel(scLLBufferIndex, scLLLbl); + + // + // Medium Cycle Highest High ... + string mcHHLbl = StringConcatenate( + "MC HH(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcHHBufferIndex, mcHHBuffer); + SetIndexLabel(mcHHBufferIndex, mcHHLbl); + + // + // Medium Cycle Lowest Low ... + string mcLLLbl = StringConcatenate( + "MC LL(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcLLBufferIndex, mcLLBuffer); + SetIndexLabel(mcLLBufferIndex, mcLLLbl); + + // + // Long Cycle Highest High ... + string lcHHLbl = StringConcatenate( + "LC HH(", longCycleLength, ")" + ); + SetIndexBuffer(lcHHBufferIndex, lcHHBuffer); + SetIndexLabel(lcHHBufferIndex, lcHHLbl); + + // + // Long Cycle Lowest Low ... + string lcLLLbl = StringConcatenate( + "LC LL(", longCycleLength, ")" + ); + SetIndexBuffer(lcLLBufferIndex, lcLLBuffer); + SetIndexLabel(lcLLBufferIndex, lcLLLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + // Short Cycle Highest High ... + // + int scHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + shortCycleLength, + bar_index + ); + + // + double scHH = iHigh( + _Symbol, + _Period, + scHHIdx + ); + + // + scHHBuffer[bar_index] = scHH; + + // + // Short Cycle Lowest Low ... + // + int scLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + shortCycleLength, + bar_index + ); + + // + double scLL = iLow( + _Symbol, + _Period, + scLLIdx + ); + + // + scLLBuffer[bar_index] = scLL; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + // Medium Cycle Highest High ... + // + int mcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + mediumCycleLength, + bar_index + ); + + // + double mcHH = iHigh( + _Symbol, + _Period, + mcHHIdx + ); + + // + mcHHBuffer[bar_index] = mcHH; + + // + // Medium Cycle Lowest Low ... + // + int mcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + mediumCycleLength, + bar_index + ); + + // + double mcLL = iLow( + _Symbol, + _Period, + mcLLIdx + ); + + // + mcLLBuffer[bar_index] = mcLL; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + // Long Cycle Highest High ... + // + int lcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + longCycleLength, + bar_index + ); + + // + double lcHH = iHigh( + _Symbol, + _Period, + lcHHIdx + ); + + // + lcHHBuffer[bar_index] = lcHH; + + // + // Long Cycle Lowest Low ... + // + int lcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + longCycleLength, + bar_index + ); + + // + double lcLL = iLow( + _Symbol, + _Period, + lcLLIdx + ); + + // + lcLLBuffer[bar_index] = lcLL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.x.xma.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.x.xma.mq4 new file mode 100644 index 0000000..68b4f32 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.x.xma.mq4 @@ -0,0 +1,355 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Fast Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Slow Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Fast Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Slow Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Fast Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Slow Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// Ma Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 + +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Ma Buffers ... + // + // Short Cycle ... + string scFLbl = StringConcatenate( + "SC F(", shortCycleLength, ")" + ); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexLabel(scFastBufferIndex, scFLbl); + + // + string scSLbl = StringConcatenate( + "SC S(", shortCycleLength, ")" + ); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexLabel(scSlowBufferIndex, scSLbl); + + // + // Medium Cycle ... + string mcFLbl = StringConcatenate( + "MC F(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexLabel(mcFastBufferIndex, mcFLbl); + + // + string mcSLbl = StringConcatenate( + "MC S(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexLabel(mcSlowBufferIndex, mcSLbl); + + // + // Long Cycle ... + string lcFLbl = StringConcatenate( + "LC F(", longCycleLength, ")" + ); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexLabel(lcFastBufferIndex, lcFLbl); + + // + string lcSLbl = StringConcatenate( + "LC S(", longCycleLength, ")" + ); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexLabel(lcSlowBufferIndex, lcSLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + double scFast = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + scFastBuffer[bar_index] = scFast; + + // + double scSlow = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + scSlowBuffer[bar_index] = scSlow; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + double mcFast = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + mcFastBuffer[bar_index] = mcFast; + + // + double mcSlow = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + mcSlowBuffer[bar_index] = mcSlow; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + double lcFast = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + lcFastBuffer[bar_index] = lcFast; + + // + double lcSlow = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = lcSlow; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.xbnd.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.xbnd.mq4 new file mode 100644 index 0000000..5cea8fd --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.xbnd.mq4 @@ -0,0 +1,425 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XBand Indicator +// --------------------------------------------- +// saherelm implementation of xBand Indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XBND Indicator" +#property strict + +// +#include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Inputs ... +// +input int marketLength = 5; // Averaging Length +input int ignoreLastCross = 4; // Ignore Last Cross +input int shift = 0; // Averaging Shift +input ENUM_MA_METHOD method = MODE_SMA; // Averaging Mode +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_chart_window + +// +#property indicator_buffers 4 + +// +// Declare Buffers ... +// +// High ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_DASHDOT + +// +// Open ... +#property indicator_width2 1 +#property indicator_color2 clrGreen +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DASH + +// +// Close ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DASH + +// +// Low ... +#property indicator_width4 1 +#property indicator_color4 clrFuchsia +#property indicator_type4 DRAW_LINE +#property indicator_style4 STYLE_DASHDOT + +// +#define highBufferIndex 0 +#define openBufferIndex 1 +#define closeBufferIndex 2 +#define lowBufferIndex 3 + +// +double highBuffer[]; +double openBuffer[]; +double closeBuffer[]; +double lowBuffer[]; + +// +datetime lastCrossTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + marketLength < 2 + || ignoreLastCross < 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XBND"; + + // + // High ... + string highLabel = StringConcatenate( + "High(", marketLength, ")" + ); + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, highLabel); + + // + // Open ... + string openLabel = StringConcatenate( + "Open(", marketLength, ")" + ); + SetIndexBuffer(openBufferIndex, openBuffer); + SetIndexLabel(openBufferIndex, openLabel); + + // + // Close ... + string closeLabel = StringConcatenate( + "Close(", marketLength, ")" + ); + SetIndexBuffer(closeBufferIndex, closeBuffer); + SetIndexLabel(closeBufferIndex, closeLabel); + + // + // Low ... + string lowLabel = StringConcatenate( + "Low(", marketLength, ")" + ); + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, lowLabel); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + + // + // Calculate Market Changes ... + CalculateInfo(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // High ... + double high = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_HIGH, + bar_index + ); + + // + highBuffer[bar_index] = high; + + // + // Open ... + double open = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_OPEN, + bar_index + ); + + // + openBuffer[bar_index] = open; + + // + // Close ... + double close = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_CLOSE, + bar_index + ); + + // + closeBuffer[bar_index] = close; + + // + // Low ... + double low = iMA( + _Symbol, + _Period, + marketLength, + shift, + method, + PRICE_LOW, + bar_index + ); + + // + lowBuffer[bar_index] = low; +} + +// +void CalculateInfo( + const int bar_index +) { + // + XOHCL pCandle = GetCandleModel(bar_index); + + // + bool isTrendingUp = + pCandle.low > highBuffer[bar_index] + && pCandle.high > highBuffer[bar_index]; + + // + bool isTrendingDown = + pCandle.high < lowBuffer[bar_index] + && pCandle.low < lowBuffer[bar_index]; + + // + bool isOpenCrossOverClose = + true + // && + // ( + // pCandle.high > highBuffer[bar_index + 1] + // || pCandle.low < lowBuffer[bar_index + 1] + // ) + && openBuffer[bar_index + 1] > closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] >= closeBuffer[bar_index + 2]) + ; + + // + bool isOpenCrossUnderClose = + true + // && + // ( + // pCandle.high > highBuffer[bar_index + 1] + // || pCandle.low < lowBuffer[bar_index + 1] + // ) + && openBuffer[bar_index + 1] < closeBuffer[bar_index + 1] + && !(openBuffer[bar_index + 2] <= closeBuffer[bar_index + 2]) + ; + + // + isTrendingUp = isOpenCrossUnderClose; + isTrendingDown = isOpenCrossOverClose; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + if (lastCrossTime == 0) { + lastCrossTime = time; + } else { + // + int lastCrossBarIndex = iBarShift( + _Symbol, + _Period, + lastCrossTime + ); + + // + int diff = lastCrossBarIndex - bar_index; + if (diff <= ignoreLastCross) { + return; + } else { + lastCrossTime = time; + } + } + } + + // + string lbl = StringConcatenate( + logTag, + "_Arrow_", + isTrendingUp ? "UP" : "Down", + "_", time + ); + + // + color clr = isTrendingUp ? + clrAqua : + clrFuchsia; + + // + ENUM_ARROW_ANCHOR anchor = isTrendingUp ? + ANCHOR_BOTTOM : + ANCHOR_TOP; + + // + uchar arrowCode = isTrendingUp ? + SYMBOL_ARROWUP : + SYMBOL_ARROWDOWN; + + // + double price = isTrendingUp ? + pCandle.low - 20 * _Point : + pCandle.high + 20 * _Point; + + // + if (isTrendingUp) { + // + // this means Market Going Up ... + + } + + // + if (isTrendingDown) { + // + // this means Market Going Downm ... + } + + // + if ( + isTrendingUp + || isTrendingDown + ) { + // + bool isDrawn = DrawArrow( + 0, + lbl, + 0, + time, + price, + arrowCode, + anchor, + clr + ); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.xhh.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.xhh.mq4 new file mode 100644 index 0000000..dfbc2cd --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.xhh.mq4 @@ -0,0 +1,410 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XHH Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XHH Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 4; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 14; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 27; // Market Medium Cycle Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Highest High Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Lowest Low Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Highest High Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Lowest Low Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define shortCycleHighestHighBufferIndex 0 +#define shortCycleLowestLowBufferIndex 1 +#define mediumCycleHighestHighBufferIndex 2 +#define mediumCycleLowestLowBufferIndex 3 +#define longCycleHighestHighBufferIndex 4 +#define longCycleLowestLowBufferIndex 5 + +double shortCycleHighestHighBuffer[]; +double shortCycleLowestLowBuffer[]; +double mediumCycleHighestHighBuffer[]; +double mediumCycleLowestLowBuffer[]; +double longCycleHighestHighBuffer[]; +double longCycleLowestLowBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; + +// +double highestHighTimes[]; +double lowestLowTimes[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Short Cycle Highest High ... + string scHHLbl = StringConcatenate( + "SC HH(", shortCycleLength, ")" + ); + SetIndexBuffer(shortCycleHighestHighBufferIndex, shortCycleHighestHighBuffer); + SetIndexLabel(shortCycleHighestHighBufferIndex, scHHLbl); + + // + // Short Cycle Lowest Low ... + string scLLLbl = StringConcatenate( + "SC LL(", shortCycleLength, ")" + ); + SetIndexBuffer(shortCycleLowestLowBufferIndex, shortCycleLowestLowBuffer); + SetIndexLabel(shortCycleLowestLowBufferIndex, scLLLbl); + + // + // Medium Cycle Highest High ... + string mcHHLbl = StringConcatenate( + "MC HH(", mediumCycleLength, ")" + ); + SetIndexBuffer(mediumCycleHighestHighBufferIndex, mediumCycleHighestHighBuffer); + SetIndexLabel(mediumCycleHighestHighBufferIndex, mcHHLbl); + + // + // Medium Cycle Lowest Low ... + string mcLLLbl = StringConcatenate( + "MC LL(", mediumCycleLength, ")" + ); + SetIndexBuffer(mediumCycleLowestLowBufferIndex, mediumCycleLowestLowBuffer); + SetIndexLabel(mediumCycleLowestLowBufferIndex, mcLLLbl); + + // + // Long Cycle Highest High ... + string lcHHLbl = StringConcatenate( + "LC HH(", longCycleLength, ")" + ); + SetIndexBuffer(longCycleHighestHighBufferIndex, longCycleHighestHighBuffer); + SetIndexLabel(longCycleHighestHighBufferIndex, lcHHLbl); + + // + // Long Cycle Lowest Low ... + string lcLLLbl = StringConcatenate( + "LC LL(", longCycleLength, ")" + ); + SetIndexBuffer(longCycleLowestLowBufferIndex, longCycleLowestLowBuffer); + SetIndexLabel(longCycleLowestLowBufferIndex, lcLLLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + // Short Cycle Highest High ... + // + int scHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + shortCycleLength, + bar_index + ); + + // + double scHH = iHigh( + _Symbol, + _Period, + scHHIdx + ); + + // + shortCycleHighestHighBuffer[bar_index] = scHH; + + // + // Short Cycle Lowest Low ... + // + int scLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + shortCycleLength, + bar_index + ); + + // + double scLL = iLow( + _Symbol, + _Period, + scLLIdx + ); + + // + shortCycleLowestLowBuffer[bar_index] = scLL; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + // Medium Cycle Highest High ... + // + int mcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + mediumCycleLength, + bar_index + ); + + // + double mcHH = iHigh( + _Symbol, + _Period, + mcHHIdx + ); + + // + mediumCycleHighestHighBuffer[bar_index] = mcHH; + + // + // Medium Cycle Lowest Low ... + // + int mcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + mediumCycleLength, + bar_index + ); + + // + double mcLL = iLow( + _Symbol, + _Period, + mcLLIdx + ); + + // + mediumCycleLowestLowBuffer[bar_index] = mcLL; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + // Long Cycle Highest High ... + // + int lcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + longCycleLength, + bar_index + ); + + // + double lcHH = iHigh( + _Symbol, + _Period, + lcHHIdx + ); + + // + longCycleHighestHighBuffer[bar_index] = lcHH; + + // + // Long Cycle Lowest Low ... + // + int lcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + longCycleLength, + bar_index + ); + + // + double lcLL = iLow( + _Symbol, + _Period, + lcLLIdx + ); + + // + longCycleLowestLowBuffer[bar_index] = lcLL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..4a599f9 --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,695 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +// +// Cycle Definitions ... +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showPSar = true; // Show Parabolic Sar +input bool showMarketMiddle = true; // Show Market Middle +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 +#define pSarBufferIndex 7 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; +double pSarBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + SetIndexLabel(midBufferIndex, "Market Mid"); + + // + // Parabolic Sar ... + SetIndexBuffer(pSarBufferIndex, pSarBuffer); + SetIndexLabel(pSarBufferIndex, "P Sar"); + SetIndexStyle( + pSarBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showPSar ? + pSarColor : + clrNONE + ); + + // + // Market Middle ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexLabel(midBufferIndex, "Mid"); + SetIndexStyle( + midBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMarketMiddle ? + clrAntiqueWhite : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + + // + // Calculate Parabolic Sar ... + CalculateParabolicSar(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} + +void CalculateParabolicSar( + const int bar_index +) { + // + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + pSarBuffer[bar_index] = sarValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.xmarket.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.xmarket.mq4 new file mode 100644 index 0000000..71b2e2c --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.xmarket.mq4 @@ -0,0 +1,394 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMKT Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +// +input bool showHighestHigh = true; // Show Market Highest High +input bool showHighestLow = true; // Show Market Highest Low +input bool showHighestOpen = true; // Show Market Highest Open +input bool showHighestClose = true; // Show Market Highest Close +input bool showLowestHigh = true; // Show Market Lowest High +input bool showLowestLow = true; // Show Market Lowest Low +input bool showLowestOpen = true; // Show Market Lowest Open +input bool showLowestClose = true; // Show Market Lowest Close +// +input color highestHighColor = clrDeepPink; // Market Highest High Color +input color highestLowColor = clrDarkOrange; // Market Highest Low Color +input color highestOpenColor = clrDodgerBlue; // Market Highest Open Color +input color highestCloseColor = clrOrchid; // Market Highest Close Color +input color lowestHighColor = clrHotPink; // Market Lowest High Color +input color lowestLowColor = clrOrange; // Market Lowest Low Color +input color lowestOpenColor = clrPowderBlue; // Market Lowest Open Color +input color lowestCloseColor = clrMediumOrchid; // Market Lowest Close Color +// +input ENUM_LINE_STYLE highestHighStyle = STYLE_DOT; // Market Highest High Line Style +input ENUM_LINE_STYLE highestLowStyle = STYLE_DOT; // Market Highest Low Line Style +input ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT; // Market Highest Open Line Style +input ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT; // Market Highest Close Line Style +input ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT; // Market Lowest High Line Style +input ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT; // Market Lowest Low Line Style +input ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT; // Market Lowest Open Line Style +input ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT; // Market Lowest Close Line Style +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketHighestLowBufferIndex 1 +#define marketHighestOpenBufferIndex 2 +#define marketHighestCloseBufferIndex 3 +#define marketLowestHighBufferIndex 4 +#define marketLowestLowBufferIndex 5 +#define marketLowestOpenBufferIndex 6 +#define marketLowestCloseBufferIndex 7 + +// +double marketHighestHighBuffer[]; +double marketHighestLowBuffer[]; +double marketHighestOpenBuffer[]; +double marketHighestCloseBuffer[]; +double marketLowestHighBuffer[]; +double marketLowestLowBuffer[]; +double marketLowestOpenBuffer[]; +double marketLowestCloseBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMKT"; + + // + // Highest High ... + string highestHighLbl = StringConcatenate("HH(", marketLength,")"); + SetIndexLabel(marketHighestHighBufferIndex, highestHighLbl); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + showHighestHigh ? + DRAW_LINE : + DRAW_NONE, + highestHighStyle, + 1, + showHighestHigh ? + highestHighColor : + clrNONE + ); + + // + // Highest Low ... + string highestLowLbl = StringConcatenate("HL(", marketLength,")"); + SetIndexLabel(marketHighestLowBufferIndex, highestLowLbl); + SetIndexBuffer(marketHighestLowBufferIndex, marketHighestLowBuffer); + SetIndexStyle( + marketHighestLowBufferIndex, + showHighestLow ? + DRAW_LINE : + DRAW_NONE, + highestLowStyle, + 1, + showHighestLow ? + highestLowColor : + clrNONE + ); + + // + // Highest Open ... + string highestOpenLbl = StringConcatenate("HO(", marketLength,")"); + SetIndexLabel(marketHighestOpenBufferIndex, highestOpenLbl); + SetIndexBuffer(marketHighestOpenBufferIndex, marketHighestOpenBuffer); + SetIndexStyle( + marketHighestOpenBufferIndex, + showHighestOpen ? + DRAW_LINE : + DRAW_NONE, + highestOpenStyle, + 1, + showHighestOpen ? + highestOpenColor : + clrNONE + ); + + // + // Highest Close ... + string highestCloseLbl = StringConcatenate("HC(", marketLength,")"); + SetIndexLabel(marketHighestCloseBufferIndex, highestCloseLbl); + SetIndexBuffer(marketHighestCloseBufferIndex, marketHighestCloseBuffer); + SetIndexStyle( + marketHighestCloseBufferIndex, + showHighestClose ? + DRAW_LINE : + DRAW_NONE, + highestCloseStyle, + 1, + showHighestClose ? + highestCloseColor : + clrNONE + ); + + // + // Lowest High ... + string lowestHighLbl = StringConcatenate("LH(", marketLength,")"); + SetIndexLabel(marketLowestHighBufferIndex, lowestHighLbl); + SetIndexBuffer(marketLowestHighBufferIndex, marketLowestHighBuffer); + SetIndexStyle( + marketLowestHighBufferIndex, + showLowestHigh ? + DRAW_LINE : + DRAW_NONE, + lowestHighStyle, + 1, + showLowestHigh ? + lowestHighColor : + clrNONE + ); + + // + // Lowest Low ... + string lowestLowLbl = StringConcatenate("LL(", marketLength,")"); + SetIndexLabel(marketLowestLowBufferIndex, lowestLowLbl); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + showLowestLow ? + DRAW_LINE : + DRAW_NONE, + lowestLowStyle, + 1, + showLowestLow ? + lowestLowColor : + clrNONE + ); + + // + // Lowest Open ... + string lowestOpenLbl = StringConcatenate("LO(", marketLength,")"); + SetIndexLabel(marketLowestOpenBufferIndex, lowestOpenLbl); + SetIndexBuffer(marketLowestOpenBufferIndex, marketLowestOpenBuffer); + SetIndexStyle( + marketLowestOpenBufferIndex, + showLowestOpen ? + DRAW_LINE : + DRAW_NONE, + lowestOpenStyle, + 1, + showLowestOpen ? + lowestOpenColor : + clrNONE + ); + + // + // Lowest Close ... + string lowestCloseLbl = StringConcatenate("LC(", marketLength,")"); + SetIndexLabel(marketLowestCloseBufferIndex, lowestCloseLbl); + SetIndexBuffer(marketLowestCloseBufferIndex, marketLowestCloseBuffer); + SetIndexStyle( + marketLowestCloseBufferIndex, + showLowestClose ? + DRAW_LINE : + DRAW_NONE, + lowestCloseStyle, + 1, + showLowestClose ? + lowestCloseColor : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index +) { + // + // Highest High ... + double highestHighValue = GetMarketHighestHigh( + bar_index, + marketLength + ); + marketHighestHighBuffer[bar_index] = highestHighValue; + + // + // Highest Low ... + double highestLowValue = GetMarketHighestLow( + bar_index, + marketLength + ); + marketHighestLowBuffer[bar_index] = highestLowValue; + + // + // Highest Open ... + double highestOpenValue = GetMarketHighestOpen( + bar_index, + marketLength + ); + marketHighestOpenBuffer[bar_index] = highestOpenValue; + + // + // Highest Close ... + double highestCloseValue = GetMarketHighestClose( + bar_index, + marketLength + ); + marketHighestCloseBuffer[bar_index] = highestCloseValue; + + // + // Lowest High ... + double lowestHighValue = GetMarketLowestHigh( + bar_index, + marketLength + ); + marketLowestHighBuffer[bar_index] = lowestHighValue; + + // + // Lowest Low ... + double lowestLowValue = GetMarketLowestLow( + bar_index, + marketLength + ); + marketLowestLowBuffer[bar_index] = lowestLowValue; + + // + // Lowest Open ... + double lowestOpenValue = GetMarketLowestOpen( + bar_index, + marketLength + ); + marketLowestOpenBuffer[bar_index] = lowestOpenValue; + + // + // Lowest Close ... + double lowestCloseValue = GetMarketLowestClose( + bar_index, + marketLength + ); + marketLowestCloseBuffer[bar_index] = lowestCloseValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.xmtrend.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.xmtrend.mq4 new file mode 100644 index 0000000..aa89e7b --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.xmtrend.mq4 @@ -0,0 +1,221 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMTR Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 20; // Market Length +input int atrMultiplier = 1; // ATR Multiplier +input int atrLength = 5; // ATR Period +input ENUM_APPLIED_PRICE source = PRICE_CLOSE; // Source +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 3 +#property indicator_plots 3 + +// +// Declare Buffers ... +#define trendBufferIndex 0 +#define upTrendBufferIndex 1 +#define downTrendBufferIndex 2 + +// +double trendBuffer[]; +double upTrendBuffer[]; +double downTrendBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XMTR"; + + // + // TREND ... + SetIndexLabel(trendBufferIndex, "Trend"); + SetIndexBuffer(trendBufferIndex, trendBuffer); + SetIndexStyle( + trendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // UP Trend ... + SetIndexLabel(upTrendBufferIndex, "Up Trend"); + SetIndexBuffer(upTrendBufferIndex, upTrendBuffer); + SetIndexStyle( + upTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // DOWN Trend ... + SetIndexLabel(downTrendBufferIndex, "Down Trend"); + SetIndexBuffer(downTrendBufferIndex, downTrendBuffer); + SetIndexStyle( + downTrendBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers( + i, + low + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index, + const double &low[] +) { + // + double atr = GetMarketTRSMA( + bar_index, + atrLength + ); + + // + double smoothedAtr = (atr * atrMultiplier); + double upTrend = low[bar_index] - smoothedAtr; + double downTrend = low[bar_index] + smoothedAtr; + + // + double cciValue = GetMarketCCI( + bar_index, + marketLength, + source + ); + + // + // TODO: Complete this ... +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/14020428/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/14020428/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.cci.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.cci.signal.lib.mq4 new file mode 100644 index 0000000..c572f3d --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.cci.signal.lib.mq4 @@ -0,0 +1,472 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 CCI Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Based Signal Conditions ... +struct XCCILongSignalConditions { + // + datetime start; + + // + datetime crossOverMinusHundredTime; + datetime crossUnderMinusHundredTime; + + // + double crossOverSlope; +}; + +// +static XCCILongSignalConditions cciLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Signal Conditions ... +void CheckCCILongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 10 +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // LONG: + // wait for cci cross under -100 + // then wait for cross over -100 + // slope of crossing over ??? ... + if (cciLongConds.start == 0) { + // LogMessage("Start"); + cciLongConds.start = barTime; + return; + } + + // + // Check Start Time ... + if (cciLongConds.start == 0) { + return; + } + + // + // Read current, prev, and prevPrev CCI ... + double cci = GetMarketCCI( + bar_index, + marketLen + ); + double cci1 = GetMarketCCI( + bar_index + 1, + marketLen + ); + double cci2 = GetMarketCCI( + bar_index + 2, + marketLen + ); + + // + // Find Cross Under -100 ... + bool isCrossUnderMinusHundred = + cci < -105 && !(cci1 < -105) + && MathAbs(MathAbs(cci) - MathAbs(cci1)) > smoother + ; + + // + // Find Cross Over -100 ... + bool isCrossOverMinusHundred = + cci > -105 && !(cci1 > -105) + && MathAbs(cci - cci1) > smoother + ; + + // + // Fill Conditions ... + if ( + isCrossUnderMinusHundred + && cciLongConds.crossUnderMinusHundredTime == 0 + && cciLongConds.crossOverMinusHundredTime == 0 + ) { + // LogMessage("Cross Under ..."); + cciLongConds.crossUnderMinusHundredTime = barTime; + return; + } + + // + // Fill Conditions ... + if ( + isCrossOverMinusHundred + && cciLongConds.crossOverMinusHundredTime == 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + ) { + // + // LogMessage("Cross Over ..."); + cciLongConds.crossOverMinusHundredTime = barTime; + } + + // + // Prevent Going forward untill Cross Under Happens ... + if (cciLongConds.crossUnderMinusHundredTime == 0) { + return; + } + + // + // Prevent from Going forward untill Cross Over Happens ... + if (cciLongConds.crossOverMinusHundredTime == 0) { + return; + } + + // + // Calculate Slope ... + double x1 = 0; + double y1 = cci1; + double x2 = 1; + double y2 = cci; + + // + // Calculat Line Slope ... + double tSlope = GetSlope( + x1, y1, x2, y2 + ); + + // + cciLongConds.crossOverSlope = tSlope; + // LogMessage("Slope: " + tSlope); +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateCCILongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateCCILongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + int llIdx = GetLowestLowOFCCILongPeriodIndex(); + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + // GetLowestLowOFCCILongPeriod(); + + // + int hhIdx = GetHighestHighOfCCILongPeriodIndex(); + double hh = GetHighestHighOfCCILongPeriod(); + // GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_CCI_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_CCI_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateCCILongConditions() { + // + int crossUnderBarIndex = + cciLongConds.crossUnderMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ) + : -1 + ; + + // + int crossOverBarIndex = + cciLongConds.crossOverMinusHundredTime != 0 + ? iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ) + : -1 + ; + + // + bool isConditionsFilled = + // + cciLongConds.start != 0 + && cciLongConds.crossUnderMinusHundredTime != 0 + && cciLongConds.crossOverMinusHundredTime != 0 + && cciLongConds.crossUnderMinusHundredTime >= cciLongConds.start + && cciLongConds.crossOverMinusHundredTime > cciLongConds.crossUnderMinusHundredTime + ; + + // + bool isLogicPassed = + // + crossOverBarIndex > 0 + && crossUnderBarIndex > 0 + && crossUnderBarIndex > crossOverBarIndex + && (crossUnderBarIndex - crossOverBarIndex) >= 5 + ; + + // + bool result = + // + isConditionsFilled + && isLogicPassed + && cciLongConds.crossOverSlope > 0 + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearCCILongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearCCILongSignalConditions() { + // + cciLongConds.start = 0; + cciLongConds.crossOverSlope = 0; + cciLongConds.crossOverMinusHundredTime = 0; + cciLongConds.crossUnderMinusHundredTime = 0; +} + +// +int GetHighestHighOfCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iHighest( + _Symbol, + _Period, + MODE_HIGH, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetHighestHighOfCCILongPeriod() { + // + int index = GetHighestHighOfCCILongPeriodIndex(); + + // + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +int GetLowestLowOFCCILongPeriodIndex() { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossUnderMinusHundredTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + cciLongConds.crossOverMinusHundredTime + ); + + // + int result = iLowest( + _Symbol, + _Period, + MODE_LOW, + crossUnderBarIndex - crossOverBarIndex, + crossOverBarIndex + ); + + // + return result; +} + +// +double GetLowestLowOFCCILongPeriod() { + // + int index = GetLowestLowOFCCILongPeriodIndex(); + + // + double result = iLow( + _Symbol, + _Period, + index + ); + + // + return result; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForCCILongSignals( + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + result = + // + true + // + // && states[1].mc.fast > states[1].mc.slow + // && MathAbs(states[1].mc.fast - states[1].mc.slow) > 100 * _Point + // && states[1].marketMiddleage > states[1].sc.fast + // && states[1].marketMiddleage > states[1].mc.fast + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..a5f3fd8 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,948 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +static double zigZags[]; +// +// END Global Requirement Functions ... +// + +// +// START Indicator Reading Data ... +// +// +// START XMKT Data ... +// +XMKTState GetXMKT( + const int bar_index, + const int marketLen, + // + const bool showHighestHigh = true, + const bool showHighestLow = true, + const bool showHighestOpen = true, + const bool showHighestClose = true, + const bool showLowestHigh = true, + const bool showLowestLow = true, + const bool showLowestOpen = true, + const bool showLowestClose = true, + const color highestHighColor = clrDeepPink, + const color highestLowColor = clrDarkOrange, + const color highestOpenColor = clrDodgerBlue, + const color highestCloseColor = clrOrchid, + const color lowestHighColor = clrHotPink, + const color lowestLowColor = clrOrange, + const color lowestOpenColor = clrPowderBlue, + const color lowestCloseColor = clrMediumOrchid, + const ENUM_LINE_STYLE highestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT, + const ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT +) { + // + XMKTState result = {}; + + // + string xmktIndName = "x-saherelm.xmarket"; + + // + int highestHighBufferIndex = 0; + int highestLowBufferIndex = 1; + int highestOpenBufferIndex = 2; + int highestCloseBufferIndex = 3; + int lowestHighBufferIndex = 4; + int lowestLowBufferIndex = 5; + int lowestOpenBufferIndex = 6; + int lowestCloseBufferIndex = 7; + + // + // Highest High ... + double highestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.highestHigh = highestHigh; + + // + // Highest Low ... + double highestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.highestLow = highestLow; + + // + // Highest Open ... + double highestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.highestOpen = highestOpen; + + // + // Highest Close ... + double highestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + highestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.highestClose = highestClose; + + // + // Lowest High ... + double lowestHigh = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestHighBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestHigh = lowestHigh; + + // + // Lowest Low ... + double lowestLow = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestLowBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestLow = lowestLow; + + // + // Lowest Open ... + double lowestOpen = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestOpenBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestOpen = lowestOpen; + + // + // Lowest Close ... + double lowestClose = iCustom( + _Symbol, + _Period, + xmktIndName, + // + // Inputs ... + marketLen, + showHighestHigh, + showHighestLow, + showHighestOpen, + showHighestClose, + showLowestHigh, + showLowestLow, + showLowestOpen, + showLowestClose, + highestHighColor, + highestLowColor, + highestOpenColor, + highestCloseColor, + lowestHighColor, + lowestLowColor, + lowestOpenColor, + lowestCloseColor, + highestHighStyle, + highestLowStyle, + highestOpenStyle, + highestCloseStyle, + lowestHighStyle, + lowestLowStyle, + lowestOpenStyle, + lowestCloseStyle, + // + lowestCloseBufferIndex, // Buffer Index ... + bar_index + ); + result.lowestClose = lowestClose; + + // + return result; +} +// +// END XMKT Data ... +// + +// +// START XOSC Data ... +// +XCycleState GetXOSC( + const int bar_index, + const int marketLen, + // + const int fastMult, + const int slowMult, + // + const double fastMMul = 1.0, + const double slowMMul = 3.0 +) { + // + XCycleState result = {}; + + // + string oscIndName = "x-saherelm.osc"; + + // + // Prepare OSC Inputs ... + // + int fastLength = fastMult * marketLen; + int slowLength = slowMult * marketLen; + + // + // Fast ... + double fast = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 0, // Buffer Index ... + bar_index + ); + result.fast = fast; + + // + // Slow ... + double slow = iCustom( + _Symbol, + _Period, + oscIndName, + // + // Inputs ... + fastLength, + fastMMul, + slowLength, + slowMMul, + // + 1, // Buffer Index ... + bar_index + ); + result.slow = slow; + + // + return result; +} +// +// END XOSC Data ... +// + +// +// START XBND Data ... +// +XBndState GetXBND( + const int bar_index, + // + const int marketLen = 10, // Market Length ... + const int shift = 0, // MA Shift ... + const ENUM_MA_METHOD method = MODE_SMA // MA Method ... +) { + // + XBndState result = {}; + + // + double high = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_HIGH + ); + result.high = high; + + // + double open = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_OPEN + ); + result.open = open; + + // + double close = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_CLOSE + ); + result.close = close; + + // + double low = GetMA( + bar_index, + marketLen, + shift, + method, + PRICE_LOW + ); + result.low = low; + + // + return result; +} +// +// END XBND Data ... +// + +// +// START ZigZag Data ... +// +void PrepareZigZagState( + const int bar_index, + // + const int depth = 12, + const int deviation = 5, + const int backStep = 3 +) { + // + string zigzagIndName = "x-saherelm.zigzag"; + + // + ArrayFree(zigZags); + ArrayResize( + zigZags, + 3 + ); + + // + double zigZag = 0; + int index = 0; + int i = bar_index; + while (index < 3) { + // + zigZag = iCustom( + _Symbol, + _Period, + zigzagIndName, + // + // Inputs ... + depth, + deviation, + backStep, + // + 0, // Buffer Index ... + i + ); + + // + if (zigZag > 0) { + // + zigZags[index] = zigZag; + index++; + } + + // + i++; + } +} +// +// END ZigZag Data ... +// + +// +// START XMA Data ... +// +// +// Retrieve Short Cycle ... +XCycleState GetXMASC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Medium Cycle ... +XCycleState GetXMAMC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow= slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMALC( + const int bar_index, + const int marketLen, + const int fastMultiplier, + const int slowMultiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = marketLen * fastMultiplier; + int slowLength = marketLen * slowMultiplier; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Long Cycle ... +XCycleState GetXMANN( + const int bar_index, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_SMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + XCycleState result = {}; + + // + int fastLength = 10; + int slowLength = 50; + + // + double fast = iMA( + _Symbol, + _Period, + fastLength, + shift, + method, + appliedPrice, + bar_index + ); + result.fast = fast; + + // + double slow = iMA( + _Symbol, + _Period, + slowLength, + shift, + method, + appliedPrice, + bar_index + ); + result.slow = slow; + + // + return result; +} + +// +// Retrieve Middle ... +double GetXMAMM( + const int bar_index, + const int marketLen, + const double multiplier, + // + const int shift = 0, + const ENUM_MA_METHOD method = MODE_EMA, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_MEDIAN +) { + // + double result = 0; + + // + int length = (int)(marketLen * multiplier); + + // + double middle = iMA( + _Symbol, + _Period, + length, + shift, + method, + appliedPrice, + bar_index + ); + result = middle; + + // + return result; +} + +// +// Retrieve XMA Parabolic SAR ... +double GetXMAPSAR( + const int bar_index, + // + double stp = 0.02, + double mxm = 0.2 +) { + // + double result = 0; + + // + double pSar = iSAR( + _Symbol, + _Period, + stp, + mxm, + bar_index + ); + result = pSar; + + // + return result; +} + +// +XState GetXState( + const int bar_index, + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleFastMult, + const int shortCycleSlowMult, + const int mediumCycleFastMult, + const int mediumCycleSlowMult, + const int longCycleFastMult, + const int longCycleSlowMult +) { + // + XState result = {}; + + // + // Short Cycle ... + XCycleState sc = GetXMASC( + bar_index, + marketLen, + shortCycleFastMult, + shortCycleSlowMult + ); + result.sc = sc; + + // + // Medium Cycle ... + XCycleState mc = GetXMAMC( + bar_index, + marketLen, + mediumCycleFastMult, + mediumCycleSlowMult + ); + result.mc = mc; + + // + // Long Cycle ... + XCycleState lc = GetXMALC( + bar_index, + marketLen, + longCycleFastMult, + longCycleSlowMult + ); + result.lc = lc; + + // // + // // OSC ... + // XCycleState osc = GetXOSC( + // // + // bar_index, + // marketLen, + // // + // shortCycleFastMult, + // shortCycleSlowMult + // ); + // result.osc = osc; + + // + // Market Middleage ... + double marketMiddleage = GetXMAMM( + bar_index, + marketLen, + 1.5 + ); + result.marketMiddleage = marketMiddleage; + + // + // Parabolic SAR ... + double parabolicSAR = GetXMAPSAR( + bar_index, + stp, + mxm + ); + result.parabolicSAR = parabolicSAR; + + // // + // int cciMarketLength = longCycleSlowMult * marketLen; + // double cci = GetMarketCCI( + // bar_index, + // cciMarketLength + // ); + // result.cci = cci; + + // + XBndState bnd = GetXBND( + bar_index + ); + result.bnd = bnd; + + // + XMKTState mkt = GetXMKT( + bar_index, + marketLen + ); + result.mkt = mkt; + + // + double longCycleHighestHigh = GetMarketHighestHigh( + bar_index, + longCycleFastMult * marketLen + ); + result.longCycleHighestHigh = longCycleHighestHigh; + + // + return result; +} +// +// END XMA Data ... +// +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..658c90a --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1502 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +static datetime lastBarTime; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..205e39a --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,225 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_OSC_PROVIDER, + X_CCI_PROVIDER, + X_SHP_PROVIDER, + X_XMA_PROVIDER, + X_RMA_PROVIDER, + X_XXX_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XBndState { + double high; + double open; + double close; + double low; +}; + +// +struct XMKTState { + // + double highestHigh; + double highestLow; + double highestOpen; + double highestClose; + + // + double lowestHigh; + double lowestLow; + double lowestOpen; + double lowestClose; +}; + +// +struct XCycleState { + double fast; + double slow; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XState { + // + // SC ... + XCycleState sc; + + // + // MC ... + XCycleState mc; + + // + // LC ... + XCycleState lc; + + // + // OSC ... + // XCycleState osc; + + // + // MIDDLEAGE ... + double marketMiddleage; + + // + // PARABOLIC-SAR ... + double parabolicSAR; + + // + double cci; + + // + XBndState bnd; + + // + XMKTState mkt; + + // + double longCycleHighestHigh; +}; + +// +// Parsed XMA Buffer ... +struct XStateInfo { + // + // Check Market Cross Exists or not ... + // + bool isSCFastCrossOverSlow; + bool isSCFastCrossUnderSlow; + + // + double scMin; + double scMax; + + // + bool isMCFastCrossOverSlow; + bool isMCFastCrossUnderSlow; + + // + double mcMin; + double mcMax; + + bool isLCFastCrossOverSlow; + bool isLCFastCrossUnderSlow; + + // + double lcMin; + double lcMax; + + // + bool isMMCrossOverSCFast; + bool isMMCrossUnderSCFast; + + // + bool isMMCrossOverMCFast; + bool isMMCrossUnderMCFast; + + // + double mmMin; + double mmMax; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..84f0386 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 OSC Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XOSCLongSignalConditions { + // + datetime crossOverTime; + double slowOnCrossOver; + + // + datetime crossUnderTime; + double slowOnCrossUnder; +}; + +// +static XOSCLongSignalConditions oscLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckOSCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[0].osc.fast < 0 + && !(states[1].osc.fast < 0) + ; + + // + bool isCrossOver = + states[0].osc.fast > 0 + && !(states[1].osc.fast > 0) + ; + + // + int oneTouches = 0; + int halfTouches = 0; + int minusOneTouches = 0; + for (int i = 0; i < marketLen - 1; i++) { + // + // One Touches ... + if ( + states[i].osc.fast > 1 + && !(states[i + 1].osc.fast > 1) + ) { + oneTouches++; + } + + // + // Half Touches ... + if ( + states[i].osc.fast > 0.5 + && !(states[i + 1].osc.fast > 0.5) + ) { + halfTouches++; + } + + // + // Minus One Touches ... + if ( + states[i].osc.fast < -1 + && !(states[i + 1].osc.fast < -1) + ) { + minusOneTouches++; + } + } + + // + if ( + isCrossUnder + && oscLongConds.crossUnderTime == 0 + ) { + // + oscLongConds.crossUnderTime = barTime; + oscLongConds.slowOnCrossUnder = states[0].osc.slow; + return; + } + + // + if ( + isCrossOver + && oscLongConds.crossUnderTime > 0 + && oscLongConds.crossOverTime == 0 + ) { + // + oscLongConds.crossOverTime = barTime; + oscLongConds.slowOnCrossOver = states[0].osc.slow; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateOSCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateOSCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_OSC_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_OSC_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateOSCLongConditions() { + // + bool isConditionsFilled = + oscLongConds.crossOverTime > 0 + && oscLongConds.crossUnderTime > 0 + && oscLongConds.slowOnCrossOver > 0 + && oscLongConds.slowOnCrossUnder > 0 + && oscLongConds.crossOverTime > oscLongConds.crossUnderTime + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossUnderTime + ); + + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + oscLongConds.crossOverTime + ); + + // + isBLFilled = + crossUnderBarIndex > crossOverBarIndex + // && oscLongConds.slowOnCrossOver > oscLongConds.slowOnCrossUnder + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearOSCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearOSCLongSignalConditions() { + // + oscLongConds.crossOverTime = 0;; + oscLongConds.crossUnderTime = 0;; +} + +// +// Check State for Long Signals ... +bool IsReadyForOSCLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.rma.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.rma.signal.lib.mq4 new file mode 100644 index 0000000..4b9637a --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.rma.signal.lib.mq4 @@ -0,0 +1,363 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 RMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// RMA Based Signal Conditions ... +struct XRMALongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XRMALongSignalConditions xrmaLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXRMALongSignalConditions( + const int bar_index, + const int marketLen, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XCycleState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XCycleState state = GetXMANN(i); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].fast < states[1].slow + && !(states[2].fast < states[2].slow) + ; + + // + bool isCrossOver = + states[1].fast > states[1].slow + && !(states[2].fast > states[2].slow) + ; + + // + if ( + isCrossUnder + && xrmaLongConds.crossUnderTime == 0 + ) { + // + xrmaLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xrmaLongConds.crossUnderTime > 0 + && xrmaLongConds.crossOverTime == 0 + ) { + // + xrmaLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRMALongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXRMALongConditions(marketLen)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; // 300 * _Point; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_RMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_RMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXRMALongConditions( + const int marketLen +) { + // + bool isConditionsFilled = + true + && xrmaLongConds.crossOverTime > 0 + && xrmaLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xrmaLongConds.crossUnderTime + ); + + // + XCycleState stateOnCrossUnder = GetXMANN( + crossUnderBarIndex + ); + + // + XCycleState stateOnCrossOver = GetXMANN( + crossOverBarIndex + ); + + // + double maC = iMA( + _Symbol, + _Period, + 14, + 0, + MODE_SMA, + PRICE_CLOSE, + crossOverBarIndex + ); + + // // + // double rmaOnCrossOver = GetRMA( + // crossOverBarIndex, + // 10 + // ); + + // // + // double rmaOnMarketLength = GetRMA( + // crossOverBarIndex + marketLen, + // 10 + // ); + + // // + // double prevCandleHigh = iHigh( + // _Symbol, + // _Period, + // crossOverBarIndex + // ); + + // // + // PrepareZigZagState(crossOverBarIndex); + // double zigZagDelta = zigZags[1] - zigZags[2]; + // bool isZigZagWaitForHigh = zigZagDelta < 0; + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xrmaLongConds.crossOverTime > xrmaLongConds.crossUnderTime + // + && stateOnCrossOver.slow < stateOnCrossUnder.slow + // + && MathAbs(stateOnCrossOver.fast - stateOnCrossOver.slow) > (70 * _Point) + // + && maC >= stateOnCrossOver.slow + // // + // && !(rmaOnCrossOver < stateOnCrossOver.slow) + // // + // && MathAbs(rmaOnCrossOver - rmaOnMarketLength) < (600 * _Point) + // // + // && !isZigZagWaitForHigh + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRMALongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRMALongSignalConditions() { + // + xrmaLongConds.crossOverTime = 0; + xrmaLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXRMALongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.shp.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.shp.signal.lib.mq4 new file mode 100644 index 0000000..dd0f767 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.shp.signal.lib.mq4 @@ -0,0 +1,391 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 SHP Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// SHP Based Signal Conditions ... +struct XSHPLongSignalConditions { + // + datetime start; + datetime stop; +}; + +// +static XSHPLongSignalConditions shpLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckSHPLongSignalConditions( + const int bar_index, + const int marketLen, + const double shpDetectMult, + const double smoother = 30 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double mHH = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double mLL = GetMarketLowestLow( + bar_index, + marketLen + ); + + double m2LL = GetMarketLowestLow( + bar_index, + marketLen * 2 + ); + + // + int mHLIdx = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + datetime mHLTime = iTime( + _Symbol, + _Period, + mHLIdx + ); + double mHL = iHigh( + _Symbol, + _Period, + mHLIdx + ); + + // + double hlDiff = (mHL - mLL); + double sharpDetectValue = shpDetectMult * _Point; + + // + bool isSharpDetected = + // ( + // low == mLL + // || MathAbs(mLL - low) < (smoother * _Point) + // ) + // && + // !( + // mLL > m2LL + // && MathAbs(m2LL - mLL) > sharpDetectValue / 2 + // ) + // && + ( + hlDiff > sharpDetectValue + || hlDiff > sharpDetectValue - (smoother * _Point) + ) + ; + + // + if (isSharpDetected) { + // + shpLongConds.start = mHLTime; + shpLongConds.stop = barTime; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateSHPLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMultiplier // Sharp Detect Multiplier ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateSHPLongConditions(shpDetectMultiplier)) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // ll; + + // + // this means Market Lowest Low ... + double shpValue = shpDetectMultiplier * _Point; + if ( + reward == 0 + || reward < 20 * _Point + ) { + reward = shpValue; + } + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_SHP_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_SHP_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateSHPLongConditions( + const double shpDetectMultiplier +) { + // + double shpDetectValue = shpDetectMultiplier * _Point; + + // + bool isConditionsFilled = + shpLongConds.stop != 0 + && shpLongConds.start != 0 + && shpLongConds.stop > shpLongConds.start + ; + + // + bool isBLFilled = true; + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearSHPLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearSHPLongSignalConditions() { + // + shpLongConds.stop = 0; + shpLongConds.start = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForSHPLongSignals( + const XSignal &signal, + const XState &states[] +) { + // + bool result = false; + + // + XStateInfo info = ParseXMAStates(states); + + // + int xmaMarketLen = ArraySize(states); + double mHH = GetMarketHighestHigh(0, xmaMarketLen); + double m2HH = GetMarketHighestHigh(0, (int) (xmaMarketLen * 1.5)); + + // + int lcUpDownTouches = 0; + int cciHundredTouches = 0; + for (int i = 0; i < xmaMarketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + double up = MathMax(states[i].lc.fast, states[i].lc.slow); + double down = MathMax(states[i].lc.fast, states[i].lc.slow); + + // + if (high >= up && low <= down) { + lcUpDownTouches++; + } + + // + if ( + i < xmaMarketLen - 1 + && i < 10 + ) { + if ( + states[i].cci < 100 + && states[i + 1].cci > 100 + ) { + cciHundredTouches++; + } + } + } + + // + result = + // + true + // + && states[0].mc.fast > states[0].mc.slow + && states[0].lc.fast > states[0].lc.slow + // + && states[0].sc.fast < states[0].sc.slow + && states[1].sc.fast < states[1].sc.slow + // + && states[0].marketMiddleage < states[0].sc.fast + && states[1].marketMiddleage < states[1].sc.fast + && !( + states[1].sc.fast < states[1].mc.fast + && states[1].sc.slow < states[1].mc.fast + && states[1].sc.fast > states[1].mc.slow + && states[1].sc.slow > states[1].mc.slow + ) + && !( + states[0].marketMiddleage < states[0].mc.fast + && states[0].marketMiddleage > states[0].mc.slow + ) + // + && mHH != m2HH + && lcUpDownTouches == 0 + && cciHundredTouches == 0 + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..2b4fa56 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1456 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) + { + case X_XXX_PROVIDER: + result = "XXX"; + break; + + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, + "_", GetProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + // + // ClearOSCLongSignalConditions(); + // ClearCCILongSignalConditions(); + // ClearSHPLongSignalConditions(); + // ClearXRMALongSignalConditions(); + // // + // ClearXMASCLongSignalConditions(); + // ClearXMAMCLongSignalConditions(); + // ClearXMAMMLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..755df37 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,678 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; +}; + +// +static XSignalConditions xLongConds; +static XSignalConditions xShortConds; + +// +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; +static datetime xWaitForLongSignalChangeTime; + +// +static bool xWaitForShortSignals = true; +static bool xCloseShortTrades = false; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // // + // bool isCrossUnder = + // states[1].osc.fast < states[1].osc.slow + // && !(states[2].osc.fast < states[2].osc.slow) + // ; + + // // + // bool isCrossOver = + // states[1].osc.fast > states[1].osc.slow + // && !(states[2].osc.fast > states[2].osc.slow) + // ; + + // + XOHCL pCandle = GetCandleModel(1); + + // // + // bool isTrendingUp = + // pCandle.low > states[0].bnd.high + // && pCandle.high > states[0].bnd.high; + + // // + // bool isTrendingDown = + // pCandle.high < states[0].bnd.low + // && pCandle.low < states[0].bnd.low; + + // + bool isTrendingUp = + states[1].bnd.open < states[1].bnd.close + && !(states[2].bnd.open < states[2].bnd.close) + ; + + // + bool isTrendingDown = + states[1].bnd.open > states[1].bnd.close + && !(states[2].bnd.open > states[2].bnd.close) + ; + + // + bool isCrossUnder = + isTrendingDown + && !isTrendingUp + ; + + // + bool isCrossOver = + isTrendingUp + && !isTrendingDown + ; + + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + if (xWaitForLongSignals) { + // + bool isLCFastOnTrendingUpTouchLowestLow = + // + // LC Trending Up ... + states[1].lc.fast > states[1].lc.slow + && states[2].lc.fast > states[2].lc.slow + // + // LC Fast Touch Market Lowest Low ... + && states[1].lc.fast > states[1].mkt.lowestLow + && !(states[2].lc.fast > states[2].mkt.lowestLow) + ; + + // + bool isMCSlowCrossOverBNDHigh = + states[1].mc.fast > states[1].mc.slow + && states[1].mc.slow > states[1].bnd.high + && !(states[2].mc.slow > states[2].bnd.high) + ; + + // + // Disable Long Trade Handlers ... + if ( + isMCSlowCrossOverBNDHigh + || isLCFastOnTrendingUpTouchLowestLow + ) { + // + xWaitForLongSignals = false; + xWaitForLongSignalChangeTime = TimeCurrent(); + LogMessage("Disable Long ..."); + } + } else { + // + bool isAllTrendingUp = + // + // SC ... + states[1].sc.fast > states[1].sc.slow + // + // MC ... + && states[1].mc.fast > states[1].mc.slow + && !(states[2].mc.fast > states[2].mc.slow) + // + // LC ... + && states[1].lc.fast > states[1].lc.slow + ; + + // + int lastWaitChangeBarIndex = iBarShift( + _Symbol, + _Period, + xWaitForLongSignalChangeTime + ); + + // + // Enable Long Trade Handlers ... + if ( + isAllTrendingUp + && lastWaitChangeBarIndex - bar_index >= marketLen + ) { + xWaitForLongSignals = true; + LogMessage("Enable Long ..."); + } + } + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossUnder = + false; + + // + bool isCrossOver = + false; + + // // + // bool isCrossUnder = + // states[1].osc.fast < states[1].osc.slow + // && !(states[2].osc.fast < states[2].osc.slow) + // ; + + // // + // bool isCrossOver = + // states[1].osc.fast > states[1].osc.slow + // && !(states[2].osc.fast > states[2].osc.slow) + // ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const XState &states[], + // + const double smoother = 5 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double hh = + GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * r2r; // risk * r2r; // 300 * _Point; + // if (risk > (500 * _Point)) { + // reward = 300 * _Point; + // } + + // + double sl = 0; // ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = type; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XXX_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +bool ValidateXShortConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 5 +) { + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal, + const XState &states[], + const int marketLen, + // + double smoother = 100 +) { + // + bool result = false; + + // + bool isSCTrendUp = + states[1].sc.fast > states[1].sc.slow + && states[2].sc.fast > states[2].sc.slow; + + // // + // bool isSCTrendDown = + // states[1].sc.fast < states[1].sc.slow + // && states[2].sc.fast < states[2].sc.slow; + + // + bool isMCTrendUp = + states[1].mc.fast > states[1].mc.slow + && states[2].mc.fast > states[2].mc.slow; + + // // + // bool isMCTrendDown = + // states[1].mc.fast < states[1].mc.slow + // && states[2].mc.fast < states[2].mc.slow; + + // + bool isLCTrendUp = + states[1].lc.fast > states[1].lc.slow + && states[2].lc.fast > states[2].lc.slow; + + // // + // bool isLCTrendDown = + // states[1].lc.fast < states[1].lc.slow + // && states[2].lc.fast < states[2].lc.slow; + + // // + // bool isTrendingUp = + // pCandle.low > states[0].bnd.high + // && pCandle.high > states[0].bnd.high; + + // // + // bool isTrendingDown = + // pCandle.high < states[0].bnd.low + // && pCandle.low < states[0].bnd.low; + + // + XOHCL candle = GetCandleModel(0); + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + // Starter ... + true + // + // Trending State ... + && isSCTrendUp + && isMCTrendUp + && isLCTrendUp + // + // Checking Signal Entry ... + && ( + signal.entry < candle.high + || signal.entry < states[0].mkt.highestHigh + ) + // + // Checking Signal TP ... + && ( + signal.tp < states[1].longCycleHighestHigh + && MathAbs(states[1].longCycleHighestHigh - signal.tp) > 100 * _Point + ) + // + // Checking Market Sharpness ... + && + ( + pCandle.high < states[1].longCycleHighestHigh + && !(MathAbs(states[1].longCycleHighestHigh - pCandle.high) < 20 * _Point) + ) + // + // Checking Special Conditions ... + // Condition 1 ... + && ( + states[1].lc.fast > states[1].mc.fast + && states[1].lc.slow > states[1].mc.fast + ? + states[1].lc.slow < states[1].mkt.lowestLow + : + true + ) + // + // Condition 2 ... + && !( + states[1].lc.fast > states[1].mkt.highestHigh + && states[1].lc.slow < states[1].mkt.lowestLow + ) + // + // Condition 3 ... + && MathAbs(states[1].sc.fast - states[1].sc.slow) > 20 * _Point + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.xma.mc.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.xma.mc.signal.lib.mq4 new file mode 100644 index 0000000..13b787e --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.xma.mc.signal.lib.mq4 @@ -0,0 +1,490 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMCLongSignalConditions { + // + datetime mcFastCrossUnderSlowTime; + double crossUnderMCFast; + double crossUnderMCSlow; + + // + datetime mcFastCrossOverSlowTime; + double crossOverMCFast; + double crossOverMCSlow; + + // + datetime mcFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMAMCLongSignalConditions xmaMCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState mcs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + mcs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState mc = GetXMAMC( + i, + marketLen, + mcFMult, + mcSMult + ); + mcs[index] = mc; + + // + index++; + } + + // + bool isMCFastCrossUnderSlow = + mcs[0].fast < mcs[0].slow + && !(mcs[1].fast <= mcs[1].slow) + ; + bool isMCFastCrossOverSlow = + mcs[0].fast > mcs[0].slow + && !(mcs[1].fast >= mcs[1].slow) + ; + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossUnderSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + ) { + // + ClearXMAMCLongSignalConditions(); + + // + xmaMCLongConds.crossUnderMCFast = mcs[0].fast; + xmaMCLongConds.crossUnderMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isMCFastCrossOverSlow + && xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime == 0 + ) { + // + xmaMCLongConds.crossOverMCFast = mcs[0].fast; + xmaMCLongConds.crossOverMCSlow = mcs[0].slow; + xmaMCLongConds.mcFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaMCLongConds.mcFastCrossUnderSlowTime > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime > 0 + && mcs[0].fast > xmaMCLongConds.crossUnderMCSlow + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r, // Risk to Reward ratio ... + const double shpDetectMult, + const double smoother = 50 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !ValidateXMAMCLongConditions( + marketLen, + shpDetectMult, + smoother + ) + ) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + 3 + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMCLongConditions( + const int marketLen, + const double shpDetectMult, + const double smoother = 50 +) { + // + bool isConditionsFilled = + xmaMCLongConds.crossOverMCSlow > 0 + && xmaMCLongConds.crossOverMCFast > 0 + && xmaMCLongConds.crossUnderMCFast > 0 + && xmaMCLongConds.crossUnderMCSlow > 0 + && xmaMCLongConds.mcFastCrossOverSlowTime != 0 + && xmaMCLongConds.mcFastCrossUnderSlowTime != 0 + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime != 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastCrossUnderSlowTime + ); + + // + int crossOverAndBiggerBarIndex = iBarShift( + _Symbol, + _Period, + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime + ); + + // + int cycleMarketLen = MathMin( + MathAbs(crossUnderBarIndex - crossOverAndBiggerBarIndex), + marketLen * 2 + ); + double hh = GetMarketHighestHigh( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + double ll = GetMarketLowestLow( + crossOverAndBiggerBarIndex, + cycleMarketLen + ); + + // + double high = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + ); + double pcHigh = iHigh( + _Symbol, + _Period, + crossOverAndBiggerBarIndex + 1 + ); + + // + double diff = (hh - ll); + double shpValue = shpDetectMult * _Point; + + // + bool isPriceRegular = + // + true + // + && + ( + diff < shpValue + || diff < shpValue - (smoother * _Point) + ) + && + !( + high == hh + || pcHigh == hh + || MathAbs(hh - high) < (smoother * _Point) + || MathAbs(hh - pcHigh) < (smoother * _Point) + ) + ; + + // + // LogMessage("Price Regular: " + isPriceRegular); + + // + isBLFilled = + isPriceRegular + && xmaMCLongConds.mcFastCrossUnderSlowTime < xmaMCLongConds.mcFastCrossOverSlowTime + && xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime >= xmaMCLongConds.mcFastCrossUnderSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMCLongSignalConditions() { + // + xmaMCLongConds.mcFastCrossUnderSlowTime = 0; + xmaMCLongConds.crossUnderMCFast = 0; + xmaMCLongConds.crossUnderMCSlow = 0; + + // + xmaMCLongConds.mcFastCrossOverSlowTime = 0; + xmaMCLongConds.crossOverMCFast = 0; + xmaMCLongConds.crossOverMCSlow = 0; + + // + xmaMCLongConds.mcFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + int countRangedCandles = 0; + bool isMarketRanging = false; + for (int i = 1; i < marketLen; i++) { + // + double high = iHigh( + _Symbol, + _Period, + i + ); + + // + double low = iLow( + _Symbol, + _Period, + i + ); + + // + bool isRanging = + // + high > states[i].mc.fast + && high > states[i].mc.slow + // + && low < states[i].mc.fast + && low < states[i].mc.slow + ; + if (isRanging) { + countRangedCandles++; + } + } + + // + XStateInfo info = ParseXMAStates(states); + double mmSlope = GetSlope( + 1, + states[1].marketMiddleage, + 2, + states[0].marketMiddleage + ); + double mmSlope1 = GetSlope( + 1, + states[2].marketMiddleage, + 2, + states[1].marketMiddleage + ); + double mmSlopeDiff = mmSlope - mmSlope1; + + // + isMarketRanging = countRangedCandles > 0; + + // + result = + // + true + // + && mmSlope > 0 + && mmSlope1 > 0 + && mmSlopeDiff > 0 + && !isMarketRanging + && states[0].marketMiddleage < info.mmMax + ; + // if (result) { + // LogMessage("mmSlope: " + mmSlope + ", mmSlope1: " + mmSlope1 + ", Diff: " + mmSlopeDiff); + // } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.xma.mm.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.xma.mm.signal.lib.mq4 new file mode 100644 index 0000000..d883803 --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.xma.mm.signal.lib.mq4 @@ -0,0 +1,338 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMAMMLongSignalConditions { + // + datetime crossUnderTime; + + // + datetime crossOverTime; +}; + +// +static XMAMMLongSignalConditions xmaMMLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMAMMLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult, + // + int lcFMult, + int lcSMult, + // + const double smoother = 5 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XState states[]; + ArrayResize( + states, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < marketLen; i++) { + // + XState state = GetXState( + i, + marketLen, + // + stp, + mxm, + scFMult, + scSMult, + mcFMult, + mcSMult, + lcFMult, + lcSMult + ); + + // + states[index] = state; + + // + index++; + } + + // + bool isCrossUnder = + states[1].marketMiddleage < states[1].sc.fast + && !(states[2].marketMiddleage < states[2].sc.fast) + ; + + // + bool isCrossOver = + states[1].marketMiddleage > states[1].sc.fast + && !(states[2].marketMiddleage > states[2].sc.fast) + ; + + // + if ( + isCrossUnder + && xmaMMLongConds.crossUnderTime == 0 + ) { + // + xmaMMLongConds.crossUnderTime = barTime; + return; + } + + // + if ( + isCrossOver + && xmaMMLongConds.crossUnderTime > 0 + && xmaMMLongConds.crossOverTime == 0 + ) { + // + xmaMMLongConds.crossOverTime = barTime; + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMAMMLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMAMMLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = 300 * _Point; // risk * r2r; + + // + double sl = 0; // entryPrice - (300 * _Point); // ll; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMAMMLongConditions() { + // + bool isConditionsFilled = + true + && xmaMMLongConds.crossOverTime > 0 + && xmaMMLongConds.crossUnderTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int crossOverBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossOverTime + ); + + // + int crossUnderBarIndex = iBarShift( + _Symbol, + _Period, + xmaMMLongConds.crossUnderTime + ); + + // + isBLFilled = + true + // + && (crossUnderBarIndex - crossOverBarIndex) > 5 + // + && xmaMMLongConds.crossOverTime > xmaMMLongConds.crossUnderTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMAMMLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMAMMLongSignalConditions() { + // + xmaMMLongConds.crossOverTime = 0; + xmaMMLongConds.crossUnderTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMAMMLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + // && states[0].parabolicSAR < states[0].marketMiddleage + // && !( + // states[0].parabolicSAR < states[0].mc.fast + // && states[0].parabolicSAR < states[0].mc.slow + // ) + // + // && states[0].mc.fast > states[0].mc.slow + // + // && MathAbs(states[0].mc.fast - states[0].mc.slow) > (150 * _Point) + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020428/Libraries/x-saherelm.xma.sc.signal.lib.mq4 b/Bkp/Used/14020428/Libraries/x-saherelm.xma.sc.signal.lib.mq4 new file mode 100644 index 0000000..218759c --- /dev/null +++ b/Bkp/Used/14020428/Libraries/x-saherelm.xma.sc.signal.lib.mq4 @@ -0,0 +1,360 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XMA Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// XMA Based Signal Conditions ... +struct XMASCLongSignalConditions { + // + datetime scFastCrossUnderSlowTime; + double crossUnderSCFast; + double crossUnderSCSlow; + + // + datetime scFastCrossOverSlowTime; + double crossOverSCFast; + double crossOverSCSlow; + + // + datetime scFastBiggerThanCrossUnderSlowTime; +}; + +// +static XMASCLongSignalConditions xmaSCLongConds; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill CC Signal Conditions ... +void CheckXMASCLongSignalConditions( + const int bar_index, + const int marketLen, + // + double stp, + double mxm, + // + int scFMult, + int scSMult, + // + int mcFMult, + int mcSMult +) { + // + XCycleState scs[]; + int positionsMarketLen = bar_index + marketLen; + + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Resize Arrays ... + ArrayResize( + scs, + marketLen + ); + + // + int index = 0; + for (int i = bar_index; i < positionsMarketLen; i++) { + // + XCycleState sc = GetXMASC( + i, + marketLen, + scFMult, + scSMult + ); + scs[index] = sc; + + // + index++; + } + + // + bool isSCFastCrossUnderSlow = + scs[0].fast < scs[0].slow + && !(scs[1].fast <= scs[1].slow) + ; + bool isSCFastCrossOverSlow = + scs[0].fast > scs[0].slow + && !(scs[1].fast >= scs[1].slow) + ; + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.crossUnderSCFast = scs[0].fast; + xmaSCLongConds.crossUnderSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossOverSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime == 0 + ) { + // + xmaSCLongConds.crossOverSCFast = scs[0].fast; + xmaSCLongConds.crossOverSCSlow = scs[0].slow; + xmaSCLongConds.scFastCrossOverSlowTime = barTime; + return; + } + + // + if ( + xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + && scs[0].fast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime == 0 + ) { + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = barTime; + return; + } + + // + if ( + isSCFastCrossUnderSlow + && xmaSCLongConds.scFastCrossUnderSlowTime > 0 + && xmaSCLongConds.scFastCrossOverSlowTime > 0 + ) { + // + ClearXMASCLongSignalConditions(); + return; + } +} + +// +// Convert XMA Long Signal Conditions to XSignal ... +XSignalRequest GenerateXMASCLongSignal( + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const double r2r // Risk to Reward ratio ... + // + // const double shpDetectMultiplier +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!ValidateXMASCLongConditions()) { + return result; + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double entryPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double exitPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // // + // double sharpDetectValue = shpDetectMultiplier * _Point; + // double lowPrice = iLow( + // _Symbol, + // _Period, + // bar_index + 1 + // ); + + // + double risk = MathMin(openPrice, closePrice) - ll; + double reward = risk * r2r; + + // + double sl = 0; + double tp = entryPrice + reward; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.symbol = _Symbol; + result.signal.type = X_SIGNAL_LONG; + result.signal.id = totalSignals + 1; + result.signal.entry = entryPrice; + result.signal.provider = X_XMA_PROVIDER; + result.signal.time = barTime; + + // + result.hasSignal = true; + result.type = X_SIGNAL_LONG; + result.provider = X_XMA_PROVIDER; + + // + return result; +} + +// +// Validate XMA Signal Conditions ... +bool ValidateXMASCLongConditions() { + // + bool isConditionsFilled = + xmaSCLongConds.crossOverSCSlow > 0 + && xmaSCLongConds.crossOverSCFast > 0 + && xmaSCLongConds.crossUnderSCFast > 0 + && xmaSCLongConds.crossUnderSCSlow > 0 + && xmaSCLongConds.scFastCrossOverSlowTime != 0 + && xmaSCLongConds.scFastCrossUnderSlowTime != 0 + && xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime !=0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + xmaSCLongConds.crossOverSCFast > xmaSCLongConds.crossUnderSCSlow + && xmaSCLongConds.scFastCrossUnderSlowTime < xmaSCLongConds.scFastCrossOverSlowTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXMASCLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXMASCLongSignalConditions() { + // + xmaSCLongConds.crossUnderSCFast = 0; + xmaSCLongConds.crossUnderSCSlow = 0; + xmaSCLongConds.scFastCrossUnderSlowTime = 0; + + // + xmaSCLongConds.crossOverSCFast = 0; + xmaSCLongConds.crossOverSCSlow = 0; + xmaSCLongConds.scFastCrossOverSlowTime = 0; + + // + xmaSCLongConds.scFastBiggerThanCrossUnderSlowTime = 0; +} + +// +// Check XMA State for Long Signals ... +bool IsReadyForXMASCLongSignals( + const XSignal &signal, + const XState &states[], + const int marketLen +) { + // + bool result = false; + + // + result = + // + true + // + && states[0].sc.fast > states[0].sc.slow + && states[1].sc.fast > states[1].sc.slow + ; + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020430/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/14020430/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/14020430/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020430/Indicators/x-saherelm.volume.mq4 b/Bkp/Used/14020430/Indicators/x-saherelm.volume.mq4 new file mode 100644 index 0000000..54bed44 --- /dev/null +++ b/Bkp/Used/14020430/Indicators/x-saherelm.volume.mq4 @@ -0,0 +1,270 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center Volume Indicator +// ------------------------------------------------------------- +// this indicator provides Volume ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Volume Indicator" +#property strict + +// +// START Inputs ... +// +input int length = 11; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 3 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 3 + +// +// Buy Volume ... +#property indicator_width1 1 +#property indicator_color1 clrGreen +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_style1 STYLE_DOT + +// +// Sell Volume ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT + +// +// Diff ... +#property indicator_width3 1 +#property indicator_type3 DRAW_HISTOGRAM +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define buyVolumeBufferIndex 0 +#define sellVolumeBufferIndex 1 +#define diffBufferIndex 2 + +// +double buyVolumeBuffer[]; +double sellVolumeBuffer[]; +double diffBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // Buy Volume Buffer ... + SetIndexBuffer(buyVolumeBufferIndex, buyVolumeBuffer); + SetIndexLabel(buyVolumeBufferIndex, "Buy Volume"); + + // + // Sell Volume Buffer ... + SetIndexBuffer(sellVolumeBufferIndex, sellVolumeBuffer); + SetIndexLabel(sellVolumeBufferIndex, "Sell Volume"); + + // + // Diff Buffer ... + SetIndexBuffer(diffBufferIndex, diffBuffer); + SetIndexLabel(diffBufferIndex, "Diff"); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_VOLUME"; + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateBuffers( + open, + close, + high, + low, + i + ); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateBuffers( + const double &open[], + const double &close[], + const double &high[], + const double &low[], + const int &bar_index +) { + // + long volume = iVolume( + _Symbol, + _Period, + bar_index + ); + + // + double buyVolume = 0.0; + double sellVolume = 0.0; + + // + // Up ... + if (close[bar_index] > open[bar_index]) { + // + double cuenta = (high[bar_index] - low[bar_index]) * 10000; + double cuenta1 = volume - cuenta; + + // + buyVolume = ((volume - cuenta) / 2) + cuenta; + + // + buyVolumeBuffer[bar_index] = buyVolume; + sellVolumeBuffer[bar_index] = volume - buyVolume; + } else + // + // Down ... + if (close[bar_index] < open[bar_index]) { + // + double cuenta1 = (high[bar_index] - low[bar_index]) * 10000; + double cuenta = volume - cuenta1; + + // + sellVolume = ((volume - cuenta1) / 2) + cuenta1; + + // + sellVolumeBuffer[bar_index] = sellVolume; + buyVolumeBuffer[bar_index] = volume - sellVolume; + } else + // + // Neutral ... + if (close[bar_index] == open[bar_index]) { + // + double cuenta = (volume / 2) * 1.0; + + // + sellVolumeBuffer[bar_index] = cuenta; + buyVolumeBuffer[bar_index] = volume - cuenta; + } + + // + diffBuffer[bar_index] = MathAbs(buyVolumeBuffer[bar_index]) - MathAbs(sellVolumeBuffer[bar_index]); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020430/Indicators/x-saherelm.xmarket.mq4 b/Bkp/Used/14020430/Indicators/x-saherelm.xmarket.mq4 new file mode 100644 index 0000000..71b2e2c --- /dev/null +++ b/Bkp/Used/14020430/Indicators/x-saherelm.xmarket.mq4 @@ -0,0 +1,394 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMKT Indicator +// --------------------------------------------- +// retrieve market base info ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMKT Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +// +input bool showHighestHigh = true; // Show Market Highest High +input bool showHighestLow = true; // Show Market Highest Low +input bool showHighestOpen = true; // Show Market Highest Open +input bool showHighestClose = true; // Show Market Highest Close +input bool showLowestHigh = true; // Show Market Lowest High +input bool showLowestLow = true; // Show Market Lowest Low +input bool showLowestOpen = true; // Show Market Lowest Open +input bool showLowestClose = true; // Show Market Lowest Close +// +input color highestHighColor = clrDeepPink; // Market Highest High Color +input color highestLowColor = clrDarkOrange; // Market Highest Low Color +input color highestOpenColor = clrDodgerBlue; // Market Highest Open Color +input color highestCloseColor = clrOrchid; // Market Highest Close Color +input color lowestHighColor = clrHotPink; // Market Lowest High Color +input color lowestLowColor = clrOrange; // Market Lowest Low Color +input color lowestOpenColor = clrPowderBlue; // Market Lowest Open Color +input color lowestCloseColor = clrMediumOrchid; // Market Lowest Close Color +// +input ENUM_LINE_STYLE highestHighStyle = STYLE_DOT; // Market Highest High Line Style +input ENUM_LINE_STYLE highestLowStyle = STYLE_DOT; // Market Highest Low Line Style +input ENUM_LINE_STYLE highestOpenStyle = STYLE_DOT; // Market Highest Open Line Style +input ENUM_LINE_STYLE highestCloseStyle = STYLE_DOT; // Market Highest Close Line Style +input ENUM_LINE_STYLE lowestHighStyle = STYLE_DOT; // Market Lowest High Line Style +input ENUM_LINE_STYLE lowestLowStyle = STYLE_DOT; // Market Lowest Low Line Style +input ENUM_LINE_STYLE lowestOpenStyle = STYLE_DOT; // Market Lowest Open Line Style +input ENUM_LINE_STYLE lowestCloseStyle = STYLE_DOT; // Market Lowest Close Line Style +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Declare Buffers ... +#define marketHighestHighBufferIndex 0 +#define marketHighestLowBufferIndex 1 +#define marketHighestOpenBufferIndex 2 +#define marketHighestCloseBufferIndex 3 +#define marketLowestHighBufferIndex 4 +#define marketLowestLowBufferIndex 5 +#define marketLowestOpenBufferIndex 6 +#define marketLowestCloseBufferIndex 7 + +// +double marketHighestHighBuffer[]; +double marketHighestLowBuffer[]; +double marketHighestOpenBuffer[]; +double marketHighestCloseBuffer[]; +double marketLowestHighBuffer[]; +double marketLowestLowBuffer[]; +double marketLowestOpenBuffer[]; +double marketLowestCloseBuffer[]; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMKT"; + + // + // Highest High ... + string highestHighLbl = StringConcatenate("HH(", marketLength,")"); + SetIndexLabel(marketHighestHighBufferIndex, highestHighLbl); + SetIndexBuffer(marketHighestHighBufferIndex, marketHighestHighBuffer); + SetIndexStyle( + marketHighestHighBufferIndex, + showHighestHigh ? + DRAW_LINE : + DRAW_NONE, + highestHighStyle, + 1, + showHighestHigh ? + highestHighColor : + clrNONE + ); + + // + // Highest Low ... + string highestLowLbl = StringConcatenate("HL(", marketLength,")"); + SetIndexLabel(marketHighestLowBufferIndex, highestLowLbl); + SetIndexBuffer(marketHighestLowBufferIndex, marketHighestLowBuffer); + SetIndexStyle( + marketHighestLowBufferIndex, + showHighestLow ? + DRAW_LINE : + DRAW_NONE, + highestLowStyle, + 1, + showHighestLow ? + highestLowColor : + clrNONE + ); + + // + // Highest Open ... + string highestOpenLbl = StringConcatenate("HO(", marketLength,")"); + SetIndexLabel(marketHighestOpenBufferIndex, highestOpenLbl); + SetIndexBuffer(marketHighestOpenBufferIndex, marketHighestOpenBuffer); + SetIndexStyle( + marketHighestOpenBufferIndex, + showHighestOpen ? + DRAW_LINE : + DRAW_NONE, + highestOpenStyle, + 1, + showHighestOpen ? + highestOpenColor : + clrNONE + ); + + // + // Highest Close ... + string highestCloseLbl = StringConcatenate("HC(", marketLength,")"); + SetIndexLabel(marketHighestCloseBufferIndex, highestCloseLbl); + SetIndexBuffer(marketHighestCloseBufferIndex, marketHighestCloseBuffer); + SetIndexStyle( + marketHighestCloseBufferIndex, + showHighestClose ? + DRAW_LINE : + DRAW_NONE, + highestCloseStyle, + 1, + showHighestClose ? + highestCloseColor : + clrNONE + ); + + // + // Lowest High ... + string lowestHighLbl = StringConcatenate("LH(", marketLength,")"); + SetIndexLabel(marketLowestHighBufferIndex, lowestHighLbl); + SetIndexBuffer(marketLowestHighBufferIndex, marketLowestHighBuffer); + SetIndexStyle( + marketLowestHighBufferIndex, + showLowestHigh ? + DRAW_LINE : + DRAW_NONE, + lowestHighStyle, + 1, + showLowestHigh ? + lowestHighColor : + clrNONE + ); + + // + // Lowest Low ... + string lowestLowLbl = StringConcatenate("LL(", marketLength,")"); + SetIndexLabel(marketLowestLowBufferIndex, lowestLowLbl); + SetIndexBuffer(marketLowestLowBufferIndex, marketLowestLowBuffer); + SetIndexStyle( + marketLowestLowBufferIndex, + showLowestLow ? + DRAW_LINE : + DRAW_NONE, + lowestLowStyle, + 1, + showLowestLow ? + lowestLowColor : + clrNONE + ); + + // + // Lowest Open ... + string lowestOpenLbl = StringConcatenate("LO(", marketLength,")"); + SetIndexLabel(marketLowestOpenBufferIndex, lowestOpenLbl); + SetIndexBuffer(marketLowestOpenBufferIndex, marketLowestOpenBuffer); + SetIndexStyle( + marketLowestOpenBufferIndex, + showLowestOpen ? + DRAW_LINE : + DRAW_NONE, + lowestOpenStyle, + 1, + showLowestOpen ? + lowestOpenColor : + clrNONE + ); + + // + // Lowest Close ... + string lowestCloseLbl = StringConcatenate("LC(", marketLength,")"); + SetIndexLabel(marketLowestCloseBufferIndex, lowestCloseLbl); + SetIndexBuffer(marketLowestCloseBufferIndex, marketLowestCloseBuffer); + SetIndexStyle( + marketLowestCloseBufferIndex, + showLowestClose ? + DRAW_LINE : + DRAW_NONE, + lowestCloseStyle, + 1, + showLowestClose ? + lowestCloseColor : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, 3); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateBuffers( + const int bar_index +) { + // + // Highest High ... + double highestHighValue = GetMarketHighestHigh( + bar_index, + marketLength + ); + marketHighestHighBuffer[bar_index] = highestHighValue; + + // + // Highest Low ... + double highestLowValue = GetMarketHighestLow( + bar_index, + marketLength + ); + marketHighestLowBuffer[bar_index] = highestLowValue; + + // + // Highest Open ... + double highestOpenValue = GetMarketHighestOpen( + bar_index, + marketLength + ); + marketHighestOpenBuffer[bar_index] = highestOpenValue; + + // + // Highest Close ... + double highestCloseValue = GetMarketHighestClose( + bar_index, + marketLength + ); + marketHighestCloseBuffer[bar_index] = highestCloseValue; + + // + // Lowest High ... + double lowestHighValue = GetMarketLowestHigh( + bar_index, + marketLength + ); + marketLowestHighBuffer[bar_index] = lowestHighValue; + + // + // Lowest Low ... + double lowestLowValue = GetMarketLowestLow( + bar_index, + marketLength + ); + marketLowestLowBuffer[bar_index] = lowestLowValue; + + // + // Lowest Open ... + double lowestOpenValue = GetMarketLowestOpen( + bar_index, + marketLength + ); + marketLowestOpenBuffer[bar_index] = lowestOpenValue; + + // + // Lowest Close ... + double lowestCloseValue = GetMarketLowestClose( + bar_index, + marketLength + ); + marketLowestCloseBuffer[bar_index] = lowestCloseValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020430/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/14020430/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..b79b724 --- /dev/null +++ b/Bkp/Used/14020430/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_ZG"; + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020431/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..742c3ec --- /dev/null +++ b/Bkp/Used/14020431/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,839 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio +// input double maxTPMultiplier = 1000; // Max Allowed TP + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.03; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 252; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// Indicators ... +// +// CCI Inputs ... +input double step = 0.01; // SAR Step +input double maximum = 0.1; // SAR Maximum + +// +// XMA Inputs ... +// +input int shortCycleMultiplier = 2; // Short Cycle Fast Multiplier +input int mediumCycleMultiplier = 6; // Medium Cycle Fast Multiplier +input int longCycleMultiplier = 36; // Long Cycle Fast Multiplier + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleMultiplier <= 0 + // + // Validate Medium Cycle ... + || mediumCycleMultiplier <= 0 + // + // Validate Long Cycle ... + || longCycleMultiplier <= 0 + // + // Validate Series of Multipliers ... + || shortCycleMultiplier >= mediumCycleMultiplier + || mediumCycleMultiplier >= longCycleMultiplier + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + ClearSignalConditions(); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < longCycleMultiplier * marketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // // + // if (isPositionOpened) { + // // + // int rangeMarketLength = marketLength * longCycleMultiplier; + // XRange range = GetMarketRange( + // 0, + // rangeMarketLength, + // marketLength + // ); + + // // + // DrawRange( + // range, + // 0, + // 0, + // signalPrefix + // ); + // } + + // // + // double fibLevel = 1.618; + // double fibLevelPrice = GetFibonacciLevel( + // request.signal.tp, + // request.signal.entry, + // fibLevel, + // 1 + // ); + // string lbl = StringConcatenate( + // request.signal.tag, + // "_FIB_", + // fibLevel, + // "_", + // fibLevelPrice + // ); + + // // + // datetime time1 = iTime( + // _Symbol, + // _Period, + // 1 + // ); + + // // + // datetime time2 = iTime( + // _Symbol, + // _Period, + // 0 + // ); + + // // + // DrawTrendLine( + // 0, + // lbl, + // 0, + // time1, + // fibLevelPrice, + // time2, + // fibLevelPrice, + // clrYellow, + // STYLE_DOT + // ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + } + } + + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Retrieve XMA States ... + // based on medium cycle slow ... + XState states[]; + ArrayFree(states); + ArrayResize( + states, + marketLength + ); + + // + int index = 0; + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + states[index] = GetXState( + i, + marketLength, + // + step, + maximum, + // + shortCycleMultiplier, + mediumCycleMultiplier, + longCycleMultiplier + ); + + // + index++; + } + + // + CheckSignalHandler( + bar_index, + marketLength, + states + ); + + // + CheckXLongSignalConditions( + bar_index, + marketLength, + states + ); + + // + XSignalRequest xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index, + marketLength, + longCycleMultiplier, + riskToRewardRatio, + states + ); + + // // + // CheckXShortSignalConditions( + // bar_index, + // marketLength, + // states + // ); + + // // + // XSignalRequest xShortSignalRequest = GenerateXSignal( + // X_SIGNAL_SHORT, + // signalPrefix, + // bar_index, + // marketLength, + // longCycleMultiplier, + // riskToRewardRatio, + // states + // ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal, + states, + marketLength, + // + shortCycleMultiplier, + mediumCycleMultiplier, + longCycleMultiplier + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + // } else if (xShortSignalRequest.hasSignal) { + // // + // // Here we can Check and Filter Signals Based On State ... + // bool isReady = IsReadyForXSignals( + // xShortSignalRequest.signal, + // states, + // marketLength, + // // + // shortCycleMultiplier, + // mediumCycleMultiplier, + // longCycleMultiplier + // ); + + // // + // if (isReady) { + // // + // hasShortSignal = true; + // signal = xShortSignalRequest.signal; + // } else { + // ClearXShortSignalConditions(); + // } + } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020431/Experts/x-saherelm.xr.ea.mq4 b/Bkp/Used/14020431/Experts/x-saherelm.xr.ea.mq4 new file mode 100644 index 0000000..9ed9a38 --- /dev/null +++ b/Bkp/Used/14020431/Experts/x-saherelm.xr.ea.mq4 @@ -0,0 +1,720 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 6; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.0003; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.3; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 252; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = false; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + // Draw XRState ... + if (isPositionOpened) { + // + XRState state = GetXRange( + 0 + ); + + // + string lblXRHH = StringConcatenate( + request.signal.tag, + "_XR_HH_", state.hh + ); + + // + // HH ... + DrawTrendLine( + 0, + lblXRHH, + 0, + state.start, + state.hh, + request.signal.time, + state.hh, + clrLime, + STYLE_DASH + ); + + // + string lblXRMID = StringConcatenate( + request.signal.tag, + "_XR_MID_", state.mid + ); + + // + // MID ... + DrawTrendLine( + 0, + lblXRMID, + 0, + state.start, + state.mid, + request.signal.time, + state.mid, + clrYellow, + STYLE_DASHDOT + ); + + // + string lblXRLL = StringConcatenate( + request.signal.tag, + "_XR_LL_", state.ll + ); + + // + // HH ... + DrawTrendLine( + 0, + lblXRLL, + 0, + state.start, + state.ll, + request.signal.time, + state.ll, + clrRed, + STYLE_DASH + ); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // this comes from check state ... + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + } + } + + // + // this comes from check state ... + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + } + } + + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + if (xrCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xrCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + // waitForLongSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + CheckXRSignalHandler( + bar_index + ); + + // + CheckXRLongSignalConditions( + bar_index + ); + + // + XSignalRequest xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020431/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020431/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020431/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Indicators/x-saherelm.x.hl.mq4 b/Bkp/Used/14020431/Indicators/x-saherelm.x.hl.mq4 new file mode 100644 index 0000000..f08a975 --- /dev/null +++ b/Bkp/Used/14020431/Indicators/x-saherelm.x.hl.mq4 @@ -0,0 +1,412 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 6 + +// +#property indicator_plots 6 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Highest High Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Lowest Low Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Highest High Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Lowest Low Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// HH Buffers ... +#define scHHBufferIndex 0 +#define scLLBufferIndex 1 +#define mcHHBufferIndex 2 +#define mcLLBufferIndex 3 +#define lcHHBufferIndex 4 +#define lcLLBufferIndex 5 + +double scHHBuffer[]; +double scLLBuffer[]; +double mcHHBuffer[]; +double mcLLBuffer[]; +double lcHHBuffer[]; +double lcLLBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Highest High and Lowest Low Buffers ... + // + // Short Cycle Highest High ... + string scHHLbl = StringConcatenate( + "SC HH(", shortCycleLength, ")" + ); + SetIndexBuffer(scHHBufferIndex, scHHBuffer); + SetIndexLabel(scHHBufferIndex, scHHLbl); + + // + // Short Cycle Lowest Low ... + string scLLLbl = StringConcatenate( + "SC LL(", shortCycleLength, ")" + ); + SetIndexBuffer(scLLBufferIndex, scLLBuffer); + SetIndexLabel(scLLBufferIndex, scLLLbl); + + // + // Medium Cycle Highest High ... + string mcHHLbl = StringConcatenate( + "MC HH(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcHHBufferIndex, mcHHBuffer); + SetIndexLabel(mcHHBufferIndex, mcHHLbl); + + // + // Medium Cycle Lowest Low ... + string mcLLLbl = StringConcatenate( + "MC LL(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcLLBufferIndex, mcLLBuffer); + SetIndexLabel(mcLLBufferIndex, mcLLLbl); + + // + // Long Cycle Highest High ... + string lcHHLbl = StringConcatenate( + "LC HH(", longCycleLength, ")" + ); + SetIndexBuffer(lcHHBufferIndex, lcHHBuffer); + SetIndexLabel(lcHHBufferIndex, lcHHLbl); + + // + // Long Cycle Lowest Low ... + string lcLLLbl = StringConcatenate( + "LC LL(", longCycleLength, ")" + ); + SetIndexBuffer(lcLLBufferIndex, lcLLBuffer); + SetIndexLabel(lcLLBufferIndex, lcLLLbl); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + // Short Cycle Highest High ... + // + int scHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + shortCycleLength, + bar_index + ); + + // + double scHH = iHigh( + _Symbol, + _Period, + scHHIdx + ); + + // + scHHBuffer[bar_index] = scHH; + + // + // Short Cycle Lowest Low ... + // + int scLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + shortCycleLength, + bar_index + ); + + // + double scLL = iLow( + _Symbol, + _Period, + scLLIdx + ); + + // + scLLBuffer[bar_index] = scLL; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + // Medium Cycle Highest High ... + // + int mcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + mediumCycleLength, + bar_index + ); + + // + double mcHH = iHigh( + _Symbol, + _Period, + mcHHIdx + ); + + // + mcHHBuffer[bar_index] = mcHH; + + // + // Medium Cycle Lowest Low ... + // + int mcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + mediumCycleLength, + bar_index + ); + + // + double mcLL = iLow( + _Symbol, + _Period, + mcLLIdx + ); + + // + mcLLBuffer[bar_index] = mcLL; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + // Long Cycle Highest High ... + // + int lcHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + longCycleLength, + bar_index + ); + + // + double lcHH = iHigh( + _Symbol, + _Period, + lcHHIdx + ); + + // + lcHHBuffer[bar_index] = lcHH; + + // + // Long Cycle Lowest Low ... + // + int lcLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + longCycleLength, + bar_index + ); + + // + double lcLL = iLow( + _Symbol, + _Period, + lcLLIdx + ); + + // + lcLLBuffer[bar_index] = lcLL; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Indicators/x-saherelm.x.range.mq4 b/Bkp/Used/14020431/Indicators/x-saherelm.x.range.mq4 new file mode 100644 index 0000000..1359f57 --- /dev/null +++ b/Bkp/Used/14020431/Indicators/x-saherelm.x.range.mq4 @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XRange Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XRange Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 14; +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_plots 3 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Middle Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +#define highestHighBufferIndex 0 +#define lowestLowBufferIndex 1 +#define middleBufferIndex 2 + +// +double highestHighBuffer[]; +double lowestLowBuffer[]; +double middleBuffer[]; + +// +datetime startTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + string hhLbl = StringConcatenate( + "XR HH(", marketLength, ")" + ); + SetIndexBuffer(highestHighBufferIndex, highestHighBuffer); + SetIndexLabel(highestHighBufferIndex, hhLbl); + + // + string llLbl = StringConcatenate( + "XR LL(", marketLength, ")" + ); + SetIndexBuffer(lowestLowBufferIndex, lowestLowBuffer); + SetIndexLabel(lowestLowBufferIndex, llLbl); + + // + string midLbl = StringConcatenate( + "XR Mid(", marketLength, ")" + ); + SetIndexBuffer(middleBufferIndex, middleBuffer); + SetIndexLabel(middleBufferIndex, midLbl); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculations ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculations ... +void CalculateBuffers( + const int &bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + SetIndicatorBuffersNone(bar_index); + return; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + int startDistance = startBarIndex - bar_index; + if (startDistance < marketLength) { + // + SetIndicatorBuffersNone(bar_index); + return; + } + + // + // Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + bar_index + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + highestHighBuffer[bar_index] = hh; + + // + // Lowest Low ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + bar_index + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + lowestLowBuffer[bar_index] = ll; + + // + // Middle Buffer ... + double mid = (hh + ll) / 2; + middleBuffer[bar_index] = mid; + + // + // Reset Start Time ... + startTime = 0; +} + +// +void SetIndicatorBuffersNone( + const int bar_index +) { + // + int lastBarIndex = bar_index + 1; + + // + double lastHighestHigh; + double lastLowestLow; + + // + // Highest High ... + if (ArraySize(highestHighBuffer) > lastBarIndex) { + lastHighestHigh = highestHighBuffer[lastBarIndex]; + } else { + lastHighestHigh = 0; + } + + // + // Lowest Low ... + if (ArraySize(lowestLowBuffer) > lastBarIndex) { + lastLowestLow = lowestLowBuffer[lastBarIndex]; + } else { + lastLowestLow = 0; + } + + // + highestHighBuffer[bar_index] = lastHighestHigh; + lowestLowBuffer[bar_index] = lastLowestLow; + + // + double mid = (lastHighestHigh + lastLowestLow) / 2; + middleBuffer[bar_index] = mid; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Indicators/x-saherelm.x.xma.mq4 b/Bkp/Used/14020431/Indicators/x-saherelm.x.xma.mq4 new file mode 100644 index 0000000..b8c64d7 --- /dev/null +++ b/Bkp/Used/14020431/Indicators/x-saherelm.x.xma.mq4 @@ -0,0 +1,395 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center X Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm X Indicator" +#property strict + +// +// START Inputs ... +// +// +input int marketLength = 7; // Market Length + +// +input double step = 0.02; // P SAR Step +input double maximum = 0.2; // P SAR Maximum + +// +input int shortCycleMultiplier = 2; // Market Short Cycle Multiplier +input int mediumCycleMultiplier = 6; // Market Medium Cycle Multiplier +input int longCycleMultiplier = 36; // Market Medium Cycle Multiplier + +// +input ENUM_MA_METHOD maMethod = MODE_SMA; // Ma Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 7 + +// +#property indicator_plots 7 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Short Cycle Fast Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Short Cycle Slow Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Medium Cycle Fast Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrAqua +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 + +// +// Medium Cycle Slow Buffer ... +#property indicator_type4 DRAW_LINE +#property indicator_color4 clrFuchsia +#property indicator_style4 STYLE_DOT +#property indicator_width4 1 + +// +// Long Cycle Fast Buffer ... +#property indicator_type5 DRAW_LINE +#property indicator_color5 C'62,82,6' +#property indicator_style5 STYLE_DOT +#property indicator_width5 1 + +// +// Long Cycle Slow Buffer ... +#property indicator_type6 DRAW_LINE +#property indicator_color6 C'255,81,0' +#property indicator_style6 STYLE_DOT +#property indicator_width6 1 + +// +// Parabolic SAR ... +#property indicator_type7 DRAW_LINE +#property indicator_color7 C'0,174,255' +#property indicator_style7 STYLE_DASHDOT +#property indicator_width7 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +// Ma Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define psarBufferIndex 6 + +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double psarBuffer[]; + +// +// Variables ... +int shortCycleLength; +int mediumCycleLength; +int longCycleLength; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 || + shortCycleMultiplier <= 0 || + mediumCycleMultiplier <= 0 || + shortCycleMultiplier > mediumCycleMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + shortCycleLength = shortCycleMultiplier * marketLength; + mediumCycleLength = mediumCycleMultiplier * marketLength; + longCycleLength = longCycleMultiplier * marketLength; + + // + // Ma Buffers ... + // + // Short Cycle ... + string scFLbl = StringConcatenate( + "SC F(", shortCycleLength, ")" + ); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexLabel(scFastBufferIndex, scFLbl); + + // + string scSLbl = StringConcatenate( + "SC S(", shortCycleLength, ")" + ); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexLabel(scSlowBufferIndex, scSLbl); + + // + // Medium Cycle ... + string mcFLbl = StringConcatenate( + "MC F(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexLabel(mcFastBufferIndex, mcFLbl); + + // + string mcSLbl = StringConcatenate( + "MC S(", mediumCycleLength, ")" + ); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexLabel(mcSlowBufferIndex, mcSLbl); + + // + // Long Cycle ... + string lcFLbl = StringConcatenate( + "LC F(", longCycleLength, ")" + ); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexLabel(lcFastBufferIndex, lcFLbl); + + // + string lcSLbl = StringConcatenate( + "LC S(", longCycleLength, ")" + ); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexLabel(lcSlowBufferIndex, lcSLbl); + // + // End Set Index Buffers ... + // + + // + // Parabolic Sar ... + SetIndexBuffer(psarBufferIndex, psarBuffer); + SetIndexLabel(psarBufferIndex, "P Sar"); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculat Ma's ... + // + CalculateShortCycle(i); + + // + CalculateMediumCycle(i); + + // + CalculateLongCycle(i); + + // + // Parabolic SAR ... + CalculateParabolicSAR(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Short Cycle ... +void CalculateShortCycle( + const int &bar_index +) { + // + double scFast = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + scFastBuffer[bar_index] = scFast; + + // + double scSlow = iMA( + _Symbol, + _Period, + shortCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + scSlowBuffer[bar_index] = scSlow; +} + +// +// Calculating Medium Cycle ... +void CalculateMediumCycle( + const int &bar_index +) { + // + double mcFast = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + mcFastBuffer[bar_index] = mcFast; + + // + double mcSlow = iMA( + _Symbol, + _Period, + mediumCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + mcSlowBuffer[bar_index] = mcSlow; +} + +// +// Calculating Long Cycle ... +void CalculateLongCycle( + const int &bar_index +) { + // + double lcFast = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_OPEN, + bar_index + ); + lcFastBuffer[bar_index] = lcFast; + + // + double lcSlow = iMA( + _Symbol, + _Period, + longCycleLength, + 0, + maMethod, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = lcSlow; +} + +// +// Calculate Parabolic SAR ... +void CalculateParabolicSAR( + const int &bar_index +) { + // + double pSar = iSAR( + _Symbol, + _Period, + step, + maximum, + bar_index + ); + + // + psarBuffer[bar_index] = pSar; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..f562939 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,535 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +double GetMaxRangeAllowedTP( + const ENUM_X_SIGNAL_TYPE type, + const XRange &range +) { + // + bool isLongSignal = + type != X_SIGNAL_NONE + && type == X_SIGNAL_LONG + ; + + // + double maxAllowedTPRange = ((range.levels - 0.5) * range.rate); + + // + double result = + isLongSignal ? + range.lowestLow + maxAllowedTPRange + : + range.highestHigh - maxAllowedTPRange + ; + + // + return result; +} + +// +double GetMaxRangeAllowedEntry( + const ENUM_X_SIGNAL_TYPE type, + const XRange &range +) { + // + bool isLongSignal = + type != X_SIGNAL_NONE + && type == X_SIGNAL_LONG + ; + + // + double maxAllowedEntryRange = (range.levels - 1.5) * range.rate; + + // + double result = + isLongSignal ? + range.lowestLow + maxAllowedEntryRange + : + range.highestHigh - maxAllowedEntryRange + ; + + // + return result; +} + +// +// Range Verification ... +bool IsRangeVerified( + const int bar_index, + const int marketLen, + const int levels, + const ENUM_X_SIGNAL_TYPE type, + const double entry, + const double tp, + const XRange &range +) { + // + bool isLongSignal = + type == X_SIGNAL_LONG + && type != X_SIGNAL_NONE + ; + + // + double maxAllowedTP = + GetMaxRangeAllowedTP( + type, + range + ) + ; + + // + double maxAllowedEntry = + GetMaxRangeAllowedEntry( + type, + range + ) + ; + + // + bool result = + isLongSignal + ? + // + entry < maxAllowedEntry + && tp < maxAllowedTP + : + // + entry > maxAllowedEntry + && tp > maxAllowedTP + ; + + // + return result; +} + +// +// START Global Requirement Functions ... +// +// +// Signal Range Verification ... +bool IsSignalRangeVerified( + const int bar_index, + const int marketLen, + const int levels, + const XSignal &signal, + const XRange &range +) { + // + bool result = + IsRangeVerified( + bar_index, + marketLen, + levels, + signal.type, + signal.entry, + signal.tp, + range + ); + + // + return result; +} + +// +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +XState GetXState( + const int bar_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + XState result = {}; + + // + // Cycle Buffer Indexes ... + int scFastBufferIndex = 0; + int scSlowBufferIndex = 1; + int mcFastBufferIndex = 2; + int mcSlowBufferIndex = 3; + int lcFastBufferIndex = 4; + int lcSlowBufferIndex = 5; + int psarBufferIndex = 6; + + // + // HH and LL Buffer Indexes ... + int scHHBufferIndex = 0; + int scLLBufferIndex = 1; + int mcHHBufferIndex = 2; + int mcLLBufferIndex = 3; + int lcHHBufferIndex = 4; + int lcLLBufferIndex = 5; + + // + // Short Cycle ... + // + // Fast ... + double scFast = ReadXMABuffer( + bar_index, + scFastBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Slow ... + double scSlow = ReadXMABuffer( + bar_index, + scSlowBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Highest High ... + double scHH = ReadXHLBuffer( + bar_index, + scHHBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Lowest Low ... + double scLL = ReadXHLBuffer( + bar_index, + scLLBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Integrate Result ... + XCycleState sc = {}; + sc.fast = scFast; + sc.slow = scSlow; + sc.hh = scHH; + sc.ll = scLL; + + // + // Attach Result ... + result.sc = sc; + + // + // Medium Cycle ... + // + // Fast ... + double mcFast = ReadXMABuffer( + bar_index, + mcFastBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Slow ... + double mcSlow = ReadXMABuffer( + bar_index, + mcSlowBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Highest High ... + double mcHH = ReadXHLBuffer( + bar_index, + mcHHBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Lowest Low ... + double mcLL = ReadXHLBuffer( + bar_index, + mcLLBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + double di = GetMA( + bar_index, + (mediumCycleMult + 1) * marketLen, + 0, + MODE_SMA, + PRICE_CLOSE + ); + result.di = di; + + // + // Integrate Result ... + XCycleState mc = {}; + mc.fast = mcFast; + mc.slow = mcSlow; + mc.hh = mcHH; + mc.ll = mcLL; + + // + // Attach Result ... + result.mc = mc; + + // + // Long Cycle ... + // + // Fast ... + double lcFast = ReadXMABuffer( + bar_index, + lcFastBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Slow ... + double lcSlow = ReadXMABuffer( + bar_index, + lcSlowBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Highest High ... + double lcHH = ReadXHLBuffer( + bar_index, + lcHHBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Lowest Low ... + double lcLL = ReadXHLBuffer( + bar_index, + lcLLBufferIndex, + // + marketLen, + // + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + // Integrate Result ... + XCycleState lc = {}; + lc.fast = lcFast; + lc.slow = lcSlow; + lc.hh = lcHH; + lc.ll = lcLL; + + // + // Attach Result ... + result.lc = lc; + + // + // Parabolic SAR ... + double psar = ReadXMABuffer( + bar_index, + psarBufferIndex, + // + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult + ); + + // + result.parabolicSAR = psar; + + // + return result; +} +// +// END XMA Data ... +// +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..e2124e3 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1604 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +static datetime lastBarTime; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..f4e1058 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,152 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XCycleState { + // + double fast; + double slow; + + // + double hh; + double ll; + + // + double power; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XState { + // + // SC ... + XCycleState sc; + + // + // MC ... + XCycleState mc; + + // + double di; + + // + // LC ... + XCycleState lc; + + // + // PARABOLIC-SAR ... + double parabolicSAR; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..76d9e53 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1518 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } + + // + return result; +} + +// +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + profit < 0 + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); + // + // ClearOSCLongSignalConditions(); + // ClearCCILongSignalConditions(); + // ClearSHPLongSignalConditions(); + // ClearXRMALongSignalConditions(); + // // + // ClearXMASCLongSignalConditions(); + // ClearXMAMCLongSignalConditions(); + // ClearXMAMMLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..11ae62c --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,778 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; +static datetime lastLCFCrossOverSCLLTime; +static datetime xWaitForLongSignalChangeTime; + +// +static XSignalConditions xShortConds; +static bool xWaitForShortSignals = true; +static bool xCloseShortTrades = false; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckSignalHandler( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 10 +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + if (xWaitForLongSignals) { + // // + // bool isLCFastOnTrendingUpTouchLowestLow = + // // + // // LC Trending Up ... + // states[1].lc.fast > states[1].lc.slow + // && states[2].lc.fast > states[2].lc.slow + // // + // // LC Fast Touch Market Lowest Low ... + // && states[1].lc.fast > states[1].mkt.lowestLow + // && !(states[2].lc.fast > states[2].mkt.lowestLow) + // ; + + // // + // bool isMCSlowCrossOverBNDHigh = + // states[1].mc.fast > states[1].mc.slow + // && states[1].mc.slow > states[1].bnd.high + // && !(states[2].mc.slow > states[2].bnd.high) + // ; + + // + // Disable Long Trade Handlers ... + // if ( + // isMCSlowCrossOverBNDHigh + // || isLCFastOnTrendingUpTouchLowestLow + // ) { + // // + // xWaitForLongSignals = false; + // xWaitForLongSignalChangeTime = TimeCurrent(); + // LogMessage("Disable Long ..."); + // } + } else { + // + bool isAllTrendingUp = + // + // SC ... + states[1].sc.fast > states[1].sc.slow + // + // MC ... + && states[1].mc.fast > states[1].mc.slow + && !(states[2].mc.fast > states[2].mc.slow) + // + // LC ... + && states[1].lc.fast > states[1].lc.slow + ; + + // + int lastWaitChangeBarIndex = iBarShift( + _Symbol, + _Period, + xWaitForLongSignalChangeTime + ); + + // + // Enable Long Trade Handlers ... + if ( + isAllTrendingUp + && lastWaitChangeBarIndex - bar_index >= marketLen + ) { + xWaitForLongSignals = true; + LogMessage("Enable Long ..."); + } + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 10 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // for Long Signals it happens when sc fast cross over slow ... + bool isCrossUnder = + states[0].sc.fast > states[0].sc.slow + && states[1].sc.fast > states[1].sc.slow + && !(states[2].sc.fast > states[2].sc.slow) + ; + + // + // for Long Signals it happens when sc fast cross under slow ... + bool isCrossOver = + states[0].sc.fast < states[0].sc.slow + && states[1].sc.fast < states[1].sc.slow + && !(states[2].sc.fast < states[2].sc.slow) + ; + + // + // Check Special Conditions ... + // XOHCL pCandle = GetCandleModel(bar_index + 1); + // XOHCL ppCandle = GetCandleModel(bar_index + 2); + // XOHCL mCandle = GetCandleModel(bar_index + marketLen); + // bool isLCGoingDownPrice = + // // + // pCandle.low > states[1].lc.slow + // && ppCandle.low > states[2].lc.slow + // && mCandle.low < states[marketLen - 1].lc.slow + // ; + // if () + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + + // + // if (states[0].parabolicSAR < states[0].sc.slow) { + // } + return; + } + + // // + // if ( + // xLongConds.startTime > 0 + // && xLongConds.signalTime > 0 + // && xLongConds.entryTime == 0 + // && states[0].parabolicSAR < states[0].sc.slow + // ) { + // // + // xLongConds.entryTime = barTime; + // return; + // } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index, + const int marketLen, + const XState &states[], + // + const double smoother = 10 +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossUnder = + false; + + // + bool isCrossOver = + false; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index, // Bar Index ... + const int marketLen, // MarketLength for TP and SL ... + const int longCycleMult, // Long Cycle Multiplier for XRange Calculations ... + const double r2r, // Risk to Reward ratio ... + const XState &states[], + // + const double smoother = 10 +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions( + marketLen, + states, + smoother + ) + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + marketLen + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + marketLen + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * r2r; // risk * r2r; // 300 * _Point; + // if (risk > (500 * _Point)) { + // reward = 300 * _Point; + // } + + // + double sl = requestLong ? + 0 : // ll : + 0; // ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward; + + // // + // double fibLevel = 1.618; + // double fibLevelPrice = GetFibonacciLevel( + // tp, + // entryPrice, + // fibLevel, + // 1 + // ); + + // // + // if (requestLong) { + // sl = fibLevelPrice; + // } + + // + if ( + // + // Condition 1 ... + ( + tp > states[0].lc.hh + && ll == states[0].sc.ll + && states[0].sc.ll == states[0].mc.ll + ) + || + // + // Condition 2 ... + ( + states[0].sc.hh == states[0].mc.hh + && states[0].lc.hh == states[0].mc.hh + && states[0].sc.ll == states[0].mc.ll + ) + ) { + // + reward = risk * 1; + tp = requestLong ? + entryPrice + reward : + entryPrice - reward; + } + + // // + // int rangeMarketLength = marketLen * longCycleMult; + + // // + // XRange range = GetMarketRange( + // bar_index, + // rangeMarketLength, + // marketLen + // ); + + // // + // bool isRangeVerified = IsRangeVerified( + // bar_index, + // rangeMarketLength, + // marketLen, + // type, + // entryPrice, + // tp, + // range + // ); + + // // + // if (!isRangeVerified) { + // // + // // sl = requestLong ? + // // states[0].mc.ll : + // // states[0].mc.hh + // // ; + // } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 10 +) { + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + && MathAbs(signalBarIndex - startBarIndex) > 2 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +bool ValidateXShortConditions( + const int marketLen, + const XState &states[], + // + const double smoother = 10 +) { + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + && MathAbs(signalBarIndex - startBarIndex) > marketLen + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal, + const XState &states[], + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult, + // + double smoother = 10 +) { + // + bool result = false; + + // + bool isSCTrendUp = false; + bool isSCTrendDown = false; + + // + bool isMCTrendUp = false; + bool isMCTrendDown = false; + + // + bool isLCTrendUp = false; + bool isLCTrendDown = false; + + // + XOHCL candle = GetCandleModel(0); + XOHCL pCandle = GetCandleModel(1); + + // // + // bool isRange = false; + // int rangeMarketLength = 5 * marketLen; + // for (int i = 1; i < rangeMarketLength; i++) { + // // + // XState iState = GetXState( + // i, + // marketLen, + // 0.01, + // 0.1, + // shortCycleMult, + // mediumCycleMult, + // longCycleMult + // ); + + // // + // isRange = + // iState.mc.hh == iState.lc.hh + // && iState.mc.hh == states[0].mc.hh + // ; + // } + + // // + // int statesLast = ArraySize(states) - 1; + // double scSlope = + // GetSlope( + // statesLast, + // states[statesLast].sc.slow, + // 0, + // states[0].sc.slow + // ); + // double mcSlope = + // GetSlope( + // statesLast, + // states[statesLast].mc.slow, + // 0, + // states[0].mc.slow + // ); + // double lcSlope = + // GetSlope( + // statesLast, + // states[statesLast].lc.slow, + // 0, + // states[0].lc.slow + // ); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + isSCTrendUp = + states[0].sc.fast < states[0].sc.slow + && states[1].sc.fast < states[1].sc.slow + // && states[2].sc.fast < states[2].sc.slow + ; + + // + isMCTrendUp = + states[0].mc.fast < states[0].mc.slow + && states[1].mc.fast < states[1].mc.slow + // && states[2].mc.fast < states[2].mc.slow + ; + + // + isLCTrendUp = + states[0].lc.fast < states[0].lc.slow + && states[1].lc.fast < states[1].lc.slow + // && states[2].lc.fast < states[2].lc.slow + ; + + // + result = + // + // Starter ... + true + // + // Trending State ... + && isSCTrendUp + && isMCTrendUp + && isLCTrendUp + // + // && !isRange + // + // Condition 1 ... + && states[0].mc.fast > states[0].sc.slow + // + && states[0].lc.slow < states[0].sc.ll + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // // + // if (result) { + // // + // LogMessage( + // StringConcatenate( + // "scSlope: ", scSlope, + // ", mcSlope: ", mcSlope, + // ", lcSlope: ", lcSlope + // ) + // ); + // } + + // + return result; +} +// +// END Functions ... +// diff --git a/Bkp/Used/14020431/Libraries/x-saherelm.xr.signal.lib.mq4 b/Bkp/Used/14020431/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..d8fc763 --- /dev/null +++ b/Bkp/Used/14020431/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,732 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +input double xrR2R = 2; // XR Risk To Reward Ratio + +// +input int xrOscillatorLength = 7; // XR Oscillator Length +input int xrFastLength = 20; // XR Fast Length +input int xrSlowLength = 50; // XR Slow Length +input int xrMarketRangeLength = 50; // XR Range Detector Length + +// +input int xrSwingLength = 7; // Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + + // + double prevFast; + double prevSlow; + + // + double oscillator; + double prevOscillator; + + // + double verifier; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + // + datetime startTime; + datetime signalTime; + datetime entryTime; + + // + double value; + XRState state; +}; + +// +static XRSignalConditions xrLongConds; +static bool xrCloseLongTrades = false; +static bool xrWaitForLongSignals = true; + +// +static double xrMaximumDrawDown = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + XOHCL candle = GetCandleModel(bar_index); + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + if (xrWaitForLongSignals) { + // + if ( + state.oscillator < state.fast + && state.oscillator < state.slow + && state.prevOscillator < state.prevFast + && state.prevOscillator < state.prevSlow + && candle.low < xrMaximumDrawDown + ) { + // + xrMaximumDrawDown = 0; + xrCloseLongTrades = true; + } + } else { + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index + 1); + + // + XRState xrState = GetXRange( + bar_index + ); + + // + double affectedValue = xrState.mid; + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + bool isCrossOver = + state.fast > state.slow + && !(state.prevFast > state.prevSlow) + ; + + // + bool isCrossUnder = + state.fast < state.slow + && !(state.prevFast < state.prevSlow) + ; + + // + if ( + isCrossUnder + && xrLongConds.startTime == 0 + ) { + // + xrLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xrLongConds.startTime > 0 + && xrLongConds.signalTime == 0 + ) { + // + xrLongConds.value = affectedValue; + xrLongConds.state = xrState; + + // + xrLongConds.signalTime = barTime; + xrLongConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xrSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xrSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * xrR2R; + + // + double sl = requestLong ? + 0 : + ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + xrMaximumDrawDown = + xrMaximumDrawDown == 0 ? + xrLongConds.state.mid : + xrMaximumDrawDown > xrLongConds.state.mid ? + xrMaximumDrawDown : + xrLongConds.state.mid; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + bool isConditionsFilled = + xrLongConds.startTime > 0 + && xrLongConds.signalTime > 0 + && xrLongConds.entryTime > 0 + // + && xrLongConds.value > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.signalTime + ); + + // + // Count Affected Value Touches ... + int cStartBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.state.start + ); + + // + int cEndBarIndex = cStartBarIndex + xrLongConds.state.length; + + // + int highTouched = 0; + int valueTouched = 0; + for (int i = cStartBarIndex; i <= cStartBarIndex + cEndBarIndex; i++) { + // + XOHCL iCandle = GetCandleModel(i); + + // + if ( + iCandle.low < xrLongConds.value + && iCandle.high > xrLongConds.value + ) { + valueTouched++; + } + + // + if ( + iCandle.low < xrLongConds.state.hh + && iCandle.high > xrLongConds.state.hh + ) { + highTouched++; + } + } + + // + isBLFilled = + // + xrLongConds.signalTime > xrLongConds.startTime + && xrLongConds.entryTime >= xrLongConds.signalTime + // + && highTouched < 2 + && valueTouched > (cEndBarIndex - cStartBarIndex) / 6 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xrWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xrLongConds.startTime = 0; + xrLongConds.signalTime = 0; + xrLongConds.entryTime = 0; + + // + xrLongConds.value = 0; + + // + XRState e = {}; + xrLongConds.state = e; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + XRMarketState state = GetXRMarketState(0); + + // + double fSDif = MathAbs(state.fast - state.slow); + double fSDifP = MathAbs(state.prevFast - state.prevSlow); + + // + double emaSlope = GetSlope( + 1, + state.prevOscillator, + 2, + state.oscillator + ); + + // + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + // Starter ... + true + // + && state.oscillator > state.fast + && emaSlope > 0 + && signal.entry > state.verifier + // + && fSDif > fSDifP + // + && signal.entry < xrLongConds.state.hh + && signal.entry > xrLongConds.state.mid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +static XRState lastXRState; +XRState GetXRange( + const int bar_index +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + xrMarketRangeLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = xrMarketRangeLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= xrMarketRangeLength) { + // + lastXRState.start = barTime; + lastXRState.length = xrMarketRangeLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Prepare Market Length ... + int xrVerifierMarketLength = GetDailyCandleCount(); + + // + // Calculate Fast and Prev Fast ... + // + // Fast ... + double fast = GetMA( + bar_index + 1, + xrFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Fast ... + double prevFast = GetMA( + bar_index + 2, + xrFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Slow and Prev Slow ... + + // + // Slow ... + double slow = GetMA( + bar_index + 1, + xrSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Slow ... + double prevSlow = GetMA( + bar_index + 2, + xrSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Oscillator and Prev Oscillator ... + + // + // Oscillator ... + double oscillator = GetMA( + bar_index, + xrOscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Prev Oscillator ... + double prevOscillator = GetMA( + bar_index + 1, + xrOscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Calculate Verifier ... + double verifier = GetMA( + bar_index, + xrVerifierMarketLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + result.fast = fast; + result.slow = slow; + result.verifier = verifier; + result.prevFast = prevFast; + result.prevSlow = prevSlow; + result.oscillator = oscillator; + result.prevOscillator = prevOscillator; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif b/Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..64e458ff9b58ec1eca085f424da719deca90d9ee GIT binary patch literal 10178 zcmc(^_g9lo*F7AHkc1+FbWw`*DoP7gQ2_x({U}WY0fEpvflxwCLICN69y)~HLhsV6 zbOH)UFVYmGNxt0A`$xRjnrqfs`|PvNo|)ffG_;<}D|~uH(Fa%u07xVf000;o8X^$} zA<;(!D=We^M6iNH&jYT15@|jfat#rzu9?>%fHXe~0aO642W0mD3|_OY z`$S)puGjQG6W96wA%yw)==s^}$m%)=sIYqYm%FfBn%P%M_!WWm6mX%jjR#n&3 z66)$38k?G1THD$?I=jAh_w@Gl4-5_skBp9$kWEZZP0!5E5$6}a|5#jF{<*Tcw!X2s zwY{_ZYj6MH@aXrSC+xty(q{_28P>gN8MHd=_NumgX&J&C{j zM!V-8u{@uHQt#sTUQRXr-2?uw%&(VQQ5SD?*KR$b1ThLk@LL`;hJxe7KeV?i1oP5y za+qWcWl_l7Okr8#Z}N!_zG-AQ`ewM_k*BUoa5;mr?wD`NZRh;N4lT<^&&|lBYN;fL z7z};R7hBeRKGI#tfn*akufPo?&Kj{jXt;$Q3!ilrdVLk^&_u15RQu1f9)ETM`jtOw zQ}==L@&V(5?VlT(njffGV$JT;n2($B9?Y>Ofxzn;Nukr9QM8@~HgeM-A$ftvU@8NC zUNl9aR5qDt1%n}tM1%nfBt$Fy(ff9D`y3TVJ3#Hr{jb~-52SYkBnYdQe1C<+rKzB**Zrb+U;+ z2Z&Tl-8c%c{*R@ujCVvs0mK9huwmr3y_BC6{HEV3-GT+O{?YCX{RHYI04_+!g3YZH zsE61E3v$WpIq*~wRBQS9dE3mzFsg$BeM}XVV5v7FekuhZdoGj}^W%VmUJh`pm@MxF z#J+$GH_e~*_&*N8LfZB@`vhkyyjVgv3+G1JAjd#(Q4qjxFWHt0cR$B>yibJZmGYZ% zzQ3}ul6)5uhJ_$b1+O@D=z_ zN9{1d@P>JJw3b@m51}|Y6r)D?E?+cf8ZF>hST%EDaF+{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t=klNo|@+)kn;ALie%1?2_HKy9;`wPJ+S3M@GaZVBXD`T%;X z0s45*hx0760gxFnA=D@e)tDEMQ!vqQkBb&@-cIyP0r_neC7q}E2a}ter#v4h#6s|; z>i8mPN*FjdAsp{GkPjCrv`V(FX%z8?6s8%0VBm+2_-v`J`~q8MD(_ql$v0zMEG?S%lQv~;Ipg1BL zx)+{YZ(F*{Q8Lt%un0}}BFd>iAM#g}C$^ITXv&1c!4yqVz>9J+V-R@0}93(jr!bfAvItbVcuaZ@-+VqJM7p)pLVo4zu z20XMQn8`EG7j{}Gy@{@NfY`}4flUm7#YE5}^_o80V&$dkIq&KRT?JH%xo?{QFAr*# z6pH*)YSk_*<_5~~P(C9R(O!2Xn|mHsb?{OQ6L?M$oGfmM;13&X61f@ zSM?I}0~BjNz9i+~=hn}FAi7`J#$XBK1XthE{kMJhZn_9dbXzQ%Qz z3Qdt?&7ZfTHHa;O@XV=j!0>z%4$x#%)cTePIo_#%*^$OQph#9x)j3gWy`4r9Es}bX z|Kp_0OQfA@tSyhbZoROULs2yFcRNd?!<<6f)x2UGMY{titA(#)r@n)Ywq0L6zm&Zb zP}0uV+}Zj&Q68csxsZr%Xp1oG3KOow!eh9IU9v-6H9xzy3)>%m5arwLpk4qfEVMsM zt5I%Fn}U8lH11IKZ1`f_&aTvvAl0d64_O-kncPX@zWll^B-o?Zln5>9u^Z}f*zIwm f?R63Bb<^qfu + + + Strategy Tester: x-saherelm.osc.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.osc.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2023.01.03 01:00 - 2023.06.28 23:45 (2023.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
Bars in test12551Ticks modelled15360882Modelling qualityn/a
Mismatched charts errors1395
Initial deposit1000.00SpreadCurrent (50)
Total net profit223.50Gross profit1480.53Gross loss-1257.03
Profit factor1.18Expected payoff0.63
Absolute drawdown66.94Maximal drawdown434.20 (31.15%)Relative drawdown31.15% (434.20)
Total trades353Short positions (won %)0 (0.00%)Long positions (won %)353 (89.80%)
Profit trades (% of total)317 (89.80%)Loss trades (% of total)36 (10.20%)
Largestprofit trade33.12loss trade-82.64
Averageprofit trade4.67loss trade-34.92
Maximumconsecutive wins (profit in money)80 (449.04)consecutive losses (loss in money)5 (-149.41)
Maximalconsecutive profit (count of wins)449.04 (80)consecutive loss (count of losses)-225.40 (4)
Averageconsecutive wins26consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12023.01.03 01:15buy10.011827.450.001843.83
22023.01.03 04:15buy20.011829.930.001835.55
32023.01.03 04:40t/p20.011835.550.001835.555.621005.62
42023.01.03 08:18t/p10.011843.830.001843.8316.381022.00
52023.01.03 11:30buy30.011841.650.001855.25
62023.01.03 12:00buy40.011839.080.001847.54
72023.01.03 14:30buy50.011835.760.001845.00
82023.01.03 16:33t/p50.011845.000.001845.009.241031.24
92023.01.03 16:40t/p40.011847.540.001847.548.461039.70
102023.01.03 18:45buy60.011831.470.001838.67
112023.01.03 19:43t/p60.011838.670.001838.677.201046.90
122023.01.04 02:45buy70.011838.470.001842.41
132023.01.04 03:42t/p70.011842.410.001842.413.941050.84
142023.01.04 09:32t/p30.011855.250.001855.2513.601064.44
152023.01.04 15:30buy80.011859.480.001872.26
162023.01.04 17:43buy90.011858.070.001872.79
172023.01.04 18:15buy100.011859.520.001879.82
182023.01.04 22:13buy110.011852.910.001863.57
192023.01.04 23:00close110.011855.120.001863.572.211066.65
202023.01.04 23:00buy120.011855.620.001866.04
212023.01.05 04:48close120.011855.910.001866.040.291066.94
222023.01.05 04:48buy130.011856.410.001859.81
232023.01.06 17:07t/p130.011859.810.001859.813.401070.34
242023.01.09 03:38t/p80.011872.260.001872.2612.781083.12
252023.01.09 03:42t/p90.011872.790.001872.7914.721097.84
262023.01.09 09:17t/p100.011879.820.001879.8220.301118.14
272023.01.09 14:08buy140.011873.920.001879.06
282023.01.09 16:00buy150.011878.500.001889.38
292023.01.09 16:03t/p140.011879.060.001879.065.141123.28
302023.01.09 18:45buy160.011876.880.001885.72
312023.01.09 20:30buy170.011873.710.001882.41
322023.01.09 21:08buy180.011873.080.001877.60
332023.01.09 21:45close180.011873.900.001877.600.821124.10
342023.01.09 21:45close170.011873.900.001882.410.191124.29
352023.01.09 21:45buy190.011874.400.001882.66
362023.01.09 23:42buy200.011871.550.001875.43
372023.01.10 03:30close200.011873.400.001875.431.851126.14
382023.01.10 03:30buy210.011873.900.001885.50
392023.01.10 19:45close210.011875.230.001885.501.331127.47
402023.01.10 19:45close190.011875.230.001882.660.831128.30
412023.01.10 19:45buy220.011875.730.001884.15
422023.01.10 20:48buy230.011875.450.001880.99
432023.01.10 23:00close230.011877.930.001880.992.481130.78
442023.01.10 23:00close220.011877.930.001884.152.201132.98
452023.01.10 23:00close160.011877.930.001885.721.051134.03
462023.01.10 23:00buy240.011878.430.001883.37
472023.01.10 23:30buy250.011877.800.001880.92
482023.01.11 02:00buy260.011877.490.001878.97
492023.01.11 07:11t/p260.011878.970.001878.971.481135.51
502023.01.11 07:33t/p250.011880.920.001880.923.121138.63
512023.01.11 07:37t/p240.011883.370.001883.374.941143.57
522023.01.11 15:45buy270.011880.230.001888.51
532023.01.11 18:46buy280.011873.780.001885.52
542023.01.12 01:15buy290.011877.590.001880.31
552023.01.12 03:57t/p290.011880.310.001880.312.721146.29
562023.01.12 13:13t/p280.011885.520.001885.5211.741158.03
572023.01.12 14:22t/p270.011888.510.001888.518.281166.31
582023.01.12 14:23t/p150.011889.380.001889.3810.881177.19
592023.01.12 15:45buy300.011892.180.001925.30
602023.01.12 18:00buy310.011889.130.001907.11
612023.01.13 08:30buy320.011895.510.001901.27
622023.01.13 09:45buy330.011897.320.001903.56
632023.01.13 10:08t/p320.011901.270.001901.275.761182.95
642023.01.13 10:12t/p330.011903.560.001903.566.241189.19
652023.01.13 10:42t/p310.011907.110.001907.1117.981207.17
662023.01.13 15:41buy340.011899.570.001908.39
672023.01.13 16:47t/p340.011908.390.001908.398.821215.99
682023.01.16 04:31t/p300.011925.300.001925.3033.121249.11
692023.01.16 15:55buy350.011914.440.001919.66
702023.01.16 16:30buy360.011914.600.001920.40
712023.01.16 20:00buy370.011914.160.001916.24
722023.01.17 01:05t/p370.011916.240.001916.242.081251.19
732023.01.17 04:15buy380.011915.870.001921.35
742023.01.17 09:45buy390.011910.040.001915.68
752023.01.17 10:45close390.011910.310.001915.680.271251.46
762023.01.17 10:45buy400.011910.810.001917.41
772023.01.17 15:30close400.011911.980.001917.411.171252.63
782023.01.17 15:30buy410.011912.480.001922.68
792023.01.17 18:30close410.011912.600.001922.680.121252.75
802023.01.17 18:30buy420.011913.100.001920.64
812023.01.18 15:30t/p350.011919.660.001919.665.221257.97
822023.01.18 15:30t/p360.011920.400.001920.405.801263.77
832023.01.18 15:30t/p420.011920.640.001920.647.541271.31
842023.01.18 15:31t/p380.011921.350.001921.355.481276.79
852023.01.18 23:30buy430.011904.630.001908.69
862023.01.19 01:06buy440.011904.440.001906.46
872023.01.19 01:51t/p440.011906.460.001906.462.021278.81
882023.01.19 02:33t/p430.011908.690.001908.694.061282.87
892023.01.19 04:30buy450.011903.550.001908.11
902023.01.19 05:07t/p450.011908.110.001908.114.561287.43
912023.01.19 13:00buy460.011909.940.001915.62
922023.01.19 13:30buy470.011909.670.001914.81
932023.01.19 14:08buy480.011909.630.001912.57
942023.01.19 14:45buy490.011910.690.001918.15
952023.01.19 15:30close490.011911.860.001918.151.171288.60
962023.01.19 15:30close480.011911.860.001912.572.231290.83
972023.01.19 15:30close470.011911.860.001914.812.191293.02
982023.01.19 15:30close460.011911.860.001915.621.921294.94
992023.01.19 15:30buy500.011912.360.001922.84
1002023.01.19 17:36t/p500.011922.840.001922.8410.481305.42
1012023.01.20 07:45buy510.011927.080.001934.26
1022023.01.20 10:06t/p510.011934.260.001934.267.181312.60
1032023.01.20 11:30buy520.011931.900.001942.00
1042023.01.20 12:15buy530.011929.300.001934.20
1052023.01.20 13:00buy540.011930.340.001935.18
1062023.01.20 15:03buy550.011929.550.001933.49
1072023.01.23 03:50t/p550.011933.490.001933.493.941316.54
1082023.01.23 04:12t/p530.011934.200.001934.204.901321.44
1092023.01.23 04:18t/p540.011935.180.001935.184.841326.28
1102023.01.23 10:37buy560.011923.900.001930.20
1112023.01.23 15:15buy570.011926.780.001933.48
1122023.01.23 17:31buy580.011918.590.001931.51
1132023.01.23 22:38t/p560.011930.200.001930.206.301332.58
1142023.01.23 22:45t/p580.011931.510.001931.5112.921345.50
1152023.01.24 03:36t/p570.011933.480.001933.486.701352.20
1162023.01.24 10:03t/p520.011942.000.001942.0010.101362.30
1172023.01.24 17:27buy590.011930.540.001952.36
1182023.01.25 01:45buy600.011937.100.001937.96
1192023.01.25 02:03t/p600.011937.960.001937.960.861363.16
1202023.01.25 03:00buy610.011937.140.001940.86
1212023.01.25 08:32buy620.011930.890.001938.43
1222023.01.25 10:27buy630.011931.860.001939.26
1232023.01.25 10:45close620.011931.070.001938.430.181363.34
1242023.01.25 10:45close590.011931.070.001952.360.531363.87
1252023.01.25 10:45buy640.011931.570.001939.29
1262023.01.25 14:38buy650.011926.590.001930.55
1272023.01.25 16:42t/p650.011930.550.001930.553.961367.83
1282023.01.25 19:32t/p630.011939.260.001939.267.401375.23
1292023.01.25 19:32t/p640.011939.290.001939.297.721382.95
1302023.01.25 20:21t/p610.011940.860.001940.863.721386.67
1312023.01.26 03:45buy660.011945.510.001950.81
1322023.01.26 04:15buy670.011946.010.001952.31
1332023.01.26 08:00buy680.011947.760.001952.28
1342023.01.26 10:30buy690.011943.920.001955.06
1352023.02.01 22:02close690.011944.430.001955.060.511387.18
1362023.02.01 22:08close660.011946.020.001950.810.511387.69
1372023.02.01 22:08close670.011946.520.001952.310.511388.20
1382023.02.01 22:31close680.011948.270.001952.280.511388.71
1392023.02.02 13:30buy700.011955.460.001962.46
1402023.02.02 14:16buy710.011955.350.001961.87
1412023.02.03 11:15buy720.011913.840.001919.96
1422023.02.09 18:30close700.011872.820.001962.46-82.641306.07
1432023.02.09 19:15close710.011873.210.001961.87-82.141223.93
1442023.02.10 03:00buy730.011863.180.001869.10
1452023.02.10 04:00buy740.011862.590.001868.75
1462023.02.10 04:45buy750.011863.040.001870.28
1472023.02.10 10:06t/p740.011868.750.001868.756.161230.09
1482023.02.10 10:06t/p730.011869.100.001869.105.921236.01
1492023.02.10 10:08t/p750.011870.280.001870.287.241243.25
1502023.02.10 12:30buy760.011864.280.001871.36
1512023.02.10 13:30buy770.011862.320.001865.36
1522023.02.10 14:43buy780.011865.240.001872.48
1532023.02.10 15:47t/p770.011865.360.001865.363.041246.29
1542023.02.10 16:00buy790.011867.310.001877.81
1552023.02.10 16:15close720.011866.390.001919.96-47.451198.84
1562023.02.10 17:15buy800.011865.270.001877.09
1572023.02.17 17:30close760.011833.960.001871.36-30.321168.52
1582023.02.17 19:30close780.011841.780.001872.48-23.461145.06
1592023.02.17 21:00close790.011841.980.001877.81-25.331119.73
1602023.02.17 22:15close800.011842.420.001877.09-22.851096.88
1612023.02.20 03:03buy810.011839.590.001842.75
1622023.02.20 04:06buy820.011840.900.001846.68
1632023.02.20 04:33t/p810.011842.750.001842.753.161100.04
1642023.02.20 05:45buy830.011842.690.001845.15
1652023.02.20 07:45buy840.011843.690.001848.09
1662023.02.20 08:06t/p830.011845.150.001845.152.461102.50
1672023.02.20 08:30buy850.011843.960.001848.90
1682023.02.20 09:15buy860.011845.180.001849.18
1692023.02.20 10:02t/p820.011846.680.001846.685.781108.28
1702023.02.20 11:00buy870.011844.500.001849.72
1712023.02.20 12:00close840.011843.730.001848.090.041108.32
1722023.02.20 12:00buy880.011844.230.001849.89
1732023.02.20 13:15close850.011844.160.001848.900.201108.52
1742023.02.20 13:15buy890.011844.660.001847.74
1752023.02.20 15:30close890.011845.880.001847.741.221109.74
1762023.02.20 15:30close880.011845.880.001849.891.651111.39
1772023.02.20 15:30close870.011845.880.001849.721.381112.77
1782023.02.20 15:30close860.011845.880.001849.180.701113.47
1792023.02.20 15:30buy900.011846.380.001853.38
1802023.02.20 16:00buy910.011846.710.001854.37
1812023.02.20 18:45buy920.011843.700.001845.84
1822023.02.21 01:15buy930.011842.570.001845.95
1832023.02.21 04:30close930.011842.610.001845.950.041113.51
1842023.02.21 04:30buy940.011843.110.001848.65
1852023.02.27 23:00close900.011816.990.001853.38-29.391084.12
1862023.02.27 23:30close910.011816.780.001854.37-29.931054.19
1872023.02.28 03:15close920.011816.580.001845.84-27.121027.07
1882023.02.28 09:30close940.011811.970.001848.65-31.14995.93
1892023.02.28 11:00buy950.011811.070.001823.15
1902023.02.28 13:45buy960.011810.890.001816.49
1912023.02.28 15:30buy970.011809.700.001812.60
1922023.02.28 15:52t/p970.011812.600.001812.602.90998.83
1932023.02.28 16:45t/p960.011816.490.001816.495.601004.43
1942023.02.28 17:02t/p950.011823.150.001823.1512.081016.51
1952023.03.01 16:00buy980.011837.490.001844.13
1962023.03.01 16:30buy990.011839.010.001848.69
1972023.03.01 16:57t/p980.011844.130.001844.136.641023.15
1982023.03.01 17:30buy1000.011838.590.001848.29
1992023.03.02 04:30buy1010.011836.160.001845.80
2002023.03.02 05:00buy1020.011834.900.001841.80
2012023.03.02 16:45close1020.011835.000.001841.800.101023.25
2022023.03.02 16:45buy1030.011835.500.001845.76
2032023.03.02 23:17close1030.011835.890.001845.760.391023.64
2042023.03.02 23:17buy1040.011836.390.001838.65
2052023.03.03 01:15close1040.011836.520.001838.650.131023.77
2062023.03.03 01:15close1010.011836.520.001845.800.361024.13
2072023.03.03 01:15buy1050.011837.020.001839.76
2082023.03.03 02:03t/p1050.011839.760.001839.762.741026.87
2092023.03.03 13:16t/p1000.011848.290.001848.299.701036.57
2102023.03.03 13:17t/p990.011848.690.001848.699.681046.25
2112023.03.03 18:00buy1060.011845.090.001856.21
2122023.03.06 06:13t/p1060.011856.210.001856.2111.121057.37
2132023.03.06 12:30buy1070.011852.960.001857.04
2142023.03.07 03:30buy1080.011846.530.001850.83
2152023.03.07 09:26t/p1080.011850.830.001850.834.301061.67
2162023.03.08 02:01buy1090.011814.410.001816.13
2172023.03.08 03:32buy1100.011813.370.001814.89
2182023.03.08 06:17buy1110.011811.370.001813.33
2192023.03.08 08:53t/p1110.011813.330.001813.331.961063.63
2202023.03.08 08:53buy1120.011813.830.001818.23
2212023.03.08 09:41t/p1100.011814.890.001814.891.521065.15
2222023.03.08 10:30buy1130.011814.330.001816.53
2232023.03.08 13:15close1130.011815.580.001816.531.251066.40
2242023.03.08 13:15close1120.011815.580.001818.231.751068.15
2252023.03.08 13:15close1090.011815.580.001816.131.171069.32
2262023.03.08 13:15buy1140.011816.080.001823.00
2272023.03.08 14:16buy1150.011815.450.001819.45
2282023.03.08 15:00buy1160.011815.410.001818.91
2292023.03.08 16:32close1160.011816.500.001818.911.091070.41
2302023.03.08 16:32close1150.011816.500.001819.451.051071.46
2312023.03.08 16:32close1140.011816.500.001823.000.421071.88
2322023.03.08 16:32buy1170.011817.000.001819.60
2332023.03.08 16:48t/p1170.011819.600.001819.602.601074.48
2342023.03.08 19:45buy1180.011818.290.001823.63
2352023.03.08 21:15buy1190.011816.200.001821.34
2362023.03.09 01:15buy1200.011815.680.001820.58
2372023.03.09 15:32t/p1200.011820.580.001820.584.901079.38
2382023.03.09 15:33t/p1190.011821.340.001821.345.141084.52
2392023.03.09 15:43t/p1180.011823.630.001823.635.341089.86
2402023.03.09 19:15buy1210.011828.400.001833.62
2412023.03.09 20:43t/p1210.011833.620.001833.625.221095.08
2422023.03.09 23:15buy1220.011831.560.001836.08
2432023.03.09 23:45buy1230.011831.330.001835.39
2442023.03.10 04:15buy1240.011832.700.001837.24
2452023.03.10 10:02t/p1230.011835.390.001835.394.061099.14
2462023.03.10 10:02t/p1220.011836.080.001836.084.521103.66
2472023.03.10 12:15buy1250.011833.580.001838.30
2482023.03.10 13:15buy1260.011835.020.001842.60
2492023.03.10 14:00close1250.011834.790.001838.301.211104.87
2502023.03.10 14:00close1240.011834.790.001837.242.091106.96
2512023.03.10 14:00buy1270.011835.290.001840.79
2522023.03.10 15:32t/p1270.011840.790.001840.795.501112.46
2532023.03.10 15:43t/p1260.011842.600.001842.607.581120.04
2542023.03.10 15:45buy1280.011844.210.001868.45
2552023.03.10 16:35close1070.011853.470.001857.040.511120.55
2562023.03.10 19:15buy1290.011859.600.001869.92
2572023.03.10 22:53t/p1280.011868.450.001868.4524.241144.79
2582023.03.10 23:01t/p1290.011869.920.001869.9210.321155.11
2592023.03.13 04:15buy1300.011876.090.001883.31
2602023.03.13 04:30t/p1300.011883.310.001883.317.221162.33
2612023.03.13 08:15buy1310.011882.210.001891.87
2622023.03.13 10:15buy1320.011878.890.001892.99
2632023.03.13 11:37t/p1310.011891.870.001891.879.661171.99
2642023.03.13 11:40t/p1320.011892.990.001892.9914.101186.09
2652023.03.13 13:30buy1330.011888.130.001902.01
2662023.03.13 14:53t/p1330.011902.010.001902.0113.881199.97
2672023.03.13 19:00buy1340.011909.440.001921.90
2682023.03.14 05:20buy1350.011907.130.001911.61
2692023.03.14 08:16t/p1350.011911.610.001911.614.481204.45
2702023.03.14 16:07buy1360.011905.350.001919.23
2712023.03.14 16:45buy1370.011905.430.001924.89
2722023.03.14 18:45buy1380.011906.720.001915.12
2732023.03.15 13:32t/p1380.011915.120.001915.128.401212.85
2742023.03.15 14:01t/p1360.011919.230.001919.2313.881226.73
2752023.03.15 14:03t/p1340.011921.900.001921.9012.461239.19
2762023.03.15 14:13t/p1370.011924.890.001924.8919.461258.65
2772023.03.15 16:00buy1390.011926.410.001943.85
2782023.03.15 16:45buy1400.011922.870.001933.23
2792023.03.15 17:30buy1410.011926.280.001943.20
2802023.03.15 18:00buy1420.011927.410.001943.71
2812023.03.15 18:23t/p1400.011933.230.001933.2310.361269.01
2822023.03.15 21:12buy1430.011919.750.001933.45
2832023.03.16 11:45close1430.011920.120.001933.450.371269.38
2842023.03.16 11:45buy1440.011920.620.001928.32
2852023.03.16 14:08t/p1440.011928.320.001928.327.701277.08
2862023.03.16 16:15buy1450.011928.890.001939.59
2872023.03.16 16:45close1450.011931.480.001939.592.591279.67
2882023.03.16 16:45close1420.011931.480.001943.714.071283.74
2892023.03.16 16:45close1410.011931.480.001943.205.201288.94
2902023.03.16 16:45close1390.011931.480.001943.855.071294.01
2912023.03.16 16:45buy1460.011931.980.001948.86
2922023.03.16 20:47buy1470.011920.920.001929.86
2932023.03.16 22:30buy1480.011919.600.001921.78
2942023.03.17 00:05buy1490.011920.130.001922.77
2952023.03.17 00:30close1490.011920.170.001922.770.041294.05
2962023.03.17 00:30close1480.011920.170.001921.780.571294.62
2972023.03.17 00:30buy1500.011920.670.001924.39
2982023.03.17 01:00buy1510.011920.330.001922.93
2992023.03.17 03:30close1510.011921.630.001922.931.301295.92
3002023.03.17 03:30close1500.011921.630.001924.390.961296.88
3012023.03.17 03:30close1470.011921.630.001929.860.711297.59
3022023.03.17 03:30buy1520.011922.130.001929.29
3032023.03.17 05:27t/p1520.011929.290.001929.297.161304.75
3042023.03.17 15:12t/p1460.011948.860.001948.8616.881321.63
3052023.03.17 18:45buy1530.011960.110.001969.11
3062023.03.17 19:31t/p1530.011969.110.001969.119.001330.63
3072023.03.17 22:30buy1540.011980.400.001993.04
3082023.03.20 02:02buy1550.011978.210.001982.81
3092023.03.20 07:52t/p1550.011982.810.001982.814.601335.23
3102023.03.20 08:03t/p1540.011993.040.001993.0412.641347.87
3112023.03.21 00:15buy1560.011979.290.001983.23
3122023.03.21 02:15buy1570.011979.540.001985.16
3132023.03.21 02:47buy1580.011978.860.001984.78
3142023.03.21 04:53t/p1560.011983.230.001983.233.941351.81
3152023.03.21 05:32t/p1580.011984.780.001984.785.921357.73
3162023.03.21 15:30buy1590.011965.280.001977.62
3172023.03.22 01:00buy1600.011941.500.001944.64
3182023.03.22 02:45buy1610.011943.740.001946.06
3192023.03.22 03:02t/p1600.011944.640.001944.643.141360.87
3202023.03.22 03:13t/p1610.011946.060.001946.062.321363.19
3212023.03.22 03:45buy1620.011945.010.001949.71
3222023.03.22 05:31buy1630.011941.140.001945.66
3232023.03.22 10:15close1630.011943.300.001945.662.161365.35
3242023.03.22 10:15buy1640.011943.800.001962.26
3252023.03.22 16:48t/p1620.011949.710.001949.714.701370.05
3262023.03.22 20:03t/p1640.011962.260.001962.2618.461388.51
3272023.03.22 20:50t/p1590.011977.620.001977.6212.341400.85
3282023.03.23 01:15buy1650.011966.940.001971.16
3292023.03.23 02:03t/p1650.011971.160.001971.164.221405.07
3302023.03.23 10:15buy1660.011978.440.001984.82
3312023.03.23 12:00buy1670.011978.390.001985.17
3322023.03.23 12:30buy1680.011979.800.001988.88
3332023.03.23 14:15close1670.011978.410.001985.170.021405.09
3342023.03.23 14:15buy1690.011978.910.001985.01
3352023.03.23 15:30close1660.011978.450.001984.820.011405.10
3362023.03.23 15:30buy1700.011978.950.002003.17
3372023.03.23 17:22t/p1690.011985.010.001985.016.101411.20
3382023.03.23 17:22t/p1570.011985.160.001985.165.621416.82
3392023.03.23 18:16t/p1680.011988.880.001988.889.081425.90
3402023.03.23 21:15buy1710.011996.500.002012.82
3412023.03.23 22:00buy1720.011998.160.002017.82
3422023.03.24 02:30buy1730.011994.000.002001.48
3432023.03.24 03:00close1700.011993.560.002003.1714.611440.51
3442023.03.24 03:00buy1740.011994.060.002002.12
3452023.03.24 14:00close1740.011995.620.002002.121.561442.07
3462023.03.24 14:00close1730.011995.620.002001.481.621443.69
3472023.03.24 14:00buy1750.011996.120.002006.46
3482023.03.24 14:30buy1760.011997.220.002009.76
3492023.03.24 16:45close1750.011996.950.002006.460.831444.52
3502023.03.24 16:45close1710.011996.950.002012.820.451444.97
3512023.03.24 16:45buy1770.011997.450.002019.99
3522023.03.24 17:15buy1780.011993.810.002008.41
3532023.03.31 05:00close1720.011982.100.002017.82-16.061428.91
3542023.03.31 12:01buy1790.011976.870.001980.91
3552023.03.31 14:07t/p1790.011980.910.001980.914.041432.95
3562023.03.31 15:45buy1800.011982.210.001993.71
3572023.03.31 20:30close1760.011968.440.002009.76-28.781404.17
3582023.03.31 21:45buy1810.011971.180.001979.18
3592023.03.31 22:45close1770.011969.930.002019.99-27.521376.65
3602023.03.31 23:15close1780.011968.940.002008.41-24.871351.78
3612023.04.03 09:34buy1820.011955.270.001962.69
3622023.04.03 10:15buy1830.011958.850.001974.33
3632023.04.03 11:02t/p1820.011962.690.001962.697.421359.20
3642023.04.03 14:17t/p1830.011974.330.001974.3315.481374.68
3652023.04.03 15:03t/p1810.011979.180.001979.188.001382.68
3662023.04.03 17:15buy1840.011983.360.002004.70
3672023.04.03 21:30buy1850.011985.250.001991.47
3682023.04.03 22:16buy1860.011985.360.001989.58
3692023.04.03 22:45close1860.011985.520.001989.580.161382.84
3702023.04.03 22:45close1850.011985.520.001991.470.271383.11
3712023.04.03 22:45close1840.011985.520.002004.702.161385.27
3722023.04.03 22:45close1800.011985.520.001993.713.311388.58
3732023.04.03 22:45buy1870.011986.020.001993.18
3742023.04.04 01:15buy1880.011985.530.001988.81
3752023.04.04 02:06buy1890.011984.590.001985.05
3762023.04.04 02:38t/p1890.011985.050.001985.050.461389.04
3772023.04.04 03:30buy1900.011984.950.001987.71
3782023.04.04 08:18buy1910.011980.650.001984.97
3792023.04.04 11:00close1910.011982.000.001984.971.351390.39
3802023.04.04 11:00buy1920.011982.500.001992.90
3812023.04.04 13:30close1920.011983.790.001992.901.291391.68
3822023.04.04 13:30buy1930.011984.290.001991.91
3832023.04.04 16:25t/p1900.011987.710.001987.712.761394.44
3842023.04.04 16:32t/p1880.011988.810.001988.813.281397.72
3852023.04.04 16:44t/p1930.011991.910.001991.917.621405.34
3862023.04.04 17:00t/p1870.011993.180.001993.187.161412.50
3872023.04.05 18:45buy1940.012021.120.002042.96
3882023.04.05 21:15buy1950.012022.000.002027.24
3892023.04.05 22:30buy1960.012022.220.002024.76
3902023.04.06 01:45buy1970.012020.650.002023.91
3912023.04.12 15:31close1970.012021.180.002023.910.531413.03
3922023.04.12 15:32close1940.012021.640.002042.960.521413.55
3932023.04.12 15:32close1950.012022.510.002027.240.511414.06
3942023.04.12 15:33close1960.012022.730.002024.760.511414.57
3952023.04.12 18:00buy1980.012007.810.002019.03
3962023.04.12 19:15buy1990.012008.540.002014.38
3972023.04.12 21:08t/p1990.012014.380.002014.385.841420.41
3982023.04.13 03:01t/p1980.012019.030.002019.0311.221431.63
3992023.04.13 05:15buy2000.012019.460.002026.04
4002023.04.13 07:15buy2010.012019.060.002025.18
4012023.04.13 09:15buy2020.012018.670.002024.85
4022023.04.13 10:38t/p2020.012024.850.002024.856.181437.81
4032023.04.13 10:40t/p2010.012025.180.002025.186.121443.93
4042023.04.13 11:05t/p2000.012026.040.002026.046.581450.51
4052023.04.13 18:45buy2030.012042.040.002058.26
4062023.04.13 23:00buy2040.012040.760.002048.48
4072023.04.14 03:00buy2050.012040.040.002042.08
4082023.04.14 03:30buy2060.012040.250.002043.07
4092023.04.14 03:42t/p2050.012042.080.002042.082.041452.55
4102023.04.14 03:45t/p2060.012043.070.002043.072.821455.37
4112023.04.14 04:15buy2070.012042.350.002049.37
4122023.04.14 09:00buy2080.012043.110.002049.23
4132023.04.14 09:31close2070.012042.930.002049.370.581455.95
4142023.04.14 09:31close2040.012042.930.002048.482.171458.12
4152023.04.14 09:31close2030.012042.930.002058.260.891459.01
4162023.04.14 09:31buy2090.012043.430.002050.21
4172023.04.14 12:36buy2100.012036.710.002044.67
4182023.04.14 15:30buy2110.012036.920.002045.88
4192023.04.21 14:00close2080.011987.900.002049.23-55.211403.80
4202023.04.21 14:30close2090.011985.170.002050.21-58.261345.54
4212023.04.21 15:32buy2120.011990.420.002004.28
4222023.04.21 17:30close2100.011982.080.002044.67-54.631290.91
4232023.04.21 20:30close2110.011979.620.002045.88-57.301233.61
4242023.04.24 09:00buy2130.011979.680.001983.98
4252023.04.24 10:30buy2140.011982.870.001992.63
4262023.04.24 11:00buy2150.011983.000.001993.02
4272023.04.24 11:54t/p2130.011983.980.001983.984.301237.91
4282023.04.24 17:45buy2160.011986.500.002010.66
4292023.04.25 01:05t/p2140.011992.630.001992.639.761247.67
4302023.04.25 01:08t/p2150.011993.020.001993.0210.021257.69
4312023.04.25 08:15buy2170.011994.120.002000.20
4322023.04.25 08:49buy2180.011994.410.001998.25
4332023.04.25 12:15close2160.011989.730.002010.663.231260.92
4342023.04.25 12:15buy2190.011990.230.001995.91
4352023.04.25 20:26t/p2190.011995.910.001995.915.681266.60
4362023.04.25 20:53t/p2180.011998.250.001998.253.841270.44
4372023.04.25 21:03t/p2170.012000.200.002000.206.081276.52
4382023.04.25 23:00buy2200.011999.540.002009.26
4392023.04.26 01:15buy2210.011997.970.002001.67
4402023.04.26 03:10t/p2210.012001.670.002001.673.701280.22
4412023.04.26 05:00buy2220.011999.190.002005.57
4422023.04.26 05:30buy2230.011998.620.002003.86
4432023.04.26 07:49close2120.011995.770.002004.285.351285.57
4442023.04.26 07:49buy2240.011996.270.002000.57
4452023.04.26 09:22close2240.011996.910.002000.570.641286.21
4462023.04.26 09:22buy2250.011997.410.002000.93
4472023.04.26 10:30close2250.011998.040.002000.930.631286.84
4482023.04.26 10:30buy2260.011998.540.002006.24
4492023.04.26 13:00close2260.011998.660.002006.240.121286.96
4502023.04.26 13:00close2230.011998.660.002003.860.041287.00
4512023.04.26 13:00buy2270.011999.160.002004.66
4522023.04.26 16:00buy2280.011998.260.002011.28
4532023.04.26 16:22t/p2270.012004.660.002004.665.501292.50
4542023.04.26 16:24t/p2220.012005.570.002005.576.381298.88
4552023.04.26 21:56buy2290.011991.040.001996.34
4562023.04.27 05:16t/p2290.011996.340.001996.345.301304.18
4572023.04.27 17:07buy2300.011985.500.002001.28
4582023.04.27 20:00buy2310.011984.770.001991.37
4592023.04.28 17:38t/p2310.011991.370.001991.376.601310.78
4602023.05.01 07:13buy2320.011984.280.001989.62
4612023.05.01 14:42t/p2320.011989.620.001989.625.341316.12
4622023.05.01 15:32close2200.012000.050.002009.260.511316.63
4632023.05.01 15:35t/p2300.012001.280.002001.2815.781332.41
4642023.05.01 23:30buy2330.011981.190.001984.01
4652023.05.02 02:30buy2340.011983.000.001986.00
4662023.05.02 03:15buy2350.011983.330.001987.81
4672023.05.02 03:45close2340.011983.040.001986.000.041332.45
4682023.05.02 03:45close2330.011983.040.001984.011.851334.30
4692023.05.02 03:45buy2360.011983.540.001988.44
4702023.05.02 04:15buy2370.011983.510.001988.35
4712023.05.02 10:00close2370.011984.430.001988.350.921335.22
4722023.05.02 10:00close2360.011984.430.001988.440.891336.11
4732023.05.02 10:00close2350.011984.430.001987.811.101337.21
4742023.05.02 10:00buy2380.011984.930.001989.69
4752023.05.02 11:45buy2390.011981.760.001987.72
4762023.05.02 12:15buy2400.011983.150.001991.89
4772023.05.02 12:45close2400.011984.610.001991.891.461338.67
4782023.05.02 12:45close2390.011984.610.001987.722.851341.52
4792023.05.02 12:45buy2410.011985.110.001997.77
4802023.05.02 14:06t/p2380.011989.690.001989.694.761346.28
4812023.05.02 17:13t/p2410.011997.770.001997.7712.661358.94
4822023.05.02 17:14close2280.011998.790.002011.280.531359.47
4832023.05.02 21:30buy2420.012015.390.002023.23
4842023.05.02 22:00buy2430.012014.620.002020.92
4852023.05.02 23:30buy2440.012016.680.002020.60
4862023.05.03 01:30buy2450.012016.300.002017.22
4872023.05.03 03:00close2430.012015.710.002020.921.091360.56
4882023.05.03 03:00close2420.012015.710.002023.230.321360.88
4892023.05.03 03:00buy2460.012016.210.002016.93
4902023.05.03 03:30buy2470.012016.420.002020.30
4912023.05.03 04:15t/p2460.012016.930.002016.930.721361.60
4922023.05.03 04:16t/p2450.012017.220.002017.220.921362.52
4932023.05.03 05:00buy2480.012017.100.002019.44
4942023.05.03 06:15buy2490.012018.180.002020.84
4952023.05.03 07:00close2490.012018.300.002020.840.121362.64
4962023.05.03 07:00close2480.012018.300.002019.441.201363.84
4972023.05.03 07:00close2470.012018.300.002020.301.881365.72
4982023.05.03 07:00close2440.012018.300.002020.601.621367.34
4992023.05.03 07:00buy2500.012018.800.002021.78
5002023.05.03 07:48buy2510.012017.570.002018.01
5012023.05.03 09:30buy2520.012016.540.002020.22
5022023.05.03 09:50t/p2510.012018.010.002018.010.441367.78
5032023.05.03 10:00buy2530.012018.330.002025.59
5042023.05.03 11:30buy2540.012016.320.002023.16
5052023.05.03 13:36close2540.012016.340.002023.160.021367.80
5062023.05.03 13:36buy2550.012016.840.002018.54
5072023.05.03 16:29t/p2550.012018.540.002018.541.701369.50
5082023.05.03 17:45buy2560.012019.060.002032.86
5092023.05.03 17:52t/p2520.012020.220.002020.223.681373.18
5102023.05.03 18:02t/p2500.012021.780.002021.782.981376.16
5112023.05.03 18:22t/p2530.012025.590.002025.597.261383.42
5122023.05.03 21:02t/p2560.012032.860.002032.8613.801397.22
5132023.05.03 21:15buy2570.012025.830.002038.07
5142023.05.03 22:30buy2580.012025.950.002043.35
5152023.05.03 23:50t/p2570.012038.070.002038.0712.241409.46
5162023.05.04 01:05t/p2580.012043.350.002043.3517.401426.86
5172023.05.04 16:45buy2590.012041.070.002058.53
5182023.05.04 17:44t/p2590.012058.530.002058.5317.461444.32
5192023.05.04 18:36buy2600.012050.470.002060.89
5202023.05.04 19:15buy2610.012054.070.002074.83
5212023.05.04 19:45buy2620.012051.680.002067.66
5222023.05.04 20:45buy2630.012048.670.002056.47
5232023.05.04 22:15close2630.012049.070.002056.470.401444.72
5242023.05.04 22:15buy2640.012049.570.002057.37
5252023.05.04 23:15close2640.012050.140.002057.370.571445.29
5262023.05.04 23:15buy2650.012050.640.002056.98
5272023.05.11 23:30close2600.012013.690.002060.89-36.781408.51
5282023.05.12 01:15close2610.012015.960.002074.83-38.111370.40
5292023.05.12 01:45close2620.012015.350.002067.66-36.331334.07
5302023.05.12 05:15close2650.012011.920.002056.98-38.721295.35
5312023.05.12 10:15buy2660.012010.210.002018.67
5322023.05.12 13:45buy2670.012006.810.002018.07
5332023.05.12 16:05t/p2670.012018.070.002018.0711.261306.61
5342023.05.12 16:06t/p2660.012018.670.002018.678.461315.07
5352023.05.12 19:15buy2680.012010.470.002014.07
5362023.05.12 20:01t/p2680.012014.070.002014.073.601318.67
5372023.05.15 15:30buy2690.012015.350.002021.61
5382023.05.15 16:58t/p2690.012021.610.002021.616.261324.93
5392023.05.15 18:45buy2700.012018.550.002028.39
5402023.05.16 10:52buy2710.012009.630.002019.29
5412023.05.16 13:15buy2720.012010.410.002012.89
5422023.05.16 15:30buy2730.012007.380.002014.36
5432023.05.16 15:43t/p2720.012012.890.002012.892.481327.41
5442023.05.16 15:45t/p2730.012014.360.002014.366.981334.39
5452023.05.17 01:30buy2740.011989.890.001993.11
5462023.05.17 03:00buy2750.011990.150.001991.79
5472023.05.17 03:20t/p2750.011991.790.001991.791.641336.03
5482023.05.17 05:00buy2760.011992.950.001998.57
5492023.05.17 06:00close2740.011992.550.001993.112.661338.69
5502023.05.17 06:00buy2770.011993.050.001997.67
5512023.05.22 23:45close2700.011971.650.002028.39-46.901291.79
5522023.05.23 15:45close2710.011959.200.002019.29-50.431241.36
5532023.05.23 18:45buy2780.011967.250.001972.51
5542023.05.23 19:15buy2790.011968.770.001977.05
5552023.05.23 19:38t/p2780.011972.510.001972.515.261246.62
5562023.05.23 21:26t/p2790.011977.050.001977.058.281254.90
5572023.05.24 10:00close2760.011971.540.001998.57-21.411233.49
5582023.05.24 10:45buy2800.011976.440.001987.36
5592023.05.24 11:00close2770.011973.800.001997.67-19.251214.24
5602023.05.25 01:15buy2810.011959.230.001962.01
5612023.05.25 01:46buy2820.011959.860.001963.14
5622023.05.25 04:00buy2830.011959.650.001963.07
5632023.05.25 11:23t/p2810.011962.010.001962.012.781217.02
5642023.05.25 11:25t/p2830.011963.070.001963.073.421220.44
5652023.05.25 11:25t/p2820.011963.140.001963.143.281223.72
5662023.05.25 17:05buy2840.011949.160.001963.92
5672023.05.26 01:05buy2850.011941.660.001946.72
5682023.05.26 04:00buy2860.011941.280.001949.74
5692023.05.26 04:58t/p2850.011946.720.001946.725.061228.78
5702023.05.26 08:35t/p2860.011949.740.001949.748.461237.24
5712023.05.26 16:45buy2870.011950.430.001962.17
5722023.05.26 17:15buy2880.011950.730.001962.89
5732023.05.30 17:15close2880.011955.910.001962.895.181242.42
5742023.05.30 17:15close2870.011955.910.001962.175.481247.90
5752023.05.30 17:15close2840.011955.910.001963.926.751254.65
5762023.05.30 17:15buy2890.011956.410.001966.61
5772023.05.31 06:00buy2900.011956.510.001961.59
5782023.05.31 08:30buy2910.011959.570.001962.43
5792023.05.31 08:43t/p2900.011961.590.001961.595.081259.73
5802023.05.31 08:50t/p2910.011962.430.001962.432.861262.59
5812023.05.31 11:15buy2920.011958.320.001963.14
5822023.05.31 12:21buy2930.011958.020.001960.36
5832023.05.31 13:00close2930.011958.480.001960.360.461263.05
5842023.05.31 13:00close2920.011958.480.001963.140.161263.21
5852023.05.31 13:00close2890.011958.480.001966.612.071265.28
5862023.05.31 13:00buy2940.011958.980.001966.46
5872023.05.31 14:15buy2950.011958.590.001964.21
5882023.05.31 16:13t/p2950.011964.210.001964.215.621270.90
5892023.05.31 16:42t/p2940.011966.460.001966.467.481278.38
5902023.05.31 17:30buy2960.011966.450.001977.69
5912023.05.31 18:15close2800.011971.120.001987.36-5.321273.06
5922023.05.31 20:45buy2970.011968.340.001978.22
5932023.05.31 21:15buy2980.011967.370.001975.31
5942023.06.01 01:10buy2990.011963.980.001965.92
5952023.06.01 01:46t/p2990.011965.920.001965.921.941275.00
5962023.06.01 03:15buy3000.011966.760.001968.70
5972023.06.01 16:00t/p3000.011968.700.001968.701.941276.94
5982023.06.01 16:30buy3010.011968.550.001987.73
5992023.06.01 17:00t/p2980.011975.310.001975.317.941284.88
6002023.06.01 18:07t/p2960.011977.690.001977.6911.241296.12
6012023.06.01 18:07t/p2970.011978.220.001978.229.881306.00
6022023.06.01 21:00buy3020.011978.390.001982.23
6032023.06.01 21:45buy3030.011977.680.001980.10
6042023.06.01 22:17buy3040.011977.500.001980.26
6052023.06.02 02:49close3010.011976.650.001987.738.101314.10
6062023.06.02 02:49buy3050.011977.150.001978.69
6072023.06.02 05:07t/p3050.011978.690.001978.691.541315.64
6082023.06.02 05:50t/p3030.011980.100.001980.102.421318.06
6092023.06.02 05:51t/p3040.011980.260.001980.262.761320.82
6102023.06.02 06:19t/p3020.011982.230.001982.233.841324.66
6112023.06.05 01:25buy3060.011950.340.001955.26
6122023.06.05 04:45buy3070.011947.480.001949.50
6132023.06.05 06:45buy3080.011947.430.001953.67
6142023.06.05 08:44buy3090.011946.000.001948.80
6152023.06.05 17:00t/p3090.011948.800.001948.802.801327.46
6162023.06.05 17:00t/p3070.011949.500.001949.502.021329.48
6172023.06.05 17:00t/p3080.011953.670.001953.676.241335.72
6182023.06.05 17:01t/p3060.011955.260.001955.264.921340.64
6192023.06.06 17:19buy3100.011961.380.001971.82
6202023.06.06 18:00buy3110.011960.390.001971.81
6212023.06.06 18:31buy3120.011961.070.001968.45
6222023.06.07 11:15buy3130.011959.370.001967.71
6232023.06.07 16:45close3130.011961.830.001967.712.461343.10
6242023.06.07 16:45close3120.011961.830.001968.450.761343.86
6252023.06.07 16:45close3110.011961.830.001971.811.441345.30
6262023.06.07 16:45close3100.011961.830.001971.820.451345.75
6272023.06.07 16:45buy3140.011962.330.001972.03
6282023.06.08 21:46buy3150.011964.760.001969.40
6292023.06.09 01:45buy3160.011966.260.001968.02
6302023.06.09 02:45buy3170.011966.170.001967.65
6312023.06.09 04:15close3140.011964.510.001972.032.181347.93
6322023.06.09 04:15buy3180.011965.010.001967.73
6332023.06.09 09:30close3150.011964.800.001969.400.041347.97
6342023.06.09 09:30buy3190.011965.300.001970.00
6352023.06.09 15:30t/p3170.011967.650.001967.651.481349.45
6362023.06.09 15:30t/p3180.011967.730.001967.732.721352.17
6372023.06.09 15:30t/p3160.011968.020.001968.021.761353.93
6382023.06.09 15:31t/p3190.011970.000.001970.004.701358.63
6392023.06.09 15:45buy3200.011965.820.001969.38
6402023.06.09 17:00buy3210.011962.410.001972.33
6412023.06.12 18:09buy3220.011955.880.001965.98
6422023.06.13 01:45buy3230.011958.430.001961.19
6432023.06.13 04:15close3230.011958.780.001961.190.351358.98
6442023.06.13 04:15close3220.011958.780.001965.982.901361.88
6452023.06.13 04:15buy3240.011959.280.001962.20
6462023.06.13 05:45buy3250.011958.670.001963.47
6472023.06.13 09:21t/p3240.011962.200.001962.202.921364.80
6482023.06.13 10:08t/p3250.011963.470.001963.474.801369.60
6492023.06.13 15:30t/p3200.011969.380.001969.383.561373.16
6502023.06.13 22:52buy3260.011943.360.001948.06
6512023.06.14 01:07buy3270.011944.400.001949.38
6522023.06.14 01:45buy3280.011945.350.001951.23
6532023.06.14 03:00close3260.011943.800.001948.060.441373.60
6542023.06.14 03:00buy3290.011944.300.001947.88
6552023.06.14 05:00close3290.011946.700.001947.882.401376.00
6562023.06.14 05:00close3280.011946.700.001951.231.351377.35
6572023.06.14 05:00close3270.011946.700.001949.382.301379.65
6582023.06.14 05:00buy3300.011947.200.001953.00
6592023.06.14 06:00buy3310.011947.830.001951.31
6602023.06.14 06:30buy3320.011948.020.001951.02
6612023.06.14 07:30close3320.011948.390.001951.020.371380.02
6622023.06.14 07:30close3310.011948.390.001951.310.561380.58
6632023.06.14 07:30close3300.011948.390.001953.001.191381.77
6642023.06.14 07:30buy3330.011948.890.001952.37
6652023.06.14 08:15buy3340.011949.350.001951.81
6662023.06.14 08:45buy3350.011947.950.001950.85
6672023.06.14 10:30close3350.011948.850.001950.850.901382.67
6682023.06.14 10:30buy3360.011949.350.001957.03
6692023.06.14 12:26t/p3340.011951.810.001951.812.461385.13
6702023.06.14 12:34t/p3330.011952.370.001952.373.481388.61
6712023.06.14 15:15buy3370.011948.480.001953.24
6722023.06.14 15:36t/p3370.011953.240.001953.244.761393.37
6732023.06.14 15:43t/p3360.011957.030.001957.037.681401.05
6742023.06.15 08:30buy3380.011935.850.001945.35
6752023.06.15 10:37buy3390.011934.230.001943.29
6762023.06.15 11:15buy3400.011934.480.001944.94
6772023.06.15 12:30close3390.011934.350.001943.290.121401.17
6782023.06.15 12:30buy3410.011934.850.001942.43
6792023.06.15 13:46close3400.011934.710.001944.940.231401.40
6802023.06.15 13:46buy3420.011935.210.001939.41
6812023.06.15 16:25t/p3420.011939.410.001939.414.201405.60
6822023.06.15 16:27t/p3410.011942.430.001942.437.581413.18
6832023.06.15 16:43t/p3380.011945.350.001945.359.501422.68
6842023.06.16 09:33close3210.011962.920.001972.330.511423.19
6852023.06.16 16:45buy3430.011962.910.001975.15
6862023.06.16 17:56buy3440.011960.330.001970.55
6872023.06.16 18:30buy3450.011960.650.001973.45
6882023.06.16 20:25buy3460.011958.100.001965.60
6892023.06.26 01:15close3430.011923.680.001975.15-39.231383.96
6902023.06.26 02:15close3440.011924.300.001970.55-36.031347.93
6912023.06.26 03:00close3450.011925.150.001973.45-35.501312.43
6922023.06.26 04:45close3460.011927.640.001965.60-30.461281.97
6932023.06.26 18:17buy3470.011926.410.001935.09
6942023.06.27 03:30buy3480.011923.740.001928.92
6952023.06.27 04:00buy3490.011922.960.001926.58
6962023.06.27 04:42t/p3490.011926.580.001926.583.621285.59
6972023.06.27 04:49t/p3480.011928.920.001928.925.181290.77
6982023.06.27 10:00buy3500.011927.720.001934.24
6992023.06.27 15:01buy3510.011924.180.001931.16
7002023.06.28 01:15buy3520.011915.060.001918.66
7012023.06.28 04:00close3520.011915.950.001918.660.891291.66
7022023.06.28 04:00buy3530.011916.450.001918.91
7032023.06.28 23:54close at stop3530.011906.650.001918.91-9.801281.86
7042023.06.28 23:54close at stop3510.011906.650.001931.16-17.531264.33
7052023.06.28 23:54close at stop3500.011906.650.001934.24-21.071243.26
7062023.06.28 23:54close at stop3470.011906.650.001935.09-19.761223.50
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif b/Bkp/Used/14020502/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..005d1407b75473ecb73297c47ab58a18c4c65f6c GIT binary patch literal 9079 zcmcg}gq%PN578sUbHY`MvB^Z85bRBT0KoiBHI_*1O&TNwJAY%`TrD?|$Qy6~02#Pp-Q+>ukZyYVuZSD} ze+YJd9yyP{u`F+VfGSG}0AdNa(X~X*-!yA^^S){Q|ML>M`F+5DvjC720s+Axp<&?> zut+!}Dmo?>85f_Bn3SA?LZ_ysXJlq&=j7()7ZhTOic3n%$}1|XzE;=N)?w=#8gWg{ zEv;?s-@bQrc6Imk_Vo`84h@ftmJv-%PEF6?XXoY@7MFf3udM$3wYI*oxwXBsySM-Q z;PB7iqvMm)gDRpd;(ynfSAgps2IR7W<}KR03yH{;7aCO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+ + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2023.01.03 01:00 - 2023.06.28 23:45 (2023.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_OSC"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=480; fastOSCLength=10; fastOSCMultiplier=1; slowOSCLength=30; slowOSCMultiplier=3; minPowerOSC=0.055; minVarianceOSC=0; zDeviation=5; zBackStep=3; shortCycleFastMultiplier=1; shortCycleSlowMultiplier=4; mediumCycleFastMultiplier=7; mediumCycleSlowMultiplier=14; longCycleFastMultiplier=70; longCycleSlowMultiplier=140; showShortCycle=false; +showShortCycleCrossLines=false; +showMediumCycle=false; +showMediumCycleCrossLines=false; +showLongCycle=false; +showLongCycleCrossLines=false; +shortCycleFastColor=Green; shortCycleSlowColor=Red; mediumCycleFastColor=Aqua; mediumCycleSlowColor=Magenta; longCycleFastColor=Goldenrod; longCycleSlowColor=Brown;
Bars in test12551Ticks modelled15360882Modelling qualityn/a
Mismatched charts errors1395
Initial deposit1000.00SpreadCurrent (57)
Total net profit58.78Gross profit582.17Gross loss-523.39
Profit factor1.11Expected payoff0.78
Absolute drawdown10.15Maximal drawdown322.36 (23.55%)Relative drawdown23.55% (322.36)
Total trades75Short positions (won %)0 (0.00%)Long positions (won %)75 (80.00%)
Profit trades (% of total)60 (80.00%)Loss trades (% of total)15 (20.00%)
Largestprofit trade32.50loss trade-83.16
Averageprofit trade9.70loss trade-34.89
Maximumconsecutive wins (profit in money)23 (247.24)consecutive losses (loss in money)5 (-152.61)
Maximalconsecutive profit (count of wins)247.24 (23)consecutive loss (count of losses)-224.33 (4)
Averageconsecutive wins12consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12023.01.06 10:45buy10.011838.920.001843.76
22023.01.06 13:30buy20.011840.110.001852.61
32023.01.06 15:41t/p10.011843.760.001843.764.841004.84
42023.01.06 17:02t/p20.011852.610.001852.6112.501017.34
52023.01.10 10:45buy30.011874.470.001882.55
62023.01.11 07:36t/p30.011882.550.001882.558.081025.42
72023.01.12 04:00buy40.011880.930.001888.89
82023.01.12 14:23t/p40.011888.890.001888.897.961033.38
92023.01.17 16:30buy50.011915.960.001934.12
102023.01.17 17:00buy60.011913.860.001920.64
112023.01.18 10:30buy70.011912.320.001931.62
122023.01.18 10:45buy80.011912.000.001927.60
132023.01.18 15:30t/p60.011920.640.001920.646.781040.16
142023.01.19 06:45buy90.011909.950.001916.75
152023.01.19 16:21t/p90.011916.750.001916.756.801046.96
162023.01.19 21:26t/p80.011927.600.001927.6015.601062.56
172023.01.19 22:07t/p70.011931.620.001931.6219.301081.86
182023.01.19 22:13t/p50.011934.120.001934.1218.161100.02
192023.01.23 02:45buy100.011930.950.001942.63
202023.01.23 21:30buy110.011928.100.001937.10
212023.01.24 08:31t/p110.011937.100.001937.109.001109.02
222023.01.25 18:57buy120.011937.690.001955.77
232023.01.25 21:57t/p100.011942.630.001942.6311.681120.70
242023.01.27 14:15buy130.011932.410.001941.85
252023.01.27 18:45buy140.011931.740.001962.44
262023.01.31 17:15buy150.011922.500.001941.44
272023.02.01 21:43close120.011938.200.001955.770.511121.21
282023.02.01 21:52t/p150.011941.440.001941.4418.941140.15
292023.02.01 21:52t/p130.011941.850.001941.859.441149.59
302023.02.02 06:45close140.011953.230.001962.4421.491171.08
312023.02.07 04:45buy160.011874.080.001882.44
322023.02.07 19:48t/p160.011882.440.001882.448.361179.44
332023.02.08 02:07buy170.011874.940.001882.96
342023.02.08 09:56t/p170.011882.960.001882.968.021187.46
352023.02.09 05:00buy180.011879.500.001891.10
362023.02.10 16:30buy190.011867.550.001879.53
372023.02.10 16:46buy200.011865.500.001873.38
382023.02.10 17:18buy210.011866.930.001883.07
392023.02.16 10:00close180.011841.080.001891.10-38.421149.04
402023.02.17 21:30close190.011842.050.001879.53-25.501123.54
412023.02.17 21:45close200.011841.760.001873.38-23.741099.80
422023.02.17 22:15close210.011842.420.001883.07-24.511075.29
432023.02.22 04:18buy220.011836.810.001840.77
442023.02.22 10:05t/p220.011840.770.001840.773.961079.25
452023.02.24 04:30buy230.011826.890.001832.79
462023.02.24 05:15buy240.011827.540.001834.30
472023.02.24 08:15buy250.011825.790.001829.71
482023.02.24 08:30buy260.011825.830.001829.83
492023.02.28 19:25t/p250.011829.710.001829.713.921083.17
502023.02.28 19:25t/p260.011829.830.001829.834.001087.17
512023.03.01 08:15t/p230.011832.790.001832.795.901093.07
522023.03.01 08:32t/p240.011834.300.001834.306.761099.83
532023.03.02 17:33buy270.011839.300.001854.26
542023.03.02 17:45buy280.011836.180.001842.78
552023.03.02 20:52buy290.011835.880.001843.44
562023.03.03 08:42t/p280.011842.780.001842.786.601106.43
572023.03.03 08:48t/p290.011843.440.001843.447.561113.99
582023.03.03 22:04t/p270.011854.260.001854.2614.961128.95
592023.03.08 17:00buy300.011820.920.001838.76
602023.03.09 10:45buy310.011819.070.001832.05
612023.03.09 17:02t/p310.011832.050.001832.0512.981141.93
622023.03.10 15:31t/p300.011838.760.001838.7617.841159.77
632023.03.14 20:30buy320.011909.590.001918.35
642023.03.14 20:45buy330.011908.470.001914.99
652023.03.15 13:30buy340.011912.290.001944.79
662023.03.15 13:32t/p330.011914.990.001914.996.521166.29
672023.03.15 13:33t/p320.011918.350.001918.358.761175.05
682023.03.17 14:33t/p340.011944.790.001944.7932.501207.55
692023.03.21 04:55buy350.011984.480.001995.38
702023.03.22 16:45buy360.011945.310.001959.07
712023.03.22 20:02t/p360.011959.070.001959.0713.761221.31
722023.03.23 19:34t/p350.011995.380.001995.3810.901232.21
732023.03.28 08:45buy370.011960.000.001967.16
742023.03.28 15:38t/p370.011967.160.001967.167.161239.37
752023.03.30 09:30buy380.011967.110.001981.19
762023.03.30 19:33t/p380.011981.190.001981.1914.081253.45
772023.04.03 14:00buy390.011972.870.001992.83
782023.04.04 15:15buy400.011984.560.001997.18
792023.04.04 16:46t/p390.011992.830.001992.8319.961273.41
802023.04.04 17:00t/p400.011997.180.001997.1812.621286.03
812023.04.06 14:15buy410.012020.250.002025.97
822023.04.11 05:30buy420.011996.090.002011.05
832023.04.12 04:37t/p420.012011.050.002011.0514.961300.99
842023.04.12 15:35t/p410.012025.970.002025.975.721306.71
852023.04.17 15:00buy430.012009.490.002019.07
862023.04.18 10:29buy440.012002.540.002011.86
872023.04.19 22:00buy450.011996.680.002003.18
882023.04.20 13:29t/p450.012003.180.002003.186.501313.21
892023.04.20 17:08t/p440.012011.860.002011.869.321322.53
902023.04.24 12:15buy460.011985.670.001995.83
912023.04.24 20:00close430.011986.450.002019.07-23.041299.49
922023.04.25 02:42t/p460.011995.830.001995.8310.161309.65
932023.04.25 20:30buy470.011994.280.002006.76
942023.04.26 16:26t/p470.012006.760.002006.7612.481322.13
952023.04.27 06:00buy480.011999.130.002015.61
962023.04.28 17:45buy490.011988.940.002003.12
972023.05.01 14:15buy500.011987.350.001996.19
982023.05.01 15:24t/p500.011996.190.001996.198.841330.97
992023.05.01 15:36t/p490.012003.120.002003.1214.181345.15
1002023.05.02 13:45buy510.011988.110.002003.63
1012023.05.02 17:15close480.011999.650.002015.610.521345.67
1022023.05.02 17:28t/p510.012003.630.002003.6315.521361.19
1032023.05.08 11:45buy520.012022.380.002027.64
1042023.05.08 18:29t/p520.012027.640.002027.645.261366.45
1052023.05.10 15:45buy530.012046.500.002090.02
1062023.05.11 03:15buy540.012032.950.002038.13
1072023.05.11 14:32buy550.012038.380.002062.76
1082023.05.11 14:33t/p540.012038.130.002038.135.181371.63
1092023.05.12 16:47buy560.012020.820.002054.00
1102023.05.12 20:02buy570.012014.980.002028.60
1112023.05.17 20:45close530.011981.850.002090.02-64.651306.98
1122023.05.18 19:30close550.011955.220.002062.76-83.161223.82
1132023.05.19 21:45close560.011979.300.002054.00-41.521182.30
1142023.05.22 02:00close570.011979.980.002028.60-35.001147.30
1152023.05.23 17:30buy580.011969.700.001991.80
1162023.05.23 17:45buy590.011967.930.001978.41
1172023.05.24 07:30t/p590.011978.410.001978.4110.481157.78
1182023.05.26 09:45buy600.011951.870.001962.05
1192023.05.29 15:00buy610.011946.780.001952.32
1202023.05.29 15:15buy620.011945.930.001949.77
1212023.05.30 12:55t/p620.011949.770.001949.773.841161.62
1222023.05.30 12:59t/p610.011952.320.001952.325.541167.16
1232023.05.30 15:20t/p600.011962.050.001962.0510.181177.34
1242023.05.31 02:00close580.011958.460.001991.80-11.241166.10
1252023.06.01 14:30buy630.011967.510.001983.01
1262023.06.02 06:21t/p630.011983.010.001983.0115.501181.60
1272023.06.05 17:30buy640.011959.060.001992.22
1282023.06.07 17:00buy650.011970.110.001996.37
1292023.06.07 17:15buy660.011964.900.001980.74
1302023.06.08 15:38buy670.011957.110.001981.87
1312023.06.09 05:30close640.011963.620.001992.224.561186.16
1322023.06.12 11:30buy680.011964.510.001976.49
1332023.06.13 13:55close660.011965.420.001980.740.521186.68
1342023.06.13 15:30close650.011970.760.001996.370.651187.33
1352023.06.14 12:31buy690.011952.480.001961.02
1362023.06.14 15:36buy700.011952.840.001967.32
1372023.06.14 15:44close670.011957.620.001981.870.511187.84
1382023.06.15 17:15buy710.011956.020.002008.72
1392023.06.16 04:46t/p690.011961.020.001961.028.541196.38
1402023.06.16 13:53close680.011965.040.001976.490.531196.91
1412023.06.16 15:15t/p700.011967.320.001967.3214.481211.39
1422023.06.20 10:45buy720.011955.420.001968.94
1432023.06.21 21:45buy730.011937.390.001945.49
1442023.06.21 22:00buy740.011936.290.001941.61
1452023.06.23 01:45close710.011913.380.002008.72-42.641168.75
1462023.06.27 05:45buy750.011928.250.001937.95
1472023.06.27 15:45close720.011927.430.001968.94-27.991140.76
1482023.06.28 23:54close at stop750.011906.650.001937.95-21.601119.16
1492023.06.28 23:54close at stop740.011906.650.001941.61-29.641089.52
1502023.06.28 23:54close at stop730.011906.650.001945.49-30.741058.78
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..1f3c0ce15cc22fa0bdfa7620309916ecf514fbc9 GIT binary patch literal 7328 zcmch*g;NyH|37||9*rozkP`yYNgyE8k_N9=QVXJ>X-O+!^$#_~Bu4`2-dAdyG_0AOHXfK=TNf*(|a z!PVEHYA^^+09-c`i2w&(hpNHX%T3`*P52)X z0038CORvQs02mAa{Lhkf4OfH9KuvJcDj0O_55I;$plcGi2>|E^ftpCy0HBQUKT~iS z0K7`NR=}^pvTN`dx+eYK$ko>@0_i$o@HGY~1A_pd>v{kGUxcq$AMk&B0k}zm00IJo zfX!Xu!Ou&8KwOl(|yLSj;KN-82PJtH$KJ0~|Uzn~C_LSu@GOG?YiD=MpgRoB$k z)i*RYHMd|}+uA!iySjUN`}zk4aYMsJWMktKlT*_(c*5-5{KDeW^6!<^wRPgg=GOMk z?w`H=gTIIWj*j=r$TG<&Kg(H{ZT4+W45=lQ1{(EQL10htKRBqs_{Ka zsCxbun}*5aWm5vYBcsSE$pJwYhy5vOD8IoZKaP;!2<+1Y8HZzxG`^C^kT66w26cmM z_^Rj}SrmBFi`sVXb!{0h3MHo!#;x2IR2GCZ%Xvdq5l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2M z_aw;d4$^p$Q_k#AA{8m??R-|fgUHScfrm(4(jDT{MM;j2HChhCHm!TYKlvKoZ?fr<)VQ55>PJ0b oLGwMiL%85+bojt$!S5*p4h7FLsRwN|zo(8<6&09}lL2J^AB9390{{R3 literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.htm b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.htm new file mode 100644 index 0000000..3057841 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 1.htm @@ -0,0 +1,77 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.02.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test4192Ticks modelled3544155Modelling quality24.42%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit54.27Gross profit54.27Gross loss-0.00
Profit factorExpected payoff10.85
Absolute drawdown29.71Maximal drawdown53.15 (5.19%)Relative drawdown5.19% (53.15)
Total trades5Short positions (won %)0 (0.00%)Long positions (won %)5 (100.00%)
Profit trades (% of total)5 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade20.17loss trade-0.00
Averageprofit trade10.85loss trade-0.00
Maximumconsecutive wins (profit in money)5 (54.27)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)54.27 (5)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins5consecutive losses0
+Graph
+ + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001828.18
22020.12.02 12:22t/p10.011828.180.001828.1813.621013.62
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001864.07
52020.12.07 16:49t/p20.011850.470.001850.477.371020.99
62020.12.07 17:46t/p30.011864.070.001864.0720.171041.17
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321044.49
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781054.27
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 2.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..e902f9a3b8a168ca11ffce4c62ada5658ff11809 GIT binary patch literal 7581 zcmch5^6^^EH}_c=e^FEpPkD8740GyvEH0PuJ`000;n8Np+QL5LHKogL;j zg|P!6aDdx|$Kw#7+Z4v`mU$Zj@Hi|8PzAW1AngC+;ZG2t{}O;<%q8%(9umk+(b^EwAzGYzSsz9v>{KoAI0*A1(1KcLpQRZJT%m2y|QER))dY;clC=Ltt*JB0w12ZGb`GZe4GkTW^(^VE||t z141BfNw-`4Ur)EB|5e7^vT*p@p6zZiK$YF?zW@IZvD>c?_}^Io$nX$ANN8AiL?jdz z1&@x2jYGsIBqk-Nq^6~3WFoV&b8_=g`2}AKi;B@DrD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
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.02.26 23:45 (2020.01.01 - 2021.03.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test6016Ticks modelled6166924Modelling quality24.60%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (50)
Total net profit35.23Gross profit66.77Gross loss-31.54
Profit factor2.12Expected payoff5.03
Absolute drawdown29.69Maximal drawdown53.15 (5.19%)Relative drawdown5.19% (53.15)
Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (85.71%)
Profit trades (% of total)6 (85.71%)Loss trades (% of total)1 (14.29%)
Largestprofit trade20.17loss trade-31.54
Averageprofit trade11.13loss trade-31.54
Maximumconsecutive wins (profit in money)6 (66.77)consecutive losses (loss in money)1 (-31.54)
Maximalconsecutive profit (count of wins)66.77 (6)consecutive loss (count of losses)-31.54 (1)
Averageconsecutive wins6consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001828.17
22020.12.02 12:22t/p10.011828.170.001828.1713.621013.62
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001864.06
52020.12.07 16:49t/p20.011850.460.001850.467.371020.99
62020.12.07 17:46t/p30.011864.060.001864.0620.171041.17
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321044.49
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781054.27
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501066.77
132021.02.10 15:15buy70.011844.620.001857.72
142021.02.12 10:19close70.011814.620.001857.72-31.541035.23
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 3.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..7728f57acb6914c563a73e2fdc295e1b54eff50d GIT binary patch literal 7362 zcmch5^WHu0Rl;_#Y7f zutr@;uf!mLHQ+z5tKXIJ6$52m1!{wm)~+T{BGlR%a85BBf&ZsLEk#v>W`U(S7U8S(T3URgi|DTV<)$RlScNPE|QZOJi zEIcAI3Ji&kiH(a-fF>p-e@jVCgQaI=!m|+BIk|cH-wO(hic3n7W#tu>Rn;}Mb@ix* z#-`?$*0%PJ&aUpB-oE|;^xzO?cw`hiRz@~4IW>*L6K06BbMp&}OUo;(YwH`ETiZLk zd;32RejWb)^Y`D;K^0jx`S~T{0&ux=1G=dCl8S|I_8WBRiS9K4mEjwS%TIOKWG{(F z(fMj2{EwsGa3rm2M%~p%e1j#eX~jrdwoh^-7Y-Oc%HNtDtSx%=np2vp{z09AzSeW$ zyD4=K3_9V+96>Hsz-uy!yox+f@ZwkqB^~A0I61=~cfLC0J6T^aRYW)*W6IUi>~!kE|wwp5va4-gis&+e1(V_ndXL z3G$YY`b@3|WDeUVMG8M8d;k6YK9f9K8t4w%pPloU?6dAA3%4XjMcytl1J>c~EU3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$qx&RCx_r-E62I{c<0u4gN-?hgo)UJ;#ZtKfwc$J%t zdve9({^NIi=O-;&9t|{?2v2`vk1p2~4nP)61w8zTlLiLOf7P%Eq2>cygi?HY1P-F{ zUbOH6=q-km&3}oqjO21cTSoB(0zZNU<264*gb?75(P9|9*6Mv7gL`Xt-ac_%yKQo>W=+ss?C`F* z{v~Unz~`H;LIRPrnycY#Vn7?X>*x!ctlxT_-N4Yr65&kGOIq8UP)5@tD2V}JQJi_x zex;KFKW7k%=-{a`_xRz$+@03~5w(l{Gp|#Rdn_M*6GrX61uW`Nb73d_qxz`d$sL(F>`g7NRS#(36(>60o`jP42JDTDM-uYl-!4-8xBdifT}zlO0O$7|Zp zL&;_P+v;Y8FibN1{OBxIr9-L13bTV&`Lo;ntujZQU!@pjE-(|M=l(LaqH?d)EvFU@ z8#*ymJ4JuSlT_yZVD*^D%SAsu_DA8tmo1nXm5Eu;X$f^+OXTf47kiby73B^5!9`*Z zr+h!~Hs<->>a52##Y2zgf*P`1iFONN&iK2p+wEuq*!O~$+JGg5v2l$vcD3CYMaL74E^4O%HI%~yA6Q&YOwuly^ zISpO3kq5@-zi-`9u~mBpv<=Q@9;5m7_1=J8Xyk{O{=bDw*&lijSky2^2oZEw%^uWS zsEnsi(;6jg!2F*14nHtaKKFLsn5lx90P!2FO{kwfI_-Foslgb`Z#ojLF7fmzy0M?| z>xJ#PAI z%b->g^NsWetGn_i=+7ym9~0gPh>8+4-%`?(`JI0fHcTIUTQ;6tQ}=xlXrit?Zjh4t z;4^ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.02.26 23:45 (2020.01.01 - 2021.03.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test6016Ticks modelled6166924Modelling quality24.60%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit56.23Gross profit56.23Gross loss-0.00
Profit factorExpected payoff8.03
Absolute drawdown36.52Maximal drawdown53.15 (5.23%)Relative drawdown5.23% (53.15)
Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (100.00%)
Profit trades (% of total)7 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade12.50loss trade-0.00
Averageprofit trade8.03loss trade-0.00
Maximumconsecutive wins (profit in money)7 (56.23)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)56.23 (7)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins7consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001821.37
22020.12.02 10:36t/p10.011821.370.001821.376.811006.81
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001853.79
52020.12.07 16:49t/p20.011850.470.001850.477.371014.18
62020.12.07 16:52t/p30.011853.790.001853.799.891024.08
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321027.40
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781037.18
112021.02.09 03:15buy60.011835.690.001848.19
122021.02.09 11:54t/p60.011848.190.001848.1912.501049.68
132021.02.10 15:15buy70.011844.630.001851.18
142021.02.10 15:37t/p70.011851.180.001851.186.551056.23
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..190c6f7ae1de3bcf2478e2eaaddf11aa372ec0fd GIT binary patch literal 7446 zcmch5_d6Tj`**03*rhF^MpbRvDy6Y?*tELr)z)5BwW*qk8N?>`2tlj}v0HoZ5!BwR zs7=1!pXYyg&UMap-PipZ=f2PR=^SO%S5nW+#BX!}RsaAZkq7_)dU|?@*lq}XA8TQO zy-r~*AaDZUdJ%~PIOIBowYX+phX5jB0s_DQt|w&T|M7_XaLE4>fNtzH2$>-Kj|c!* zV6UauVhF&(0s#1*CGi@@T3{gcaN@EBp4B>yK78roV zGVxjgzXmba;B|pSI0SNSeXRiiAXuyg;kq&lIQDu=I0Q?$4zO?n;lGr{wR!!u9@`Co zbYmfK_;r8(6?9GdZ)YrlaNXT?!Pm@da|;Lna^3g;{~>&R`hfrL0zgUh1Na971_g&e zVWDB+5s^{w=$KeUTzo=eQgTXa8Ztd2Gb=kMH!r^cRak^BE-A&7l~+_&VXJX9wfMUF zhQ_AmmS4YH+uA!iySjUN`}zmaB*P=4W8)K(Q-tZ6**|mh3yVw3E30ek8=G6(JG*;- z_YV&L9UbpsNYY6!u8^02tIb>RIR!29n;g>!_`H%P?LE1kThR+IG;Tk>A{>WiEB@q? z4}HfHv!oL8;0+Ry7_+PvCSukw!V;U;{y{Q(eY&$EU;8cVL-H!|N}V@q%6t#vD#dl0 zQj0RU!3u!4Bsa23vLJqQ13$^A$i7BA{V+&M5zwUuF@P26t2z=%3L;XlMJNiAfh+WR z0Xl%v6J$N3j>B-HP%=tTF2$BWOkja=)@zdTAZ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zPn0(AeZ5)s>Gr>1 z6`A{t=CIJ$rrQeqkM2EX@V#64f+X$zueRHd9gKy|Z*@;(vL89!6xv#NfXR8uc~%h7 zyf<~AbdN{t^#GH{;fEQ~pORWjYN6B!!g`x~yW(NAPoVDSOV@ud27Mw!HKu2{TKOMI zo5#5Dg>x|{9knZ0evL}8`^+yQ^-7J`Jm6=}3$}+K70%W-jIvpu9?=}Bs@U-ZIx1eY zz2L3h@em4s)1ArnFi>8D#nzj7VOi7*)omfh^=aD6+yarOs)1HLNT>;4kw}Zv$WT29 zSH-W02`Orl%?%~!D>XftWPL#9#DpA`iGL&z-RF^2k+$@kPd++H@nz0I>ebSK^l@jV z3zcmqjeWs$PO3qunoHKL;)0hCLkGicT(a+O7bwe94Z%ZQa(F~gs@kDLh(ed#I3O87 G`u_l|G&k@7 literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.htm b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.htm new file mode 100644 index 0000000..3f65e6f --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 4.htm @@ -0,0 +1,87 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +

+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.31 23:45 (2020.01.01 - 2021.04.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test8132Ticks modelled9612073Modelling quality24.70%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (50)
Total net profit80.25Gross profit80.25Gross loss-0.00
Profit factorExpected payoff8.03
Absolute drawdown36.50Maximal drawdown53.15 (5.23%)Relative drawdown5.23% (53.15)
Total trades10Short positions (won %)0 (0.00%)Long positions (won %)10 (100.00%)
Profit trades (% of total)10 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade12.50loss trade-0.00
Averageprofit trade8.03loss trade-0.00
Maximumconsecutive wins (profit in money)10 (80.25)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)80.25 (10)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins10consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001821.36
22020.12.02 10:36t/p10.011821.360.001821.366.811006.81
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001853.78
52020.12.07 16:49t/p20.011850.460.001850.467.371014.18
62020.12.07 16:52t/p30.011853.780.001853.789.891024.08
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321027.40
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781037.18
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501049.68
132021.02.10 15:15buy70.011844.620.001851.17
142021.02.10 15:37t/p70.011851.170.001851.176.551056.23
152021.03.10 03:15buy80.011718.560.001729.52
162021.03.10 15:15buy90.011714.680.001724.00
172021.03.10 20:33t/p90.011724.000.001724.009.321065.55
182021.03.11 04:07t/p80.011729.520.001729.529.801075.35
192021.03.16 12:30buy100.011733.030.001737.93
202021.03.16 16:22t/p100.011737.930.001737.934.901080.25
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..a43105aaa04f6795435402094a5887d7d46b5165 GIT binary patch literal 7769 zcmch5^;=Zm_x%hY4h@1dNJvVE3c@I*poCz6NJxpm0Fp{d=P=Yz(%s!d4P65aox?D6 zw}dqF;r0Ih58w0L^W1aSUTf{W&v~Bn!+op#MpDZ786gU=1_0pkcmM!^Mx*hFelYwH zVP=N7g%D<7I2Ld_@pvp8d!mJ$J1jn!5e!#JCGc&*~Xa)v=5oS#QKtCAVgujge z%CY~mHY*31t>SM*@Y`VdZSb~CJRA(ZO>iqiAk470#hJkow^`v}1on1;fMc=$L1wq+ zO}Ao1KLFg10K?(8E&f;2E$P3^2rTxt!P}Z|nYYenw|)QrA40dg5BTpa0C(};0AD}< zfWRPVFf1fAEIa}p85JE9`zJ0wAu%aAB{eNQBQq;ICpRy@ps=X8q_nKOqOz*G22opA z-_VF`YHn$5Ywzgn>h3}H_VuF&28V`=fn(znlT*`}8SE@>Zhm2LX?bOJZGB^NYkOyR zZ~x%$;nDHQzte+qU>d>IP3kq^W}6PaAg6wZhJ7{$zW7Rwf>Q=f7rCVH?!MR!_7s*S z@53Pr(`1ZVQ3~Sum>LrwwW<;#Y}`D~7@gar^*n2Hwzn$py#|x$otkIWpFXO*<>QI1 ze)g#~xhS2BSq`89B+M+$1bZ(G`w)>5*@sDJjSvv~^{IgMf{S#OZSlbTup~rL0Wom+ zruZ_y*zc|zi3LuzuAHl&;N>eQhkUz#xqrSv<_BP902$*G^AFj^uetl+QoqvIEua`2zUNF$)1UxE%f{a-kZg_3wN1y0{xA#L4n+PUqRK=7Dj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%daWt>TE71R}y)ZQFo7QBfjpQ-izz@sK4CVoZAd4C)OsB z8QOC|RuW}3A=}tEqVGcZ_)02uZbwg{9KILwl3&(nSZnb_cb1yp!UWvD`ArJV5-Cdc zo9B*3v3_U+rWCYND$#~{BY6ddGy1xMtL`O_ukm6x2OP~ZlSz$oWyIQs)U}3^0njzM zOXUG)UEj35YF_zhrw=v`z8U9N{_=M$KRQx!rB6ak#nyXCerJAUO7!;q=5SO=bxv%$p!(B_njD*NR%$uj^wyT7*^vZ{uO|F;t4=?wk4Mtg5c0jT z*40WUT`F-KQ2ZJMYfKv)XZV~##J5d45R@ujahGnpnWwMsORmf@!$i!E)b+)x)cF?ApYT2$A+$?UTiye(NMlg%XYWuK{-YGx}=|Q!LZb!Y;j! z=8g=?8kY4%ZE}i0OW#hB+`so+*f6-cP3M-Y-7+sc*#dyfrIkpe+=nW3f#{J-8@Wxn V-vjbRkg7{NU8$W80TA%w{{SK^;F16U literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.htm b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.htm new file mode 100644 index 0000000..9ed9171 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 5.htm @@ -0,0 +1,99 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.30 23:45 (2020.01.01 - 2021.05.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test10063Ticks modelled11947707Modelling quality24.76%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit76.08Gross profit106.85Gross loss-30.77
Profit factor3.47Expected payoff4.76
Absolute drawdown36.52Maximal drawdown59.05 (5.44%)Relative drawdown5.44% (59.05)
Total trades16Short positions (won %)0 (0.00%)Long positions (won %)16 (93.75%)
Profit trades (% of total)15 (93.75%)Loss trades (% of total)1 (6.25%)
Largestprofit trade12.50loss trade-30.77
Averageprofit trade7.12loss trade-30.77
Maximumconsecutive wins (profit in money)12 (85.99)consecutive losses (loss in money)1 (-30.77)
Maximalconsecutive profit (count of wins)85.99 (12)consecutive loss (count of losses)-30.77 (1)
Averageconsecutive wins8consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001821.37
22020.12.02 10:36t/p10.011821.370.001821.376.811006.81
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001853.79
52020.12.07 16:49t/p20.011850.470.001850.477.371014.18
62020.12.07 16:52t/p30.011853.790.001853.799.891024.08
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321027.40
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781037.18
112021.02.09 03:15buy60.011835.690.001848.19
122021.02.09 11:54t/p60.011848.190.001848.1912.501049.68
132021.02.10 15:15buy70.011844.630.001851.18
142021.02.10 15:37t/p70.011851.180.001851.186.551056.23
152021.03.10 03:15buy80.011718.570.001729.53
162021.03.10 15:15buy90.011714.690.001724.01
172021.03.10 20:33t/p90.011724.010.001724.019.321065.55
182021.03.11 04:07t/p80.011729.530.001729.539.801075.35
192021.03.16 12:30buy100.011733.040.001737.94
202021.03.16 16:22t/p100.011737.940.001737.944.901080.25
212021.04.06 13:30buy110.011732.050.001734.85
222021.04.06 14:24t/p110.011734.850.001734.852.801083.05
232021.04.08 03:00buy120.011737.150.001740.09
242021.04.08 08:01t/p120.011740.090.001740.092.941085.99
252021.04.09 04:30buy130.011756.920.001760.31
262021.04.13 08:37close130.011726.920.001760.31-30.771055.22
272021.04.14 09:15buy140.011746.430.001751.74
282021.04.14 15:39buy150.011746.670.001755.93
292021.04.15 15:19t/p140.011751.740.001751.744.151059.38
302021.04.15 16:54t/p150.011755.930.001755.938.101067.48
312021.04.21 14:15buy160.011782.360.001790.96
322021.04.21 16:49t/p160.011790.960.001790.968.601076.08
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 6.gif b/Bkp/Used/14020502/Docs/Reports/14020427/StrategyTester 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..c3ebb99217bbbb89e48583f0a5bc73eed579e47d GIT binary patch literal 8177 zcmchb^;;Co_xBeRSQ@p-meog^V`VE%Lt2n=YP}-*Z=@97z_Xa7#JA9Ap5~lCrC3hUVB=7B((m4ln3FzaUE2S?O{3I;!LX3YRVKN#GMc@O~Q=>O$4D+idZ zV;&-+9>nqo@u5dd)B_F%0{~zo(hU93nOPL_p=1;oiGDDUQRs)14{4hpB9Z+7a6b|p z74-l;obSJe9-#lqA|EI;=AmJ;2Mthe1_pp1&i(&?aQ=5Q|GfnO5915)4+snj4uOP* zg-1YPkx|hxvA^Tu6X1x%q~w&;wDgS3tn8fJy!?W~qT-U$vhs?`s_GhKZC!msV^ecW zYg>EApU$rCp58uG|G?nT@JKP%_{8MY^vvuWdV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s&W#uii{nfkKhvEk*PkS?knK1=AGBYmbJf zk+=drlYh1pk18hUEiL^j_zfj=w7Zk0T=ZsdEkQ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.09.30 23:45 (2020.01.01 - 2021.10.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test20043Ticks modelled22474457Modelling quality24.88%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (60)
Total net profit87.01Gross profit151.26Gross loss-64.25
Profit factor2.35Expected payoff2.90
Absolute drawdown36.70Maximal drawdown85.54 (7.74%)Relative drawdown7.74% (85.54)
Total trades30Short positions (won %)0 (0.00%)Long positions (won %)30 (83.33%)
Profit trades (% of total)25 (83.33%)Loss trades (% of total)5 (16.67%)
Largestprofit trade12.50loss trade-30.77
Averageprofit trade6.05loss trade-12.85
Maximumconsecutive wins (profit in money)12 (85.99)consecutive losses (loss in money)3 (-32.06)
Maximalconsecutive profit (count of wins)85.99 (12)consecutive loss (count of losses)-32.06 (3)
Averageconsecutive wins6consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.371014.18
62020.12.07 16:52t/p30.011853.880.001853.889.891024.08
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.40
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.18
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.68
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.23
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.55
182021.03.11 04:07t/p80.011729.620.001729.629.801075.35
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.25
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801083.05
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.99
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.771055.22
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.151059.38
302021.04.15 16:54t/p150.011756.020.001756.028.101067.48
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601076.08
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 16:04t/p170.011843.260.001843.264.731080.81
362021.05.14 15:16close180.011837.920.001846.05-1.421079.40
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041084.44
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.931091.37
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621093.99
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:39t/p220.011816.230.001816.236.471100.47
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.771069.70
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.04 16:09close240.011830.460.001835.53-0.651069.05
502021.08.04 16:22close250.011830.700.001836.63-0.651068.41
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.591074.00
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041078.04
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741080.78
582021.09.15 15:24t/p280.011806.410.001806.412.381083.16
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851087.01
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.gif b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..db66459323dc6462eadb6731501eb85a470a67a6 GIT binary patch literal 8822 zcmch5^;Z+#|Nm%4Hxnc*QczH8fPf+$qEe!$bSp@AGX{)FcgKJMqsB-9$ISR=0C+qe008v$_2JRIVE7^0!UBC8 zLR*00(}3H7$4|q-w;{B}E%SB?z)w$t0Vu$22T%S#9{vyx{x1ONMc;zp$?5-y0DuMh zR(dN211u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SNlCIgIl6U`_UmD!?Sl^r&A;<~$!MXX7LMR#z{a0ChZ70Na*L+M8 z175fV7BJrT2r*^?~DszDRMO zt200Hp&-35`$i?tMYJQ&yWql>j}xx`=|jQMRnAfdU}cQ?dr3jTFG2AD`vOxJ2cn=B zR|i=)ifG1Azk(3{XVXCvNs`)C0mc*J`vsw3D{@PHuz6U3nEUtVc`>+=8ZT>@F0By!IMJe&`^hQNYgp6j6A$b9~j98 zjw=9Q5fRbdw?CYbR9TS&lfW?qWYj%k#2`GrJ1Pki1?GYMRe`No!PX$K4Fqhf8@96! b+ar%Y;EO&|i9WH4K7&MGtiu8T0O|h&uRZx$ literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.htm b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.htm new file mode 100644 index 0000000..5e808a8 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 1.htm @@ -0,0 +1,321 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (50)
Total net profit278.17Gross profit741.15Gross loss-462.98
Profit factor1.60Expected payoff2.19
Absolute drawdown36.51Maximal drawdown158.60 (12.94%)Relative drawdown12.94% (158.60)
Total trades127Short positions (won %)0 (0.00%)Long positions (won %)127 (83.46%)
Profit trades (% of total)106 (83.46%)Loss trades (% of total)21 (16.54%)
Largestprofit trade42.29loss trade-31.57
Averageprofit trade6.99loss trade-22.05
Maximumconsecutive wins (profit in money)19 (161.16)consecutive losses (loss in money)4 (-122.74)
Maximalconsecutive profit (count of wins)161.16 (19)consecutive loss (count of losses)-122.74 (4)
Averageconsecutive wins8consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001821.36
22020.12.02 10:36t/p10.011821.360.001821.366.811006.81
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001853.78
52020.12.07 16:49t/p20.011850.460.001850.467.371014.18
62020.12.07 16:52t/p30.011853.780.001853.789.891024.07
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321027.39
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781037.17
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501049.67
132021.02.10 15:15buy70.011844.620.001851.17
142021.02.10 15:37t/p70.011851.170.001851.176.551056.22
152021.03.10 03:15buy80.011718.560.001729.52
162021.03.10 15:15buy90.011714.680.001724.00
172021.03.10 20:33t/p90.011724.000.001724.009.321065.54
182021.03.11 04:07t/p80.011729.520.001729.529.791075.33
192021.03.16 12:30buy100.011733.030.001737.93
202021.03.16 16:22t/p100.011737.930.001737.934.901080.23
212021.04.06 13:30buy110.011732.040.001734.84
222021.04.06 14:24t/p110.011734.840.001734.842.801083.03
232021.04.08 03:00buy120.011737.140.001740.08
242021.04.08 08:01t/p120.011740.080.001740.082.941085.97
252021.04.09 04:30buy130.011756.910.001760.30
262021.04.13 08:37close130.011726.910.001760.30-30.781055.19
272021.04.14 09:15buy140.011746.420.001751.73
282021.04.14 15:39buy150.011746.660.001755.92
292021.04.15 15:19t/p140.011751.730.001751.734.141059.33
302021.04.15 16:54t/p150.011755.920.001755.928.091067.42
312021.04.21 14:15buy160.011782.350.001790.95
322021.04.21 16:49t/p160.011790.950.001790.958.601076.02
332021.05.10 23:15buy170.011837.660.001843.16
342021.05.11 11:45buy180.011837.310.001845.95
352021.05.12 16:04t/p170.011843.160.001843.164.721080.74
362021.05.14 15:15close180.011837.820.001845.95-1.441079.30
372021.05.19 06:45buy190.011869.140.001874.18
382021.05.19 16:00t/p190.011874.180.001874.185.041084.34
392021.07.02 20:45buy200.011785.490.001792.81
402021.07.05 10:54t/p200.011792.810.001792.816.931091.27
412021.07.06 01:06buy210.011791.670.001794.29
422021.07.06 04:45t/p210.011794.290.001794.292.621093.89
432021.07.12 03:30buy220.011809.270.001816.13
442021.07.13 15:39t/p220.011816.130.001816.136.471100.36
452021.07.15 08:45buy230.011828.670.001834.47
462021.07.19 15:06close230.011798.670.001834.47-30.781069.58
472021.07.30 04:30buy240.011829.850.001835.43
482021.07.30 10:15buy250.011830.090.001836.53
492021.08.04 16:09close240.011830.360.001835.43-0.661068.92
502021.08.04 16:09close250.011830.600.001836.53-0.661068.26
512021.08.12 07:30buy260.011752.510.001758.49
522021.08.13 09:24t/p260.011758.490.001758.495.591073.85
532021.08.17 08:15buy270.011787.830.001791.87
542021.08.17 08:52t/p270.011791.870.001791.874.041077.89
552021.09.15 06:45buy280.011803.930.001806.31
562021.09.15 09:15buy290.011803.520.001806.26
572021.09.15 15:24t/p290.011806.260.001806.262.741080.63
582021.09.15 15:24t/p280.011806.310.001806.312.381083.01
592021.09.22 04:45buy300.011776.500.001780.35
602021.09.22 21:07t/p300.011780.350.001780.353.851086.86
612021.10.01 10:00buy310.011756.070.001765.61
622021.10.04 09:00buy320.011761.720.001765.52
632021.10.04 17:39t/p320.011765.520.001765.523.801090.66
642021.10.04 17:39t/p310.011765.610.001765.619.151099.81
652021.10.13 04:00buy330.011761.780.001765.06
662021.10.13 10:39t/p330.011765.060.001765.063.281103.09
672021.10.21 04:00buy340.011784.190.001789.47
682021.10.22 09:31t/p340.011789.470.001789.474.891107.98
692021.10.25 01:15buy350.011793.840.001796.90
702021.10.25 03:54t/p350.011796.900.001796.903.061111.04
712021.11.05 15:15buy360.011795.930.001806.49
722021.11.05 17:22t/p360.011806.490.001806.4910.561121.60
732021.11.08 12:15buy370.011818.030.001823.33
742021.11.08 15:24t/p370.011823.330.001823.335.301126.90
752021.11.18 09:49buy380.011867.450.001875.47
762021.11.22 12:39close380.011837.450.001875.47-30.781096.12
772021.12.07 08:00buy390.011781.310.001785.35
782021.12.07 18:24t/p390.011785.350.001785.354.041100.16
792021.12.14 03:00buy400.011788.160.001793.66
802021.12.14 08:15buy410.011788.420.001793.70
812021.12.15 21:00close410.011758.410.001793.70-30.401069.76
822021.12.15 21:00close400.011758.150.001793.66-30.401039.36
832021.12.23 15:30buy420.011808.430.001813.23
842021.12.27 17:54t/p420.011813.230.001813.234.021043.38
852021.12.28 06:45buy430.011810.840.001813.84
862021.12.28 08:36t/p430.011813.840.001813.843.001046.38
872022.01.11 15:30buy440.011808.430.001814.37
882022.01.11 18:22t/p440.011814.370.001814.375.941052.32
892022.01.12 07:34buy450.011820.520.001824.18
902022.01.12 15:39t/p450.011824.180.001824.183.661055.98
912022.01.13 05:22buy460.011825.520.001827.44
922022.01.13 07:37t/p460.011827.440.001827.441.921057.90
932022.01.26 04:00buy470.011848.220.001850.96
942022.01.26 21:54close470.011818.220.001850.96-30.001027.90
952022.02.01 18:30buy480.011806.970.001815.85
962022.02.04 06:37close480.011807.480.001815.85-1.441026.46
972022.02.09 03:45buy490.011826.740.001829.48
982022.02.09 14:30buy500.011827.470.001828.75
992022.02.09 15:02t/p500.011828.750.001828.751.281027.74
1002022.02.09 15:04t/p490.011829.480.001829.482.741030.48
1012022.02.18 15:00buy510.011894.270.001904.75
1022022.02.21 01:24t/p510.011904.750.001904.7510.091040.57
1032022.03.02 08:45buy520.011937.680.001948.62
1042022.03.04 02:39t/p520.011948.620.001948.629.381049.95
1052022.03.04 11:15buy530.011941.660.001956.40
1062022.03.04 16:37t/p530.011956.400.001956.4014.741064.69
1072022.03.07 17:45buy540.011989.420.002032.10
1082022.03.08 06:45buy550.011989.920.001999.74
1092022.03.08 08:25t/p550.011999.740.001999.749.821074.51
1102022.03.08 16:49t/p540.012032.100.002032.1042.291116.80
1112022.03.24 08:15buy560.011942.900.001947.97
1122022.03.24 13:31t/p560.011947.970.001947.975.071121.87
1132022.03.25 03:00buy570.011963.080.001972.98
1142022.03.28 08:54close570.011933.080.001972.98-30.391091.49
1152022.04.08 03:00buy580.011933.340.001938.28
1162022.04.08 15:09t/p580.011938.280.001938.284.941096.43
1172022.04.11 08:45buy590.011944.970.001949.67
1182022.04.11 11:19t/p590.011949.670.001949.674.701101.13
1192022.04.12 14:15buy600.011956.680.001966.46
1202022.04.12 15:39t/p600.011966.460.001966.469.781110.91
1212022.04.13 04:49buy610.011968.170.001977.53
1222022.04.13 12:39t/p610.011977.530.001977.539.361120.27
1232022.04.14 02:00buy620.011978.670.001982.69
1242022.04.14 05:00buy630.011980.050.001986.23
1252022.04.14 10:45buy640.011977.510.001984.20
1262022.04.18 02:37t/p620.011982.690.001982.693.241123.51
1272022.04.18 02:46t/p640.011984.200.001984.205.911129.42
1282022.04.18 02:49t/p630.011986.230.001986.235.401134.82
1292022.05.05 13:30buy650.011898.250.001907.69
1302022.05.05 15:49t/p650.011907.690.001907.699.441144.26
1312022.05.20 18:15buy660.011844.180.001855.68
1322022.05.23 08:08t/p660.011855.680.001855.6811.111155.37
1332022.05.24 06:30buy670.011854.920.001865.38
1342022.05.24 16:47t/p670.011865.380.001865.3810.461165.83
1352022.05.30 16:30buy680.011860.850.001873.75
1362022.06.01 08:17close680.011830.850.001873.75-30.781135.05
1372022.06.09 02:15buy690.011854.330.001859.11
1382022.06.10 17:56t/p690.011859.110.001859.114.391139.44
1392022.06.17 08:15buy700.011847.380.001852.76
1402022.06.17 15:53t/p700.011852.760.001852.765.381144.82
1412022.07.22 09:00buy710.011716.260.001721.96
1422022.07.22 12:27t/p710.011721.960.001721.965.701150.52
1432022.07.25 01:15buy720.011726.480.001733.02
1442022.07.25 12:25t/p720.011733.020.001733.026.541157.06
1452022.08.01 05:15buy730.011764.130.001769.45
1462022.08.01 09:45buy740.011764.250.001769.84
1472022.08.01 12:38t/p730.011769.450.001769.455.321162.38
1482022.08.01 12:42t/p740.011769.840.001769.845.591167.97
1492022.08.01 21:00buy750.011769.400.001770.06
1502022.08.01 22:13t/p750.011770.060.001770.060.661168.63
1512022.08.02 12:15buy760.011773.830.001780.03
1522022.08.02 15:15t/p760.011780.030.001780.036.201174.83
1532022.08.05 07:45buy770.011792.040.001793.26
1542022.08.09 13:13close770.011792.550.001793.26-0.271174.56
1552022.08.24 17:00buy780.011746.270.001752.35
1562022.08.24 17:53t/p780.011752.350.001752.356.081180.64
1572022.09.05 20:00buy790.011712.390.001716.49
1582022.09.06 03:22t/p790.011716.490.001716.493.711184.35
1592022.09.08 07:15buy800.011716.950.001722.63
1602022.09.08 13:37t/p800.011722.630.001722.635.681190.03
1612022.09.30 16:45buy810.011669.210.001683.07
1622022.10.03 17:22t/p810.011683.070.001683.0713.471203.50
1632022.10.04 06:45buy820.011700.470.001710.19
1642022.10.04 10:18t/p820.011710.190.001710.199.721213.22
1652022.10.24 07:45buy830.011658.440.001667.68
1662022.10.26 03:00buy840.011653.220.001656.72
1672022.10.26 06:27t/p840.011656.720.001656.723.501216.72
1682022.10.26 10:08t/p830.011667.680.001667.688.461225.18
1692022.10.26 18:15buy850.011672.150.001688.25
1702022.10.27 08:45buy860.011669.870.001682.99
1712022.10.27 11:16buy870.011665.590.001671.30
1722022.10.28 15:30close850.011642.140.001688.25-31.571193.61
1732022.10.28 18:16close860.011639.870.001682.99-30.391163.22
1742022.10.31 10:33close870.011635.590.001671.30-30.781132.44
1752022.11.02 20:15buy880.011664.550.001700.75
1762022.11.02 22:53close880.011634.550.001700.75-30.001102.44
1772022.11.07 05:32buy890.011673.440.001678.96
1782022.11.07 11:23t/p890.011678.960.001678.965.521107.96
1792022.11.10 13:00buy900.011708.650.001717.29
1802022.11.10 15:31t/p900.011717.290.001717.298.641116.60
1812022.11.11 06:45buy910.011752.150.001756.21
1822022.11.11 07:27t/p910.011756.210.001756.214.061120.66
1832022.11.14 05:15buy920.011765.290.001773.39
1842022.11.14 09:45buy930.011762.510.001767.31
1852022.11.14 16:40t/p930.011767.310.001767.314.801125.46
1862022.11.14 17:12t/p920.011773.390.001773.398.101133.56
1872022.11.25 13:15buy940.011753.960.001758.35
1882022.11.28 10:41t/p940.011758.350.001758.354.001137.56
1892022.12.08 13:45buy950.011784.860.001789.50
1902022.12.08 15:23t/p950.011789.500.001789.504.641142.20
1912022.12.09 13:00buy960.011794.910.001806.33
1922022.12.13 15:33t/p960.011806.330.001806.3310.641152.84
1932022.12.14 03:01buy970.011811.600.001816.36
1942022.12.15 10:13close970.011781.590.001816.36-31.181121.66
1952022.12.22 02:15buy980.011816.230.001821.17
1962022.12.22 20:22close980.011786.230.001821.17-30.001091.66
1972022.12.30 03:00buy990.011816.600.001821.40
1982022.12.30 09:01t/p990.011821.400.001821.404.801096.46
1992023.01.05 09:30buy1000.011854.480.001861.84
2002023.01.06 17:21t/p1000.011861.840.001861.846.971103.43
2012023.01.09 14:15buy1010.011875.480.001880.19
2022023.01.09 16:48t/p1010.011880.190.001880.194.711108.14
2032023.01.10 21:15buy1020.011876.190.001884.01
2042023.01.11 06:00buy1030.011878.060.001884.46
2052023.01.11 07:38t/p1020.011884.010.001884.017.431115.57
2062023.01.11 10:47t/p1030.011884.460.001884.466.401121.97
2072023.01.13 10:00buy1040.011899.980.001909.62
2082023.01.13 16:50t/p1040.011909.620.001909.629.641131.61
2092023.01.20 17:30buy1050.011930.400.001939.82
2102023.01.24 08:53t/p1050.011939.820.001939.828.641140.25
2112023.02.01 06:15buy1060.011928.390.001935.43
2122023.02.01 21:42t/p1060.011935.430.001935.437.041147.29
2132023.02.20 04:30buy1070.011842.620.001851.18
2142023.02.22 14:31close1070.011843.130.001851.18-0.271147.02
2152023.03.01 04:00buy1080.011829.430.001841.49
2162023.03.01 15:01t/p1080.011841.490.001841.4912.061159.08
2172023.03.13 11:00buy1090.011885.840.001910.24
2182023.03.13 16:46t/p1090.011910.240.001910.2424.401183.48
2192023.03.14 08:15buy1100.011911.270.001920.74
2202023.03.14 14:15buy1110.011907.600.001919.24
2212023.03.14 19:00buy1120.011909.010.001921.99
2222023.03.15 14:01t/p1110.011919.240.001919.2411.251194.73
2232023.03.15 14:02t/p1100.011920.740.001920.749.081203.81
2242023.03.15 14:03t/p1120.011921.990.001921.9912.591216.40
2252023.03.16 01:15buy1130.011921.480.001928.68
2262023.03.16 14:20t/p1130.011928.680.001928.687.201223.60
2272023.03.16 21:15buy1140.011920.000.001929.92
2282023.03.17 06:53t/p1140.011929.920.001929.929.531233.13
2292023.03.20 06:15buy1150.011974.860.001978.82
2302023.03.20 07:46t/p1150.011978.820.001978.823.961237.09
2312023.03.24 05:58buy1160.011993.650.001997.21
2322023.03.24 12:08t/p1160.011997.210.001997.213.561240.65
2332023.03.31 14:00buy1170.011979.710.001984.51
2342023.03.31 15:33t/p1170.011984.510.001984.514.801245.45
2352023.04.12 15:45buy1180.012022.510.002038.50
2362023.04.13 15:45t/p1180.012038.500.002038.5014.821260.27
2372023.04.26 09:45buy1190.011998.820.002007.08
2382023.04.26 16:26t/p1190.012007.080.002007.088.261268.53
2392023.05.03 11:40buy1200.012016.570.002019.99
2402023.05.03 14:00buy1210.012016.860.002019.56
2412023.05.03 16:30buy1220.012018.960.002029.50
2422023.05.03 16:35t/p1210.012019.560.002019.562.701271.23
2432023.05.03 17:52t/p1200.012019.990.002019.993.421274.65
2442023.05.03 21:00t/p1220.012029.500.002029.5010.541285.19
2452023.05.31 08:00buy1230.011960.380.001966.70
2462023.05.31 13:45buy1240.011958.810.001965.97
2472023.05.31 16:42t/p1240.011965.970.001965.977.161292.35
2482023.05.31 16:42t/p1230.011966.700.001966.706.321298.67
2492023.06.01 02:15buy1250.011966.140.001972.32
2502023.06.01 16:34t/p1250.011972.320.001972.326.181304.85
2512023.06.02 05:00buy1260.011977.670.001981.00
2522023.06.02 06:06t/p1260.011981.000.001981.003.331308.18
2532023.06.02 12:45buy1270.011980.960.001991.34
2542023.06.02 21:02close1270.011950.950.001991.34-30.011278.17
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif new file mode 100644 index 0000000000000000000000000000000000000000..47a7b8363beaee4fa936475cd799e566633787fb GIT binary patch literal 8393 zcmch5^;=ZW|Mr5^(jf?lf`D|0BC({1(g-RIf+*e6-LSjV(zSH$!qTvmbk|Z+ONw+O zA|>pX&-?iwo;h=_Yp&NFbI&=y%#4!CTM5a}qW1;>n*aa~hXVirBO@a?^e_na8*OQc zzAK?EL9hkD-HXF5z(98;wB;T1ZV13F%z*$^fV&Qw`+q##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210)n@||VUQOH|Z z8mMVb)3U%Pp}ZN)0Q~8-d@BV)9ny8yvWm4bEy4S|jy7C%&@9``^<{Zl zW%yO4(~Y*_W!2kIynU=*WfDET7va7RZ-!1)S8{n=`W}vNSrz}gEJG^iY8fws78ey` z%Kfx*YpZ)~OdpcmYx5WdzG`>s^h3oy7{>40S_~RC-|eGZpE{_yHFLao1`w<=?t)Y% z(t0-;8e?g+UY^=Q%Lr7Psic+az`BNUoow)H`Jwx>^TQ7EZI4x(#<|4 zaIG9Ns<5uD+`F0blsPf3DDg96}9(icQ=*u6UdflC~E0jgjkdD?~jp^QhL2L zVH%z3602KnSCR!uMNY(=zc!_<@W%kwrEn^KCeTB#59H>53W2>_Wc^KAK`DZ88ykRv z@C;o(gRLgL1LVCF7G*YL{gozaR}D2aS$1)d`r`AvW`P*Gh)V!Pcd!So0L|qli*o-X zus3X198r4gB;e=|6r*$RHLkHiapCC+FICi+`T)3I;)V17Qk>SYsmClXDHk4;ea z)J18fXRf8n&)=dOM*Vi36R&>!%KnoxOMU@ZxGA|zWl(lD)P$N{T{}IZB}CF^&7&PBj0IoiA8UQY$V*K@m%elKu^J9J`J3{G! z17`5g&?K?V1T2aXD|@4BVaI%Z8V9>noSk zzn!~rk*@q`D3N>>?&KJ9h?z$R%xuQ;d|%OsO-7ho9NJ*M<1yzLk8ua==@PXjlDQw3 zTa~6HuDnDD2kMs?TAW6-_iSra+RVoZJwDXT;y+9!{kKXMc+n%=b`lr&Z=FBza>S|a aG>7VDTP^VFM`hbtW!%mFsVFr->i+;qjr(o@ literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm new file mode 100644 index 0000000..fa1f1fb --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm @@ -0,0 +1,273 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=1; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (57)
Total net profit247.67Gross profit616.97Gross loss-369.31
Profit factor1.67Expected payoff2.40
Absolute drawdown14.52Maximal drawdown102.26 (8.60%)Relative drawdown8.60% (102.26)
Total trades103Short positions (won %)0 (0.00%)Long positions (won %)103 (84.47%)
Profit trades (% of total)87 (84.47%)Loss trades (% of total)16 (15.53%)
Largestprofit trade42.29loss trade-31.58
Averageprofit trade7.09loss trade-23.08
Maximumconsecutive wins (profit in money)14 (116.92)consecutive losses (loss in money)2 (-61.58)
Maximalconsecutive profit (count of wins)116.92 (14)consecutive loss (count of losses)-61.58 (2)
Averageconsecutive wins7consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.620.001821.43
22020.12.02 10:36t/p10.011821.430.001821.436.811006.81
32020.12.04 14:15buy20.011842.770.001850.53
42020.12.07 16:49t/p20.011850.530.001850.537.371014.18
52020.12.18 01:00buy30.011884.970.001888.29
62020.12.18 14:09t/p30.011888.290.001888.293.321017.50
72021.01.05 05:45buy40.011942.210.001951.99
82021.01.05 16:16t/p40.011951.990.001951.999.781027.28
92021.02.09 03:15buy50.011835.750.001848.25
102021.02.09 11:54t/p50.011848.250.001848.2512.501039.78
112021.02.10 15:15buy60.011844.690.001851.24
122021.02.10 15:37t/p60.011851.240.001851.246.551046.33
132021.03.10 03:15buy70.011718.630.001729.59
142021.03.11 04:07t/p70.011729.590.001729.599.791056.12
152021.03.16 12:30buy80.011733.100.001738.00
162021.03.16 16:22t/p80.011738.000.001738.004.901061.02
172021.04.06 13:30buy90.011732.110.001734.91
182021.04.06 14:24t/p90.011734.910.001734.912.801063.82
192021.04.08 03:00buy100.011737.210.001740.15
202021.04.08 08:01t/p100.011740.150.001740.152.941066.76
212021.04.09 04:30buy110.011756.980.001760.37
222021.04.13 08:37close110.011726.980.001760.37-30.781035.98
232021.04.14 09:15buy120.011746.490.001751.80
242021.04.15 15:19t/p120.011751.800.001751.804.141040.12
252021.04.21 14:15buy130.011782.420.001791.02
262021.04.21 16:49t/p130.011791.020.001791.028.601048.72
272021.05.10 23:15buy140.011837.730.001843.23
282021.05.12 16:04t/p140.011843.230.001843.234.721053.44
292021.05.19 06:45buy150.011869.210.001874.25
302021.05.19 16:00t/p150.011874.250.001874.255.041058.48
312021.07.02 20:45buy160.011785.560.001792.88
322021.07.05 11:06t/p160.011792.880.001792.886.931065.41
332021.07.06 01:06buy170.011791.740.001794.36
342021.07.06 04:45t/p170.011794.360.001794.362.621068.03
352021.07.12 03:30buy180.011809.340.001816.20
362021.07.13 15:39t/p180.011816.200.001816.206.471074.50
372021.07.15 08:45buy190.011828.740.001834.54
382021.07.19 15:06close190.011798.740.001834.54-30.781043.72
392021.07.30 04:30buy200.011829.920.001835.50
402021.08.04 16:09close200.011830.430.001835.50-0.661043.06
412021.08.12 07:30buy210.011752.580.001758.56
422021.08.13 09:24t/p210.011758.560.001758.565.591048.65
432021.08.17 08:15buy220.011787.900.001791.94
442021.08.17 08:52t/p220.011791.940.001791.944.041052.69
452021.09.15 06:45buy230.011804.000.001806.38
462021.09.15 15:24t/p230.011806.380.001806.382.381055.07
472021.09.22 04:45buy240.011776.570.001780.42
482021.09.22 21:07t/p240.011780.420.001780.423.851058.92
492021.10.01 10:00buy250.011756.140.001765.68
502021.10.04 17:39t/p250.011765.680.001765.689.151068.07
512021.10.13 04:00buy260.011761.850.001765.13
522021.10.13 10:39t/p260.011765.130.001765.133.281071.35
532021.10.21 04:00buy270.011784.260.001789.54
542021.10.22 09:31t/p270.011789.540.001789.544.891076.24
552021.10.25 01:15buy280.011793.910.001796.97
562021.10.25 03:54t/p280.011796.970.001796.973.061079.30
572021.11.05 15:15buy290.011796.000.001806.56
582021.11.05 17:22t/p290.011806.560.001806.5610.561089.86
592021.11.08 12:15buy300.011818.100.001823.40
602021.11.08 15:24t/p300.011823.400.001823.405.301095.16
612021.11.18 09:49buy310.011867.520.001875.54
622021.11.22 12:39close310.011837.520.001875.54-30.781064.38
632021.12.07 08:00buy320.011781.380.001785.42
642021.12.07 18:24t/p320.011785.420.001785.424.041068.42
652021.12.14 03:00buy330.011788.230.001793.73
662021.12.15 21:00close330.011758.230.001793.73-30.391038.03
672021.12.23 15:30buy340.011808.500.001813.30
682021.12.28 07:54t/p340.011813.300.001813.303.631041.66
692022.01.11 15:30buy350.011808.500.001814.44
702022.01.11 18:22t/p350.011814.440.001814.445.941047.60
712022.01.12 07:34buy360.011820.590.001824.25
722022.01.12 15:39t/p360.011824.250.001824.253.661051.26
732022.01.13 05:22buy370.011825.590.001827.51
742022.01.13 07:39t/p370.011827.510.001827.511.921053.18
752022.01.26 04:00buy380.011848.290.001851.03
762022.01.26 21:54close380.011818.290.001851.03-30.001023.18
772022.02.01 18:30buy390.011807.040.001815.92
782022.02.04 06:39close390.011807.550.001815.92-1.441021.74
792022.02.09 03:45buy400.011826.810.001829.55
802022.02.09 15:04t/p400.011829.550.001829.552.741024.48
812022.02.18 15:00buy410.011894.340.001904.82
822022.02.21 01:24t/p410.011904.820.001904.8210.091034.57
832022.03.02 08:45buy420.011937.750.001948.69
842022.03.04 02:39t/p420.011948.690.001948.699.381043.95
852022.03.04 11:15buy430.011941.730.001956.47
862022.03.04 16:37t/p430.011956.470.001956.4714.741058.69
872022.03.07 17:45buy440.011989.490.002032.17
882022.03.08 16:49t/p440.012032.170.002032.1742.291100.98
892022.03.24 08:15buy450.011942.970.001948.04
902022.03.24 13:31t/p450.011948.040.001948.045.071106.05
912022.03.25 03:00buy460.011963.150.001973.05
922022.03.28 08:54close460.011933.150.001973.05-30.391075.66
932022.04.08 03:00buy470.011933.410.001938.35
942022.04.08 15:09t/p470.011938.350.001938.354.941080.60
952022.04.11 08:45buy480.011945.040.001949.74
962022.04.11 11:19t/p480.011949.740.001949.744.701085.30
972022.04.12 14:15buy490.011956.750.001966.53
982022.04.12 15:39t/p490.011966.530.001966.539.781095.08
992022.04.13 04:49buy500.011968.240.001977.60
1002022.04.13 12:39t/p500.011977.600.001977.609.361104.44
1012022.04.14 02:00buy510.011978.740.001982.76
1022022.04.18 02:37t/p510.011982.760.001982.763.241107.68
1032022.05.05 13:30buy520.011898.320.001907.76
1042022.05.05 15:49t/p520.011907.760.001907.769.441117.12
1052022.05.20 18:15buy530.011844.250.001855.75
1062022.05.23 08:08t/p530.011855.750.001855.7511.111128.23
1072022.05.24 06:30buy540.011854.990.001865.45
1082022.05.24 16:47t/p540.011865.450.001865.4510.461138.69
1092022.05.30 16:30buy550.011860.920.001873.82
1102022.06.01 08:16close550.011830.910.001873.82-30.791107.90
1112022.06.09 02:15buy560.011854.400.001859.18
1122022.06.10 17:56t/p560.011859.180.001859.184.391112.29
1132022.06.17 08:15buy570.011847.450.001852.83
1142022.06.17 15:53t/p570.011852.830.001852.835.381117.67
1152022.07.22 09:00buy580.011716.330.001722.03
1162022.07.22 12:28t/p580.011722.030.001722.035.701123.37
1172022.07.25 01:15buy590.011726.550.001733.09
1182022.07.25 12:25t/p590.011733.090.001733.096.541129.91
1192022.08.01 05:15buy600.011764.200.001769.52
1202022.08.01 12:41t/p600.011769.520.001769.525.321135.23
1212022.08.01 21:00buy610.011769.470.001770.13
1222022.08.01 22:13t/p610.011770.130.001770.130.661135.89
1232022.08.02 12:15buy620.011773.900.001780.10
1242022.08.02 15:15t/p620.011780.100.001780.106.201142.09
1252022.08.05 07:45buy630.011792.110.001793.33
1262022.08.09 13:13close630.011792.630.001793.33-0.261141.83
1272022.08.24 17:00buy640.011746.340.001752.42
1282022.08.24 17:53t/p640.011752.420.001752.426.081147.91
1292022.09.05 20:00buy650.011712.460.001716.56
1302022.09.06 03:22t/p650.011716.560.001716.563.711151.62
1312022.09.08 07:15buy660.011717.020.001722.70
1322022.09.08 13:37t/p660.011722.700.001722.705.681157.30
1332022.09.30 16:45buy670.011669.280.001683.14
1342022.10.03 17:22t/p670.011683.140.001683.1413.471170.77
1352022.10.04 06:45buy680.011700.540.001710.26
1362022.10.04 10:18t/p680.011710.260.001710.269.721180.49
1372022.10.24 07:45buy690.011658.510.001667.75
1382022.10.26 10:28t/p690.011667.750.001667.758.461188.96
1392022.10.26 18:15buy700.011672.220.001688.32
1402022.10.28 15:30close700.011642.200.001688.32-31.581157.38
1412022.11.02 20:15buy710.011664.620.001700.82
1422022.11.02 22:53close710.011634.620.001700.82-30.001127.38
1432022.11.07 05:32buy720.011673.510.001679.03
1442022.11.07 11:26t/p720.011679.030.001679.035.521132.90
1452022.11.10 13:00buy730.011708.720.001717.36
1462022.11.10 15:31t/p730.011717.360.001717.368.641141.54
1472022.11.11 06:45buy740.011752.220.001756.28
1482022.11.11 07:27t/p740.011756.280.001756.284.061145.60
1492022.11.14 05:15buy750.011765.360.001773.46
1502022.11.14 17:12t/p750.011773.460.001773.468.101153.70
1512022.11.25 13:15buy760.011754.030.001758.42
1522022.11.28 10:41t/p760.011758.420.001758.424.001157.70
1532022.12.08 13:45buy770.011784.930.001789.57
1542022.12.08 15:33t/p770.011789.570.001789.574.641162.34
1552022.12.09 13:00buy780.011794.980.001806.40
1562022.12.13 15:33t/p780.011806.400.001806.4010.641172.98
1572022.12.14 03:01buy790.011811.670.001816.43
1582022.12.15 10:13close790.011781.650.001816.43-31.191141.79
1592022.12.22 02:15buy800.011816.300.001821.24
1602022.12.22 20:22close800.011786.290.001821.24-30.011111.78
1612022.12.30 03:00buy810.011816.670.001821.47
1622022.12.30 09:01t/p810.011821.470.001821.474.801116.58
1632023.01.05 09:30buy820.011854.550.001861.91
1642023.01.06 17:32t/p820.011861.910.001861.916.971123.55
1652023.01.09 14:15buy830.011875.550.001880.26
1662023.01.09 16:48t/p830.011880.260.001880.264.711128.26
1672023.01.10 21:15buy840.011876.260.001884.08
1682023.01.11 07:38t/p840.011884.080.001884.087.431135.69
1692023.01.13 10:00buy850.011900.050.001909.69
1702023.01.13 16:50t/p850.011909.690.001909.699.641145.33
1712023.01.20 17:30buy860.011930.470.001939.89
1722023.01.24 09:02t/p860.011939.890.001939.898.641153.97
1732023.02.01 06:15buy870.011928.460.001935.50
1742023.02.01 21:42t/p870.011935.500.001935.507.041161.01
1752023.02.20 04:30buy880.011842.690.001851.25
1762023.02.22 14:31close880.011843.210.001851.25-0.261160.75
1772023.03.01 04:00buy890.011829.500.001841.56
1782023.03.01 16:38t/p890.011841.560.001841.5612.061172.81
1792023.03.13 11:00buy900.011885.910.001910.31
1802023.03.13 16:46t/p900.011910.310.001910.3124.401197.21
1812023.03.14 08:15buy910.011911.340.001920.81
1822023.03.15 14:02t/p910.011920.810.001920.819.081206.29
1832023.03.16 01:15buy920.011921.550.001928.75
1842023.03.16 14:21t/p920.011928.750.001928.757.201213.49
1852023.03.16 21:15buy930.011920.070.001929.99
1862023.03.17 06:54t/p930.011929.990.001929.999.531223.02
1872023.03.20 06:15buy940.011974.930.001978.89
1882023.03.20 07:46t/p940.011978.890.001978.893.961226.98
1892023.03.24 05:58buy950.011993.720.001997.28
1902023.03.24 12:08t/p950.011997.280.001997.283.561230.54
1912023.03.31 14:00buy960.011979.780.001984.58
1922023.03.31 15:33t/p960.011984.580.001984.584.801235.34
1932023.04.12 15:45buy970.012022.580.002038.57
1942023.04.13 15:46t/p970.012038.570.002038.5714.821250.16
1952023.04.26 09:45buy980.011998.890.002007.15
1962023.04.26 16:26t/p980.012007.150.002007.158.261258.42
1972023.05.03 11:40buy990.012016.640.002020.06
1982023.05.03 17:52t/p990.012020.060.002020.063.421261.84
1992023.05.31 08:00buy1000.011960.450.001966.77
2002023.05.31 16:42t/p1000.011966.770.001966.776.321268.16
2012023.06.01 02:15buy1010.011966.210.001972.39
2022023.06.01 16:35t/p1010.011972.390.001972.396.181274.34
2032023.06.02 05:00buy1020.011977.740.001981.07
2042023.06.02 06:06t/p1020.011981.070.001981.073.331277.67
2052023.06.02 12:45buy1030.011981.030.001991.41
2062023.06.02 21:01close1030.011951.030.001991.41-30.001247.67
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 3.gif b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..83d01e790fbad21f2846148f445b80ba77a6aa39 GIT binary patch literal 8795 zcmch6_cz?n_x}^YYEdGhh9J5W-6|0gy(E!{P7={;L~pCF)mCS%UUt{&Wp&Y`6Lodb z2|^Mr$bP(E-~Zt|XXc!H?xWm0Gr!HKX{gG`zLOy712zGGKp+4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es (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit235.24Gross profit679.38Gross loss-444.14
Profit factor1.53Expected payoff1.85
Absolute drawdown40.51Maximal drawdown135.42 (12.37%)Relative drawdown12.37% (135.42)
Total trades127Short positions (won %)0 (0.00%)Long positions (won %)127 (81.89%)
Profit trades (% of total)104 (81.89%)Loss trades (% of total)23 (18.11%)
Largestprofit trade42.24loss trade-31.31
Averageprofit trade6.53loss trade-19.31
Maximumconsecutive wins (profit in money)21 (167.96)consecutive losses (loss in money)3 (-73.90)
Maximalconsecutive profit (count of wins)167.96 (21)consecutive loss (count of losses)-73.90 (3)
Averageconsecutive wins7consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.321014.13
62020.12.07 16:52t/p30.011853.880.001853.889.841023.98
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.30
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.08
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.58
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.13
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.45
182021.03.11 04:07t/p80.011729.620.001729.629.651075.10
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.00
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801082.80
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.74
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.871054.87
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.001058.88
302021.04.15 16:54t/p150.011756.020.001756.027.951066.83
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601075.43
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 15:51close180.011837.920.001846.050.071075.50
362021.05.12 15:52close170.011838.270.001843.26-0.361075.14
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041080.18
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.881087.07
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621089.69
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:04close220.011809.880.001816.230.071089.76
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.871058.89
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.03 21:30close240.011810.040.001835.53-20.781038.11
502021.08.04 04:15close250.011809.250.001836.63-22.251015.86
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.541021.41
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041025.45
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741028.19
582021.09.15 15:24t/p280.011806.410.001806.412.381030.57
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851034.42
612021.10.01 10:00buy310.011756.170.001765.71
622021.10.04 09:00buy320.011761.820.001765.62
632021.10.04 17:39t/p320.011765.620.001765.623.801038.22
642021.10.04 17:39t/p310.011765.710.001765.719.101047.32
652021.10.13 04:00buy330.011761.880.001765.16
662021.10.13 10:39t/p330.011765.160.001765.163.281050.60
672021.10.21 04:00buy340.011784.290.001789.57
682021.10.22 09:31t/p340.011789.570.001789.574.841055.45
692021.10.25 01:15buy350.011793.940.001797.00
702021.10.25 03:54t/p350.011797.000.001797.003.061058.51
712021.11.05 15:15buy360.011796.030.001806.59
722021.11.05 17:22t/p360.011806.590.001806.5910.561069.07
732021.11.08 12:15buy370.011818.130.001823.43
742021.11.08 15:24t/p370.011823.430.001823.435.301074.37
752021.11.18 09:49buy380.011867.550.001875.57
762021.11.22 12:39close380.011837.550.001875.57-30.871043.50
772021.12.07 08:00buy390.011781.410.001785.45
782021.12.07 18:24t/p390.011785.450.001785.454.041047.54
792021.12.14 03:00buy400.011788.260.001793.76
802021.12.14 08:15buy410.011788.520.001793.80
812021.12.15 21:00close410.011758.510.001793.80-30.451017.09
822021.12.15 21:00close400.011758.250.001793.76-30.45986.65
832021.12.23 15:30buy420.011808.530.001813.33
842021.12.28 01:00close420.011811.350.001813.331.51988.16
852021.12.28 06:45buy430.011810.940.001813.94
862021.12.28 08:36t/p430.011813.940.001813.943.00991.16
872022.01.11 15:30buy440.011808.530.001814.47
882022.01.11 18:22t/p440.011814.470.001814.475.94997.10
892022.01.12 07:34buy450.011820.620.001824.28
902022.01.12 15:39t/p450.011824.280.001824.283.661000.76
912022.01.13 05:22buy460.011825.620.001827.54
922022.01.13 07:39t/p460.011827.540.001827.541.921002.68
932022.01.26 04:00buy470.011848.320.001851.06
942022.01.26 21:54close470.011818.320.001851.06-30.00972.68
952022.02.01 18:30buy480.011807.070.001815.95
962022.02.03 04:00close480.011808.370.001815.95-0.44972.24
972022.02.09 03:45buy490.011826.840.001829.58
982022.02.09 14:30buy500.011827.570.001828.85
992022.02.09 15:04t/p500.011828.850.001828.851.28973.52
1002022.02.09 15:04t/p490.011829.580.001829.582.74976.26
1012022.02.18 15:00buy510.011894.370.001904.85
1022022.02.21 01:24t/p510.011904.850.001904.8510.04986.30
1032022.03.02 08:45buy520.011937.780.001948.72
1042022.03.03 22:19close520.011938.290.001948.72-0.80985.51
1052022.03.04 11:15buy530.011941.760.001956.50
1062022.03.04 16:37t/p530.011956.500.001956.5014.741000.25
1072022.03.07 17:45buy540.011989.520.002032.20
1082022.03.08 06:45buy550.011990.020.001999.84
1092022.03.08 08:30t/p550.011999.840.001999.849.821010.07
1102022.03.08 16:49t/p540.012032.200.002032.2042.241052.31
1112022.03.24 08:15buy560.011943.000.001948.07
1122022.03.24 13:31t/p560.011948.070.001948.075.071057.38
1132022.03.25 03:00buy570.011963.180.001973.08
1142022.03.28 08:54close570.011933.170.001973.08-30.451026.94
1152022.04.08 03:00buy580.011933.440.001938.38
1162022.04.08 15:09t/p580.011938.380.001938.384.941031.88
1172022.04.11 08:45buy590.011945.070.001949.77
1182022.04.11 11:19t/p590.011949.770.001949.774.701036.58
1192022.04.12 14:15buy600.011956.780.001966.56
1202022.04.12 15:39t/p600.011966.560.001966.569.781046.36
1212022.04.13 04:49buy610.011968.270.001977.63
1222022.04.13 12:39t/p610.011977.630.001977.639.361055.72
1232022.04.14 02:00buy620.011978.770.001982.79
1242022.04.14 05:00buy630.011980.150.001986.33
1252022.04.14 10:45buy640.011977.610.001984.30
1262022.04.18 02:37t/p620.011982.790.001982.793.151058.87
1272022.04.18 02:46t/p640.011984.300.001984.305.821064.69
1282022.04.18 02:49t/p630.011986.330.001986.335.311069.99
1292022.05.05 13:30buy650.011898.350.001907.79
1302022.05.05 15:49t/p650.011907.790.001907.799.441079.43
1312022.05.20 18:15buy660.011844.280.001855.78
1322022.05.23 08:08t/p660.011855.780.001855.7811.061090.50
1332022.05.24 06:30buy670.011855.020.001865.48
1342022.05.24 16:47t/p670.011865.480.001865.4810.461100.96
1352022.05.30 16:30buy680.011860.950.001873.85
1362022.06.01 08:16close680.011830.950.001873.85-30.871070.09
1372022.06.09 02:15buy690.011854.430.001859.21
1382022.06.10 17:51close690.011854.940.001859.210.071070.16
1392022.06.17 08:15buy700.011847.480.001852.86
1402022.06.22 04:45close700.011828.420.001852.86-20.371049.80
1412022.07.22 09:00buy710.011716.360.001722.06
1422022.07.22 12:28t/p710.011722.060.001722.065.701055.50
1432022.07.25 01:15buy720.011726.580.001733.12
1442022.07.25 12:25t/p720.011733.120.001733.126.541062.04
1452022.08.01 05:15buy730.011764.230.001769.55
1462022.08.01 09:45buy740.011764.350.001769.94
1472022.08.01 12:41t/p730.011769.550.001769.555.321067.36
1482022.08.01 12:42t/p740.011769.940.001769.945.591072.95
1492022.08.01 21:00buy750.011769.500.001770.16
1502022.08.01 22:13t/p750.011770.160.001770.160.661073.61
1512022.08.02 12:15buy760.011773.930.001780.13
1522022.08.02 15:15t/p760.011780.130.001780.136.201079.81
1532022.08.05 07:45buy770.011792.140.001793.36
1542022.08.09 11:25close770.011792.660.001793.36-0.351079.46
1552022.08.24 17:00buy780.011746.370.001752.45
1562022.08.24 17:53t/p780.011752.450.001752.456.081085.54
1572022.09.05 20:00buy790.011712.490.001716.59
1582022.09.06 03:22t/p790.011716.590.001716.593.661089.20
1592022.09.08 07:15buy800.011717.050.001722.73
1602022.09.08 13:37t/p800.011722.730.001722.735.681094.88
1612022.09.30 16:45buy810.011669.310.001683.17
1622022.10.03 17:22t/p810.011683.170.001683.1713.421108.31
1632022.10.04 06:45buy820.011700.570.001710.29
1642022.10.04 10:18t/p820.011710.290.001710.299.721118.03
1652022.10.24 07:45buy830.011658.540.001667.78
1662022.10.25 16:48close830.011659.050.001667.780.071118.10
1672022.10.26 03:00buy840.011653.320.001656.82
1682022.10.26 06:27t/p840.011656.820.001656.823.501121.60
1692022.10.26 18:15buy850.011672.250.001688.35
1702022.10.27 08:45buy860.011669.970.001683.09
1712022.10.27 11:16buy870.011665.690.001671.40
1722022.10.28 04:58close870.011666.210.001671.400.081121.68
1732022.10.28 04:58close860.011666.210.001683.09-4.201117.49
1742022.10.28 04:58close850.011666.210.001688.35-7.781109.71
1752022.11.02 20:15buy880.011664.650.001682.75
1762022.11.02 22:53close880.011634.640.001682.75-30.011079.70
1772022.11.07 05:32buy890.011673.540.001679.06
1782022.11.07 11:26t/p890.011679.060.001679.065.521085.22
1792022.11.10 13:00buy900.011708.750.001717.39
1802022.11.10 15:31t/p900.011717.390.001717.398.641093.86
1812022.11.11 06:45buy910.011752.250.001756.31
1822022.11.11 07:27t/p910.011756.310.001756.314.061097.92
1832022.11.14 05:15buy920.011765.390.001773.49
1842022.11.14 09:45buy930.011762.610.001767.41
1852022.11.14 16:40t/p930.011767.410.001767.414.801102.72
1862022.11.14 17:12t/p920.011773.490.001773.498.101110.82
1872022.11.25 13:15buy940.011754.060.001758.45
1882022.11.28 10:41t/p940.011758.450.001758.453.951114.77
1892022.12.08 13:45buy950.011784.960.001789.60
1902022.12.08 15:33t/p950.011789.600.001789.604.641119.41
1912022.12.09 13:00buy960.011795.010.001806.43
1922022.12.13 15:31close960.011795.560.001806.43-0.321119.09
1932022.12.14 03:01buy970.011811.700.001816.46
1942022.12.15 10:13close970.011781.700.001816.46-31.311087.78
1952022.12.22 02:15buy980.011816.330.001821.27
1962022.12.22 20:22close980.011786.320.001821.27-30.011057.77
1972022.12.30 03:00buy990.011816.700.001821.50
1982022.12.30 09:01t/p990.011821.500.001821.504.801062.57
1992023.01.05 09:30buy1000.011854.580.001861.94
2002023.01.06 17:42t/p1000.011861.940.001861.946.921069.50
2012023.01.09 14:15buy1010.011875.580.001880.29
2022023.01.09 16:48t/p1010.011880.290.001880.294.711074.21
2032023.01.10 21:15buy1020.011876.290.001884.11
2042023.01.11 06:00buy1030.011878.160.001884.56
2052023.01.11 07:38t/p1020.011884.110.001884.117.381081.59
2062023.01.11 10:48t/p1030.011884.560.001884.566.401087.99
2072023.01.13 10:00buy1040.011900.080.001909.72
2082023.01.13 16:50t/p1040.011909.720.001909.729.641097.63
2092023.01.20 17:30buy1050.011930.500.001939.92
2102023.01.24 03:00close1050.011931.020.001939.92-0.351097.28
2112023.02.01 06:15buy1060.011928.490.001935.53
2122023.02.01 21:42t/p1060.011935.530.001935.537.041104.32
2132023.02.20 04:30buy1070.011842.720.001851.28
2142023.02.21 16:35close1070.011843.230.001851.280.071104.40
2152023.03.01 04:00buy1080.011829.530.001841.59
2162023.03.01 16:38t/p1080.011841.590.001841.5912.061116.46
2172023.03.13 11:00buy1090.011885.940.001910.34
2182023.03.13 16:46t/p1090.011910.340.001910.3424.401140.86
2192023.03.14 08:15buy1100.011911.370.001920.84
2202023.03.14 14:15buy1110.011907.700.001919.34
2212023.03.14 19:00buy1120.011909.110.001922.09
2222023.03.15 14:01t/p1110.011919.340.001919.3411.201152.06
2232023.03.15 14:02t/p1100.011920.840.001920.849.031161.10
2242023.03.15 14:03t/p1120.011922.090.001922.0912.541173.64
2252023.03.16 01:15buy1130.011921.580.001928.78
2262023.03.16 14:21t/p1130.011928.780.001928.787.201180.84
2272023.03.16 21:15buy1140.011920.100.001930.02
2282023.03.17 06:54t/p1140.011930.020.001930.029.481190.33
2292023.03.20 06:15buy1150.011974.960.001978.92
2302023.03.20 07:46t/p1150.011978.920.001978.923.961194.29
2312023.03.24 05:58buy1160.011993.750.001997.31
2322023.03.24 12:08t/p1160.011997.310.001997.313.561197.85
2332023.03.31 14:00buy1170.011979.810.001984.61
2342023.03.31 15:33t/p1170.011984.610.001984.614.801202.65
2352023.04.12 15:45buy1180.012022.610.002038.60
2362023.04.13 15:46t/p1180.012038.600.002038.6014.681217.33
2372023.04.26 09:45buy1190.011998.920.002007.18
2382023.04.26 16:26t/p1190.012007.180.002007.188.261225.59
2392023.05.03 11:40buy1200.012016.670.002020.09
2402023.05.03 14:00buy1210.012016.960.002019.66
2412023.05.03 16:30buy1220.012019.060.002029.60
2422023.05.03 16:35t/p1210.012019.660.002019.662.701228.29
2432023.05.03 17:52t/p1200.012020.090.002020.093.421231.71
2442023.05.03 21:00t/p1220.012029.600.002029.6010.541242.25
2452023.05.31 08:00buy1230.011960.480.001966.80
2462023.05.31 13:45buy1240.011958.910.001966.07
2472023.05.31 16:42t/p1240.011966.070.001966.077.161249.41
2482023.05.31 16:42t/p1230.011966.800.001966.806.321255.73
2492023.06.01 02:15buy1250.011966.240.001972.42
2502023.06.01 16:35t/p1250.011972.420.001972.426.181261.91
2512023.06.02 05:00buy1260.011977.770.001981.10
2522023.06.02 06:06t/p1260.011981.100.001981.103.331265.24
2532023.06.02 12:45buy1270.011981.060.001991.44
2542023.06.02 20:51close1270.011951.060.001991.44-30.001235.24
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.gif b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.gif new file mode 100644 index 0000000000000000000000000000000000000000..84c508ef5e1c261aa4dc69f25dce0b05c66534a3 GIT binary patch literal 9194 zcmch+^juWD-#UfCF6J3dH}9NB)IW_&)$J*l?9p zAd>!%2mshNT$NrGUqKDFIE7XudEHjwN)u_@VB2~n4FC)(D72EVPymkfe=4>(fbBZ@ zijHi(>Ts33azsWdC|qeN{BKogxbg=8kgnX=A{(ySAQc)&SHacNdR2+M0tW#KgIBDp zKFBN5)tUZh;wt|?q=7_2l89H4?NttdvsD0Gsa+W&DFCj9?bZJ3=>I=oVpmTe@V|Ef zpe2U@!l2<1kx?)>B045EE*_bXn3SB7nwFlCnU$TBo0nfuSX5ksLYHE&W#tu>Rk-S! z+PeCNMm(XZxuvzOy`!`1%h&Fn-oE~U!J*-ABctUM6O&WZGsM|B()_~W((=mc+V}O1 zADdg-JG*=P2Zuj@{XY8h_xKP;k$3IiW$p#wa)%AMtg1)Nd~-e-x$;z(K|pzkEn)S! z4*R1^(lMe)EtFpc@gG;>ca5lfhPlbu@QrAn@ z85wG+3*AeplQuHepzx?nMA!o;bg1cJ1Bh)v*fUxdVW#gg=4LPGxabu`@4MWqawgyF zrta|GpQ}RgP#K*6-Y=?Uym@%Ujcb)ku6^KPJ=AO+TmI!c?_}h*SdFX8h zULK3wp#n;o>zN$O_nQ5Y(Cg-ABSyphp9C6fgjRB?8vopx^4K~1>jam*!^qFVs$%m* zE@Uv`<(Y%V4NPNt z?>3yWRHBeV6vt#n_aMd;1`?*1wDe6oSA=>Vw4-~Gx@Nh39C0OjWxGA$zW@2tQw zC}s1ROaXFSH~^#kGR`ImpyLN+1RCI;0YHaL8;sDB^%BO%1`Z)<)nii|X`c{V8x#{q zhap)ux=EB^lf~sPxv%ET1Vbi#0YA(=wwF<9P@{g^oDUod8Zr=M+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f= zqo^Z0#Yj_Fm8xr$FdWqbGyM?}RUDZh98q(kM4Eu70m1fo1v9Sb7<6c!J%~pb5&1aE zmMhA`6k%-|3gJ@3lyV#P!5d+)p+4X46EHI|;=NDIxg4~VA0c28o4-jFRJ6I@qs}8ShpxZ9TA*>hhv!Fq^ob?_A#F6{+z;b8^=nwf5cvcYoJka`N+5>JjnR* zi=Xzf`>^Oq7&)fkztCg*2u`!mv-E@+Vl1&VV%Rr^!YsO))*F<;u}|wY?-AxojIUt| z74`%1&nnU12X~tWRRdhgq{0+V-9>4`l+2Qvq5vWwx~|vC;&8BLzY>=pSZ6D)=)_&x z5BltWQVcTb*%nwHl&oM%9oLv7KnU9SklfA{yw{t!Mg+EOCNp3XVti8I%bML9Da`OB zYSTmnQ|fz7?#LhE6%()!I}dleqym0z+1><3Q^!MM9I-Jy7Y+Vw;tAaZCt?6H=#X04 z7pZ1G4QpvjCSLWd>9w@!^1VK?X|W|4>DT(=!!d||zzj@?M>fc}C^91)mRTncj?&bI zqxAuKAaIMBZwWlO_G?y)SvJfslOC6u*^w2#m3a-H9nPKADWCHSoh60NA@%1hY~?J0 ja#!x>u4(43JLLX==WbzgclvYpwsH?ZdEu-;fa3oHssM)& literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.htm b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.htm new file mode 100644 index 0000000..31e957c --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/Whole StrategyTester.htm @@ -0,0 +1,333 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.19 23:45 (2020.01.01 - 2023.07.20)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test62525Ticks modelled71468432Modelling qualityn/a
Mismatched charts errors753
Initial deposit1000.00SpreadCurrent (60)
Total net profit225.21Gross profit749.40Gross loss-524.19
Profit factor1.43Expected payoff1.69
Absolute drawdown36.70Maximal drawdown158.55 (13.22%)Relative drawdown13.22% (158.55)
Total trades133Short positions (won %)0 (0.00%)Long positions (won %)133 (81.95%)
Profit trades (% of total)109 (81.95%)Loss trades (% of total)24 (18.05%)
Largestprofit trade42.29loss trade-32.32
Averageprofit trade6.88loss trade-21.84
Maximumconsecutive wins (profit in money)19 (161.19)consecutive losses (loss in money)4 (-122.72)
Maximalconsecutive profit (count of wins)161.19 (19)consecutive loss (count of losses)-122.72 (4)
Averageconsecutive wins8consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.371014.18
62020.12.07 16:52t/p30.011853.880.001853.889.891024.08
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.40
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.18
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.68
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.23
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.55
182021.03.11 04:07t/p80.011729.620.001729.629.801075.35
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.25
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801083.05
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.99
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.771055.22
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.151059.38
302021.04.15 16:54t/p150.011756.020.001756.028.101067.48
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601076.08
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 16:04t/p170.011843.260.001843.264.731080.81
362021.05.14 15:16close180.011837.920.001846.05-1.421079.40
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041084.44
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.931091.37
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621093.99
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:39t/p220.011816.230.001816.236.471100.47
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.771069.70
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.04 16:09close240.011830.460.001835.53-0.651069.05
502021.08.04 16:22close250.011830.700.001836.63-0.651068.41
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.591074.00
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041078.04
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741080.78
582021.09.15 15:24t/p280.011806.410.001806.412.381083.16
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851087.01
612021.10.01 10:00buy310.011756.170.001765.71
622021.10.04 09:00buy320.011761.820.001765.62
632021.10.04 17:39t/p320.011765.620.001765.623.801090.81
642021.10.04 17:39t/p310.011765.710.001765.719.151099.97
652021.10.13 04:00buy330.011761.880.001765.16
662021.10.13 10:39t/p330.011765.160.001765.163.281103.25
672021.10.21 04:00buy340.011784.290.001789.57
682021.10.22 09:31t/p340.011789.570.001789.574.891108.14
692021.10.25 01:15buy350.011793.940.001797.00
702021.10.25 03:54t/p350.011797.000.001797.003.061111.20
712021.11.05 15:15buy360.011796.030.001806.59
722021.11.05 17:22t/p360.011806.590.001806.5910.561121.76
732021.11.08 12:15buy370.011818.130.001823.43
742021.11.08 15:24t/p370.011823.430.001823.435.301127.06
752021.11.18 09:49buy380.011867.550.001875.57
762021.11.22 12:39close380.011837.550.001875.57-30.771096.29
772021.12.07 08:00buy390.011781.410.001785.45
782021.12.07 18:24t/p390.011785.450.001785.454.041100.33
792021.12.14 03:00buy400.011788.260.001793.76
802021.12.14 08:15buy410.011788.520.001793.80
812021.12.15 21:00close410.011758.510.001793.80-30.401069.94
822021.12.15 21:00close400.011758.250.001793.76-30.401039.54
832021.12.23 15:30buy420.011808.530.001813.33
842021.12.28 06:45buy430.011810.940.001813.94
852021.12.28 07:54t/p420.011813.330.001813.333.641043.19
862021.12.28 08:36t/p430.011813.940.001813.943.001046.19
872022.01.11 15:30buy440.011808.530.001814.47
882022.01.11 18:22t/p440.011814.470.001814.475.941052.13
892022.01.12 07:34buy450.011820.620.001824.28
902022.01.12 15:39t/p450.011824.280.001824.283.661055.79
912022.01.13 05:22buy460.011825.620.001827.54
922022.01.13 07:39t/p460.011827.540.001827.541.921057.71
932022.01.26 04:00buy470.011848.320.001851.06
942022.01.26 21:54close470.011818.320.001851.06-30.001027.71
952022.02.01 18:30buy480.011807.070.001815.95
962022.02.04 17:30close480.011807.580.001815.95-1.421026.29
972022.02.09 03:45buy490.011826.840.001829.58
982022.02.09 14:30buy500.011827.570.001828.85
992022.02.09 15:04t/p500.011828.850.001828.851.281027.57
1002022.02.09 15:04t/p490.011829.580.001829.582.741030.31
1012022.02.18 15:00buy510.011894.370.001904.85
1022022.02.21 01:24t/p510.011904.850.001904.8510.091040.41
1032022.03.02 08:45buy520.011937.780.001948.72
1042022.03.04 02:39t/p520.011948.720.001948.729.401049.81
1052022.03.04 11:15buy530.011941.760.001956.50
1062022.03.04 16:37t/p530.011956.500.001956.5014.741064.55
1072022.03.07 17:45buy540.011989.520.002032.20
1082022.03.08 06:45buy550.011990.020.001999.84
1092022.03.08 08:30t/p550.011999.840.001999.849.821074.37
1102022.03.08 16:49t/p540.012032.200.002032.2042.291116.66
1112022.03.24 08:15buy560.011943.000.001948.07
1122022.03.24 13:31t/p560.011948.070.001948.075.071121.73
1132022.03.25 03:00buy570.011963.180.001973.08
1142022.03.28 08:54close570.011933.170.001973.08-30.401091.33
1152022.04.08 03:00buy580.011933.440.001938.38
1162022.04.08 15:09t/p580.011938.380.001938.384.941096.27
1172022.04.11 08:45buy590.011945.070.001949.77
1182022.04.11 11:19t/p590.011949.770.001949.774.701100.97
1192022.04.12 14:15buy600.011956.780.001966.56
1202022.04.12 15:39t/p600.011966.560.001966.569.781110.75
1212022.04.13 04:49buy610.011968.270.001977.63
1222022.04.13 12:39t/p610.011977.630.001977.639.361120.11
1232022.04.14 02:00buy620.011978.770.001982.79
1242022.04.14 05:00buy630.011980.150.001986.33
1252022.04.14 10:45buy640.011977.610.001984.30
1262022.04.18 02:37t/p620.011982.790.001982.793.251123.36
1272022.04.18 02:46t/p640.011984.300.001984.305.921129.28
1282022.04.18 02:49t/p630.011986.330.001986.335.411134.69
1292022.05.05 13:30buy650.011898.350.001907.79
1302022.05.05 15:49t/p650.011907.790.001907.799.441144.13
1312022.05.20 18:15buy660.011844.280.001855.78
1322022.05.23 08:08t/p660.011855.780.001855.7811.111155.25
1332022.05.24 06:30buy670.011855.020.001865.48
1342022.05.24 16:47t/p670.011865.480.001865.4810.461165.71
1352022.05.30 16:30buy680.011860.950.001873.85
1362022.06.01 08:16close680.011830.950.001873.85-30.771134.94
1372022.06.09 02:15buy690.011854.430.001859.21
1382022.06.10 17:56t/p690.011859.210.001859.214.391139.33
1392022.06.17 08:15buy700.011847.480.001852.86
1402022.06.23 20:45close700.011828.540.001852.86-21.251118.08
1412022.07.22 09:00buy710.011716.360.001722.06
1422022.07.22 12:28t/p710.011722.060.001722.065.701123.78
1432022.07.25 01:15buy720.011726.580.001733.12
1442022.07.25 12:25t/p720.011733.120.001733.126.541130.32
1452022.08.01 05:15buy730.011764.230.001769.55
1462022.08.01 09:45buy740.011764.350.001769.94
1472022.08.01 12:41t/p730.011769.550.001769.555.321135.64
1482022.08.01 12:42t/p740.011769.940.001769.945.591141.23
1492022.08.01 21:00buy750.011769.500.001770.16
1502022.08.01 22:13t/p750.011770.160.001770.160.661141.89
1512022.08.02 12:15buy760.011773.930.001780.13
1522022.08.02 15:15t/p760.011780.130.001780.136.201148.09
1532022.08.05 07:45buy770.011792.140.001793.36
1542022.08.09 13:42t/p770.011793.360.001793.360.451148.54
1552022.08.24 17:00buy780.011746.370.001752.45
1562022.08.24 17:53t/p780.011752.450.001752.456.081154.62
1572022.09.05 20:00buy790.011712.490.001716.59
1582022.09.06 03:22t/p790.011716.590.001716.593.711158.34
1592022.09.08 07:15buy800.011717.050.001722.73
1602022.09.08 13:37t/p800.011722.730.001722.735.681164.02
1612022.09.30 16:45buy810.011669.310.001683.17
1622022.10.03 17:22t/p810.011683.170.001683.1713.471177.49
1632022.10.04 06:45buy820.011700.570.001710.29
1642022.10.04 10:18t/p820.011710.290.001710.299.721187.21
1652022.10.24 07:45buy830.011658.540.001667.78
1662022.10.26 03:00buy840.011653.320.001656.82
1672022.10.26 06:27t/p840.011656.820.001656.823.501190.71
1682022.10.26 10:28t/p830.011667.780.001667.788.471199.18
1692022.10.26 18:15buy850.011672.250.001688.35
1702022.10.27 08:45buy860.011669.970.001683.09
1712022.10.27 11:16buy870.011665.690.001671.40
1722022.10.28 15:30close850.011642.250.001688.35-31.541167.64
1732022.10.28 18:16close860.011639.970.001683.09-30.391137.26
1742022.10.31 10:33close870.011635.680.001671.40-30.781106.48
1752022.11.02 20:15buy880.011664.650.001700.85
1762022.11.02 22:53close880.011634.640.001700.85-30.011076.47
1772022.11.07 05:32buy890.011673.540.001679.06
1782022.11.07 11:26t/p890.011679.060.001679.065.521081.99
1792022.11.10 13:00buy900.011708.750.001717.39
1802022.11.10 15:31t/p900.011717.390.001717.398.641090.63
1812022.11.11 06:45buy910.011752.250.001756.31
1822022.11.11 07:27t/p910.011756.310.001756.314.061094.69
1832022.11.14 05:15buy920.011765.390.001773.49
1842022.11.14 09:45buy930.011762.610.001767.41
1852022.11.14 16:40t/p930.011767.410.001767.414.801099.49
1862022.11.14 17:12t/p920.011773.490.001773.498.101107.59
1872022.11.25 13:15buy940.011754.060.001758.45
1882022.11.28 10:41t/p940.011758.450.001758.454.001111.59
1892022.12.08 13:45buy950.011784.960.001789.60
1902022.12.08 15:33t/p950.011789.600.001789.604.641116.23
1912022.12.09 13:00buy960.011795.010.001806.43
1922022.12.13 15:33t/p960.011806.430.001806.4310.651126.88
1932022.12.14 03:01buy970.011811.700.001816.46
1942022.12.15 10:13close970.011781.700.001816.46-31.161095.73
1952022.12.22 02:15buy980.011816.330.001821.27
1962022.12.22 20:22close980.011786.320.001821.27-30.011065.72
1972022.12.30 03:00buy990.011816.700.001821.50
1982022.12.30 09:01t/p990.011821.500.001821.504.801070.52
1992023.01.05 09:30buy1000.011854.580.001861.94
2002023.01.06 17:42t/p1000.011861.940.001861.946.971077.49
2012023.01.09 14:15buy1010.011875.580.001880.29
2022023.01.09 16:48t/p1010.011880.290.001880.294.711082.20
2032023.01.10 21:15buy1020.011876.290.001884.11
2042023.01.11 06:00buy1030.011878.160.001884.56
2052023.01.11 07:38t/p1020.011884.110.001884.117.431089.64
2062023.01.11 10:48t/p1030.011884.560.001884.566.401096.04
2072023.01.13 10:00buy1040.011900.080.001909.72
2082023.01.13 16:50t/p1040.011909.720.001909.729.641105.68
2092023.01.20 17:30buy1050.011930.500.001939.92
2102023.01.24 09:02t/p1050.011939.920.001939.928.651114.33
2112023.02.01 06:15buy1060.011928.490.001935.53
2122023.02.01 21:42t/p1060.011935.530.001935.537.041121.37
2132023.02.20 04:30buy1070.011842.720.001851.28
2142023.02.24 15:33close1070.011812.710.001851.28-32.321089.05
2152023.03.01 04:00buy1080.011829.530.001841.59
2162023.03.01 16:38t/p1080.011841.590.001841.5912.061101.11
2172023.03.13 11:00buy1090.011885.940.001910.34
2182023.03.13 16:46t/p1090.011910.340.001910.3424.401125.51
2192023.03.14 08:15buy1100.011911.370.001920.84
2202023.03.14 14:15buy1110.011907.700.001919.34
2212023.03.14 19:00buy1120.011909.110.001922.09
2222023.03.15 14:01t/p1110.011919.340.001919.3411.251136.76
2232023.03.15 14:02t/p1100.011920.840.001920.849.081145.85
2242023.03.15 14:03t/p1120.011922.090.001922.0912.591158.44
2252023.03.16 01:15buy1130.011921.580.001928.78
2262023.03.16 14:21t/p1130.011928.780.001928.787.201165.64
2272023.03.16 21:15buy1140.011920.100.001930.02
2282023.03.17 06:54t/p1140.011930.020.001930.029.531175.17
2292023.03.20 06:15buy1150.011974.960.001978.92
2302023.03.20 07:46t/p1150.011978.920.001978.923.961179.13
2312023.03.24 05:58buy1160.011993.750.001997.31
2322023.03.24 12:08t/p1160.011997.310.001997.313.561182.69
2332023.03.31 14:00buy1170.011979.810.001984.61
2342023.03.31 15:33t/p1170.011984.610.001984.614.801187.49
2352023.04.12 15:45buy1180.012022.610.002038.60
2362023.04.13 15:46t/p1180.012038.600.002038.6014.831202.33
2372023.04.26 09:45buy1190.011998.920.002007.18
2382023.04.26 16:26t/p1190.012007.180.002007.188.261210.59
2392023.05.03 11:40buy1200.012016.670.002020.09
2402023.05.03 14:00buy1210.012016.960.002019.66
2412023.05.03 16:30buy1220.012019.060.002029.60
2422023.05.03 16:35t/p1210.012019.660.002019.662.701213.29
2432023.05.03 17:52t/p1200.012020.090.002020.093.421216.71
2442023.05.03 21:00t/p1220.012029.600.002029.6010.541227.25
2452023.05.31 08:00buy1230.011960.480.001966.80
2462023.05.31 13:45buy1240.011958.910.001966.07
2472023.05.31 16:42t/p1240.011966.070.001966.077.161234.41
2482023.05.31 16:42t/p1230.011966.800.001966.806.321240.73
2492023.06.01 02:15buy1250.011966.240.001972.42
2502023.06.01 16:35t/p1250.011972.420.001972.426.181246.91
2512023.06.02 05:00buy1260.011977.770.001981.10
2522023.06.02 06:06t/p1260.011981.100.001981.103.331250.24
2532023.06.02 12:45buy1270.011981.060.001991.44
2542023.06.02 20:51close1270.011951.060.001991.44-30.001220.24
2552023.07.03 07:00buy1280.011918.700.001922.42
2562023.07.03 16:16t/p1280.011922.420.001922.423.721223.96
2572023.07.11 19:45buy1290.011932.790.001935.57
2582023.07.12 03:35t/p1290.011935.570.001935.572.391226.35
2592023.07.13 16:15buy1300.011961.140.001969.50
2602023.07.18 14:16t/p1300.011969.500.001969.507.201233.56
2612023.07.19 10:15buy1310.011980.120.001986.85
2622023.07.19 15:30buy1320.011978.550.001984.68
2632023.07.19 20:08buy1330.011979.090.001989.95
2642023.07.19 23:54close at stop1330.011976.470.001989.95-2.621230.94
2652023.07.19 23:54close at stop1320.011976.470.001984.68-2.081228.86
2662023.07.19 23:54close at stop1310.011976.470.001986.85-3.651225.21
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.gif b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..d3f1e22e0cac0b9c78b9dd3aced40b0193082034 GIT binary patch literal 7402 zcmch5^`V1d4o z-iW~f3kv|?KTE<5jJ7BTH^T{Q7T_Cy_zeUG-;gYt0RSu*+)TIu0Oh#+udE5P;kUHFoM78yO;TpWB^Nt61K+`!%F6=jWkPp@$&uv|qyc6r!4 zhL}~A5Uw{FaY-?2YGFd3TgDk;3wre=ayRGts|vN>GK!GZh*j&pQG3n96<;l;+m?pP z;$Tt$yd@&ZDa`@E`1Ahud8K^oCh!7E}XcY1m(a3f21)?~B z+#O^!uU=QqfketELD>~M0?Pvt#yL7fl|hsYqTh7#KEHU3flK|!T2~w+Zv66w*6D!A zX6s|2)Gwi~f5&;Vv2#V`1akI49S~%A_D2qy`p}?gQ)p;#=#j+ICw@Z&6PZA{sjm+}teg$tvpKP1Rh(|Q z1QF}eUEtdYnji*+sV?~wy*obr4G=lC1W-MdnfJXHY5T>1ijjuTZB0{zk_)@fyz z_~z5?3*K911Rri%xDt{2A#C913dCtLz^8nfpi>Z%+^&IpDo37Swx9rVd)D%&{b6#V z3z0s5N_J-OmbGbQMjZlCB{$1%-OL0?N#P_#rB;mTW8NcNf?&3Jv9rn60eLAf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mck-(~QZDKl)3DW|NF6^i zoC-ce{3vox-?1%}UIYz8FwPlA#f7r_p~IeA&Y71xh4KW@h%d#DEK(taA}wqrkpD+^ J9EcPk{eP8ZSAPHi literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.htm b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.htm new file mode 100644 index 0000000..98bc578 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 1.htm @@ -0,0 +1,138 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit2337.40Gross profit2533.14Gross loss-195.74
Profit factor12.94Expected payoff57.01
Absolute drawdown600.00Maximal drawdown1787.50 (55.97%)Relative drawdown69.29% (1556.27)
Total trades41Short positions (won %)0 (0.00%)Long positions (won %)41 (95.12%)
Profit trades (% of total)39 (95.12%)Loss trades (% of total)2 (4.88%)
Largestprofit trade75.00loss trade-107.85
Averageprofit trade64.95loss trade-97.87
Maximumconsecutive wins (profit in money)17 (1231.46)consecutive losses (loss in money)1 (-107.85)
Maximalconsecutive profit (count of wins)1231.46 (17)consecutive loss (count of losses)-107.85 (1)
Averageconsecutive wins13consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 15:15buy10.501824.660.001826.16
22020.12.02 17:39t/p10.501826.160.001826.1675.001075.00
32021.01.11 04:00buy20.501829.260.001830.76
42021.01.11 04:31t/p20.501830.760.001830.7675.001150.00
52021.02.12 14:00buy30.501819.170.001820.67
62021.02.12 17:46t/p30.501820.670.001820.6775.001225.00
72021.02.15 10:30buy40.501819.510.001821.01
82021.02.15 13:39t/p40.501821.010.001821.0175.001300.00
92021.02.15 18:15buy50.501819.540.001821.04
102021.02.16 02:24t/p50.501821.040.001821.0453.231353.23
112021.05.07 06:15buy60.501819.850.001821.35
122021.05.07 06:24t/p60.501821.350.001821.3575.001428.23
132021.05.07 10:30buy70.501820.000.001821.50
142021.05.07 11:34t/p70.501821.500.001821.5075.001503.23
152021.05.07 16:00buy80.501839.160.001840.66
162021.05.07 16:03t/p80.501840.660.001840.6675.001578.23
172021.05.13 04:30buy90.501822.150.001823.65
182021.05.13 17:51t/p90.501823.650.001823.6575.001653.23
192021.06.17 02:45buy100.501820.030.001821.53
202021.06.17 04:54t/p100.501821.530.001821.5375.001728.23
212021.07.14 15:30buy110.501824.340.001825.84
222021.07.14 15:34t/p110.501825.840.001825.8475.001803.23
232021.07.16 15:45buy120.501823.910.001825.41
242021.07.16 16:39t/p120.501825.410.001825.4175.001878.23
252021.07.29 10:15buy130.501819.440.001820.94
262021.07.29 11:39t/p130.501820.940.001820.9475.001953.23
272021.08.27 22:30buy140.501818.730.001820.23
282021.08.30 03:37t/p140.501820.230.001820.2353.232006.46
292021.08.30 03:45buy150.501820.450.001821.95
302021.08.30 04:06t/p150.501821.950.001821.9575.002081.46
312021.09.03 16:00buy160.501823.920.001825.42
322021.09.03 16:09t/p160.501825.420.001825.4275.002156.46
332021.11.08 15:45buy170.501819.340.001820.84
342021.11.08 15:54t/p170.501820.840.001820.8475.002231.46
352021.12.28 15:45buy180.501819.710.001821.21
362021.12.31 11:09close180.501819.730.001821.21-107.852123.61
372022.01.05 15:15buy190.501820.490.001821.99
382022.01.05 15:24t/p190.501821.990.001821.9975.002198.61
392022.01.12 16:00buy200.501821.690.001823.19
402022.01.12 16:37t/p200.501823.190.001823.1975.002273.61
412022.01.18 18:00buy210.501820.250.001821.75
422022.01.19 15:21t/p210.501821.750.001821.7553.232326.84
432022.01.19 15:21buy220.501822.350.001823.85
442022.01.19 15:24t/p220.501823.850.001823.8575.002401.84
452022.02.08 10:45buy230.501820.380.001821.88
462022.02.08 15:39t/p230.501821.880.001821.8875.002476.84
472022.05.13 02:15buy240.501820.070.001821.57
482022.05.13 02:47t/p240.501821.570.001821.5775.002551.84
492022.05.13 14:15buy250.501818.840.001820.34
502022.05.16 21:56t/p250.501820.340.001820.3453.232605.07
512022.05.18 13:00buy260.501819.810.001821.31
522022.05.18 18:41t/p260.501821.310.001821.3175.002680.07
532022.05.18 19:00buy270.501823.970.001825.47
542022.05.19 12:08t/p270.501825.470.001825.479.692689.76
552022.06.14 16:15buy280.501820.010.001821.51
562022.06.15 09:37t/p280.501821.510.001821.5153.232742.99
572022.06.15 09:37buy290.501822.110.001823.61
582022.06.15 10:42t/p290.501823.610.001823.6175.002817.99
592022.06.16 15:15buy300.501823.900.001825.40
602022.06.16 15:31t/p300.501825.400.001825.4075.002892.99
612022.06.24 16:30buy310.501826.410.001827.91
622022.06.24 17:09t/p310.501827.910.001827.9175.002967.99
632022.06.29 19:15buy320.501818.970.001820.47
642022.06.30 03:49t/p320.501820.470.001820.479.692977.68
652022.12.13 17:00buy330.501822.380.001823.88
662022.12.13 17:00t/p330.501823.880.001823.8875.003052.68
672022.12.21 15:45buy340.501819.140.001820.64
682022.12.21 17:08t/p340.501820.640.001820.6475.003127.68
692022.12.22 05:15buy350.501818.900.001820.40
702022.12.27 17:26t/p350.501820.400.001820.409.693137.37
712022.12.27 17:45buy360.501827.790.001829.29
722023.01.03 01:05close360.501829.080.001829.29-87.893049.48
732023.01.03 01:05buy370.501829.670.001831.17
742023.01.03 02:12t/p370.501831.170.001831.1775.003124.48
752023.02.23 16:00buy380.501825.940.001827.44
762023.02.23 16:17t/p380.501827.440.001827.4475.003199.48
772023.02.27 20:15buy390.501819.340.001820.84
782023.02.28 17:00t/p390.501820.840.001820.8453.233252.71
792023.03.07 18:45buy400.501819.710.001821.21
802023.03.07 19:13t/p400.501821.210.001821.2175.003327.71
812023.03.08 17:45buy410.501820.430.001821.93
822023.03.09 15:33t/p410.501821.930.001821.939.693337.40
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.gif b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..bbc122207b234d1a72ab01f331f2759077e52c65 GIT binary patch literal 8409 zcmch5^;;9(`}YWi(V!q5iqfcn0;5ssP(%a-0Z}?tx<(AP0i$a)QloQp3ycP(M>nI9 zu6_Bupa0=Gah-GBuek4X&TmIqRY^k9OpFKvSOWm?csu|A=&=$AM+bsZ(odf~O0Jj4)`TuzM!${D70YD%676eUV|04nb7U)~) ztr!HbumAx5v&7%RXp1sXQzU-X0(9#ic?*F+wRhzuYX{0Xt;>r@95b0#N^a8c4l^NeqnKGd1ZBNePa{1wY{^u zw|{W>@96mCbia%so$%@=?HX{ibw6@JUh57m`%G-)qM{}xmu&z2sHN8$^v`dwr|@42 z{+x1fUB>7Ym5|5p(qa>%SJgs=%$i3TV{*Io#D8th^i<|)zh`=Sr&_E^=bf4|&*Qi% zF`d?w!iQQf`m`e&Yq5$De(OX+MSv87V5P4O%P;;4GDgfXGAK-Ma4yNMG1Jh zBUVOIB9OuP5IjrEjR;+bFvcy>nQ0O;a8E@WlJjtiD=r#D8B+1Bm>@MzcnFYStREOLTR%yY9n-;DF#QyoVkr(oWDbl3R`O<-BKop66{ga6-ImYSSTz9%@ zD>sM3qy!fNeSTzSdN9t$6p>b&pI<3E&1uub3_v2ei3^j<|LXUC$ajIj?XqL0lWYRB zk#ODuX^Igd>epc>R@Dx{7bs49hPHzI8hC?kexhqA4|)=gE2?RCo!Bf{d04=c=leZm zoZxE-I*_)wGx!VF0wp1P7ze3ykZ*+89oTPL6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x^!9eIPAU-H`@o*5bHm&SwC}DuKuWg zx)6zLKXQ7?#-whKBvoC6s|7mofc(ftGh7RFrB_j$+1#Vq{4OYT4{r&pDc_19K2dn^-qM_xxhxBdSTAxHA@EWb21T(hIPZP`^3;5+r zJUT~puV0fFf37a594`2tcu#-r>IH!F4Fqp60vazm*({2P6O5%99y2&POzd+4JBe(R~__iu^wesvUY z@xr&>(aaFm&1T=xb&e|_kw2v$y3TcecQCW|=Sxk4Pp3nmz|0)ZwZ5@fyTnr}^gQt+ z&B7QlNvr_riUoahPgAFt7nxBNvb{dY-9fJn#d>igo;IBdk!lDfJKdjXJ!gAr^UrJU z_~xbT89mTD3`8d6+*9M)MCT#e80g;qw~ni1Pe`d>Yo_^O#h0dC-qz{Qy5JX`+ziez z%jZi*FZ?@VhMf|Gi@v-)n*_Yd-Hq47zwu`qs%a5-74+F-(Z4WMCD8XQi$$act}m5Fx778y;rkVdZY3&9CATrl z2(6cxUkmbN3pN`Qpp#*i99vUrdp$+BrC;diqiiYgC(-xqgT~0p9B~<5A}3^bB;yOO zvC~T{t_P1@H?2#^c;05} zz0`XlL;J#VQYWveGn--GT5a2--;-UmimMIh*mp79%jIU)le%4myd14@%B$rfNayZG z(tgar-D^zQQ67~77!0@PkP3Xo+nB4()q$xCi~D!YOr+)`R9==eHT>21RX@E&hYZI%M3f) zec1<~5gyu^@<755-)cMq72pe?ma9#Jys}Y_CByuoWV&)lu@hk{U>Pts1;z`sMqIkx zl^APH@YG&@hdnDKL{^2HNUvNQ+V@hkE^7`o%z2D`-*)9&P2fQ+$jtyd-b?;77`L6z z+rf2y@mYH(B)UbkYtt7ao77aZ_qz9Si`$#3ah;F{4)&?+p34o$BMtlJf9cfM8|r=+ iqovKqr4iTLwtkm0d(EdU)HnN~epf3`jX41Tss97(xHrTA literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.htm b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.htm new file mode 100644 index 0000000..1997074 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/XR Strategy Test 2.htm @@ -0,0 +1,241 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=35; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=2; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=96; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit-22.73Gross profit140.12Gross loss-162.85
Profit factor0.86Expected payoff-0.26
Absolute drawdown35.59Maximal drawdown110.15 (10.25%)Relative drawdown10.25% (110.15)
Total trades87Short positions (won %)0 (0.00%)Long positions (won %)87 (88.51%)
Profit trades (% of total)77 (88.51%)Loss trades (% of total)10 (11.49%)
Largestprofit trade9.07loss trade-31.31
Averageprofit trade1.82loss trade-16.29
Maximumconsecutive wins (profit in money)33 (47.60)consecutive losses (loss in money)3 (-67.46)
Maximalconsecutive profit (count of wins)60.79 (24)consecutive loss (count of losses)-67.46 (3)
Averageconsecutive wins10consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
1652022.07.20 16:45buy830.011710.780.001713.22
1662022.07.21 14:37close830.011680.780.001713.22-31.31967.80
1472022.05.10 14:45buy740.011863.420.001865.19
1482022.05.11 02:53close740.011833.400.001865.19-30.461038.94
792021.10.14 15:45buy400.011799.210.001800.37
802021.10.15 15:52close400.011769.200.001800.37-30.451021.80
1612022.07.05 02:15buy810.011810.010.001813.25
1622022.07.05 17:03close810.011779.990.001813.25-30.021005.24
492021.06.09 06:15buy250.011896.400.001903.47
502021.06.10 07:15close250.011886.580.001903.47-11.131049.67
1532022.06.14 10:00buy770.011830.310.001843.30
1542022.06.15 11:00close770.011820.620.001843.30-10.131031.93
512021.06.15 16:00buy260.011866.010.001868.96
522021.06.16 17:00close260.011858.760.001868.96-7.691041.98
1632022.07.12 13:00buy820.011735.390.001743.99
1642022.07.13 14:00close820.011729.690.001743.99-6.14999.10
732021.10.07 14:15buy370.011764.680.001764.87
762021.10.08 13:54close370.011760.360.001764.87-4.761052.17
672021.09.01 19:00buy340.011815.860.001816.89
682021.09.02 12:39close340.011816.370.001816.89-0.801054.22
692021.09.02 14:45buy350.011815.870.001815.87
702021.09.02 14:54t/p350.011815.870.001815.870.001054.22
1092021.12.22 17:15buy550.011792.860.001792.86
1102021.12.22 17:24t/p550.011792.860.001792.860.001044.70
392021.05.11 12:45buy200.011838.500.001838.54
402021.05.11 13:04t/p200.011838.540.001838.540.041052.35
1412022.03.10 12:15buy710.011995.580.001995.62
1422022.03.10 12:15t/p710.011995.620.001995.620.041066.30
192021.03.22 18:00buy100.011738.750.001742.92
202021.03.23 08:33close100.011739.260.001742.920.071036.18
352021.04.30 14:30buy180.011772.700.001773.44
362021.05.03 05:22close180.011773.210.001773.440.071049.31
592021.07.02 21:15buy300.011791.110.001794.84
602021.07.05 10:37close300.011791.620.001794.840.071051.48
772021.10.11 18:15buy390.011758.580.001760.18
782021.10.12 08:04close390.011759.090.001760.180.071052.24
912021.11.11 19:00buy460.011862.510.001865.78
922021.11.12 17:21close460.011863.020.001865.780.071032.55
1052021.12.10 06:30buy530.011779.380.001779.47
1062021.12.10 15:37t/p530.011779.470.001779.470.091043.66
1292022.02.04 09:00buy650.011807.450.001807.70
1302022.02.04 09:05t/p650.011807.700.001807.700.251057.24
1552022.06.17 15:45buy780.011850.980.001851.29
1562022.06.17 15:46t/p780.011851.290.001851.290.311032.24
972021.11.26 05:00buy490.011794.490.001794.82
982021.11.26 05:04t/p490.011794.820.001794.820.331039.16
332021.04.27 17:00buy170.011783.470.001783.89
342021.04.27 17:09t/p170.011783.890.001783.890.421049.24
132021.02.15 02:45buy70.011822.670.001830.54
142021.02.15 14:46close70.011823.180.001830.540.511023.20
412021.05.19 03:00buy210.011870.540.001874.85
422021.05.19 15:54close210.011871.050.001874.850.511052.86
532021.06.30 05:15buy270.011764.210.001765.55
542021.06.30 17:49close270.011764.720.001765.550.511042.49
742021.10.08 09:30buy380.011759.850.001762.96
752021.10.08 13:54close380.011760.360.001762.960.511056.92
1452022.04.26 06:15buy730.011905.400.001911.36
1462022.04.26 23:23close730.011905.910.001911.360.511069.40
1572022.06.21 05:00buy790.011841.920.001843.00
1582022.06.21 17:39close790.011842.430.001843.000.511032.75
1132021.12.27 07:15buy570.011810.970.001811.49
1142021.12.27 17:19t/p570.011811.490.001811.490.521045.84
1212022.01.07 16:30buy610.011792.620.001793.14
1222022.01.07 16:43t/p610.011793.140.001793.140.521051.06
1112021.12.23 10:15buy560.011807.640.001808.26
1122021.12.23 15:30t/p560.011808.260.001808.260.621045.32
1152022.01.04 11:45buy580.011806.180.001806.85
1162022.01.04 12:24t/p580.011806.850.001806.850.671046.51
252021.04.15 08:30buy130.011741.610.001742.31
262021.04.15 08:45t/p130.011742.310.001742.310.701041.75
892021.11.05 06:30buy450.011795.050.001795.76
902021.11.05 07:04t/p450.011795.760.001795.760.711032.48
1492022.05.12 03:30buy750.011855.500.001856.26
1502022.05.12 03:38t/p750.011856.260.001856.260.761039.70
872021.10.28 05:00buy440.011798.040.001798.85
882021.10.28 05:09t/p440.011798.850.001798.850.811031.77
1172022.01.05 04:00buy590.011815.740.001816.60
1182022.01.05 08:22t/p590.011816.600.001816.600.861047.37
1272022.01.31 01:30buy640.011790.370.001797.78
1282022.01.31 13:30close640.011791.330.001797.780.961056.99
1072021.12.13 10:15buy540.011787.030.001788.07
1082021.12.13 13:39t/p540.011788.070.001788.071.041044.70
1352022.02.11 14:45buy680.011830.390.001831.47
1362022.02.11 15:04t/p680.011831.470.001831.471.081061.35
112021.02.05 07:15buy60.011796.630.001797.72
122021.02.05 07:36t/p60.011797.720.001797.721.091022.69
1032021.12.07 17:45buy520.011783.270.001784.36
1042021.12.07 18:22t/p520.011784.360.001784.361.091043.57
1012021.12.03 18:30buy510.011777.270.001778.37
1022021.12.03 18:51t/p510.011778.370.001778.371.101042.48
632021.08.18 09:00buy320.011791.060.001792.18
642021.08.18 09:09t/p320.011792.180.001792.181.121053.80
1712022.08.23 11:00buy860.011738.700.001739.84
1722022.08.23 11:13t/p860.011739.840.001739.841.14975.10
1252022.01.25 08:30buy630.011842.670.001843.84
1262022.01.25 16:49t/p630.011843.840.001843.841.171056.03
612021.08.03 20:15buy310.011811.680.001813.32
622021.08.04 05:22t/p310.011813.320.001813.321.201052.68
652021.08.26 17:45buy330.011790.620.001791.84
662021.08.26 17:54t/p330.011791.840.001791.841.221055.02
1332022.02.09 12:15buy670.011827.680.001829.06
1342022.02.09 15:04t/p670.011829.060.001829.061.381060.27
832021.10.25 11:00buy420.011799.510.001800.90
842021.10.25 11:15t/p420.011800.900.001800.901.391025.44
92021.02.01 08:15buy50.011863.750.001875.61
102021.02.01 20:15close50.011865.280.001875.611.531021.60
472021.06.07 16:30buy240.011890.190.001891.73
482021.06.07 17:24t/p240.011891.730.001891.731.541060.79
1312022.02.07 11:00buy660.011813.460.001815.11
1322022.02.07 15:09t/p660.011815.110.001815.111.651058.89
272021.04.16 11:45buy140.011765.210.001767.00
282021.04.16 12:09t/p140.011767.000.001767.001.791043.54
1372022.02.18 23:00buy690.011897.400.001899.76
1382022.02.21 01:00t/p690.011899.760.001899.761.921063.28
212021.03.24 21:15buy110.011734.950.001738.29
222021.03.25 05:15t/p110.011738.290.001738.292.031038.21
452021.05.25 12:00buy230.011883.100.001885.26
462021.05.25 16:52t/p230.011885.260.001885.262.161059.25
1732022.08.24 21:00buy870.011749.940.001753.42
1742022.08.25 03:50t/p870.011753.420.001753.422.17977.27
712021.09.08 13:45buy360.011798.650.001800.84
722021.09.08 15:09t/p360.011800.840.001800.842.191056.41
992021.11.30 16:00buy500.011796.060.001798.28
1002021.11.30 16:49t/p500.011798.280.001798.282.221041.38
812021.10.19 16:00buy410.011782.030.001784.28
822021.10.19 16:01t/p410.011784.280.001784.282.251024.05
1512022.06.07 10:30buy760.011846.180.001848.53
1522022.06.07 12:20t/p760.011848.530.001848.532.351042.05
952021.11.16 03:30buy480.011865.160.001867.64
962021.11.16 04:37t/p480.011867.640.001867.642.481038.83
1592022.06.24 20:30buy800.011828.550.001831.50
1602022.06.27 01:00t/p800.011831.500.001831.502.511035.26
1432022.03.21 13:30buy720.011926.050.001928.64
1442022.03.21 15:52t/p720.011928.640.001928.642.591068.89
312021.04.26 21:45buy160.011780.270.001783.33
322021.04.27 04:01t/p160.011783.330.001783.332.621048.82
292021.04.19 09:45buy150.011780.760.001783.41
302021.04.19 10:39t/p150.011783.410.001783.412.651046.19
1672022.07.25 10:30buy840.011728.350.001731.02
1682022.07.25 12:18t/p840.011731.020.001731.022.67970.47
12020.12.03 16:15buy10.011840.090.001843.27
22020.12.04 04:52t/p10.011843.270.001843.272.741002.74
232021.03.31 12:15buy120.011685.800.001688.64
242021.03.31 13:39t/p120.011688.640.001688.642.841041.05
1392022.03.03 12:15buy700.011931.410.001934.39
1402022.03.03 12:30t/p700.011934.390.001934.392.981066.26
552021.07.01 16:45buy280.011779.550.001782.54
562021.07.01 17:03t/p280.011782.540.001782.542.991045.48
372021.05.10 09:00buy190.011839.010.001842.01
382021.05.10 15:09t/p190.011842.010.001842.013.001052.31
1192022.01.07 05:15buy600.011792.220.001795.39
1202022.01.07 15:39t/p600.011795.390.001795.393.171050.54
1692022.08.08 05:30buy850.011775.410.001778.90
1702022.08.08 10:48t/p850.011778.900.001778.903.49973.96
932021.11.15 13:15buy470.011863.840.001867.64
942021.11.15 15:09t/p470.011867.640.001867.643.801036.35
1232022.01.19 11:30buy620.011816.070.001819.87
1242022.01.19 15:17t/p620.011819.870.001819.873.801054.86
172021.03.16 15:30buy90.011733.170.001737.00
182021.03.16 16:21t/p90.011737.000.001737.003.831036.10
52020.12.08 04:00buy30.011864.270.001868.35
62020.12.08 04:54t/p30.011868.350.001868.354.081015.21
432021.05.21 12:30buy220.011877.800.001882.03
442021.05.21 15:19t/p220.011882.030.001882.034.231057.09
72020.12.31 13:45buy40.011894.880.001899.74
82020.12.31 17:31t/p40.011899.740.001899.744.861020.07
852021.10.27 18:00buy430.011792.490.001798.01
862021.10.27 21:27t/p430.011798.010.001798.015.521030.96
572021.07.02 03:30buy290.011776.660.001782.58
582021.07.02 11:22t/p290.011782.580.001782.585.921051.40
32020.12.07 07:15buy20.011839.630.001848.02
42020.12.07 16:49t/p20.011848.020.001848.028.391011.13
152021.03.02 12:30buy80.011727.470.001736.54
162021.03.02 19:36t/p80.011736.540.001736.549.071032.27
+
diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/test 1.gif b/Bkp/Used/14020502/Docs/Reports/14020427/test 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..39e88dd89f9f3d9622723144d1d04db27aedb24c GIT binary patch literal 9949 zcmch+^JbB%4d-D+QD zCiMfL{Uj(Bd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)HkPmAH~!2(;M9S8{o4kx&6iYjs#cQ`pO-m+bo}IZ=JV)lc&E*<@vP!zlX5) zvnH()rjC9T!RKcTUmT!(NlbDuiLd$G_%luBu;~ literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/14020427/test 1.htm b/Bkp/Used/14020502/Docs/Reports/14020427/test 1.htm new file mode 100644 index 0000000..afc9bc5 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/14020427/test 1.htm @@ -0,0 +1,299 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (50)
Total net profit-1.93Gross profit395.60Gross loss-397.53
Profit factor1.00Expected payoff-0.02
Absolute drawdown93.42Maximal drawdown137.71 (13.19%)Relative drawdown13.19% (137.71)
Total trades116Short positions (won %)0 (0.00%)Long positions (won %)116 (36.21%)
Profit trades (% of total)42 (36.21%)Loss trades (% of total)74 (63.79%)
Largestprofit trade24.00loss trade-15.43
Averageprofit trade9.42loss trade-5.37
Maximumconsecutive wins (profit in money)4 (59.73)consecutive losses (loss in money)9 (-44.59)
Maximalconsecutive profit (count of wins)59.73 (4)consecutive loss (count of losses)-60.13 (8)
Averageconsecutive wins2consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.01 02:45buy10.011779.481775.151786.48
22020.12.01 06:24t/p10.011786.481775.151786.487.001007.00
32020.12.02 01:30buy20.011812.601812.081813.44
42020.12.02 01:31s/l20.011812.081812.081813.44-0.521006.48
52020.12.02 08:30buy30.011814.551806.131821.36
62020.12.02 10:36t/p30.011821.361806.131821.366.811013.29
72020.12.02 17:45buy40.011825.371811.451847.89
82020.12.03 04:45buy50.011829.931825.741836.71
92020.12.03 05:39t/p50.011836.711825.741836.716.781020.07
102020.12.03 14:00buy60.011842.771833.331858.05
112020.12.03 16:49s/l60.011833.331833.331858.05-9.441010.63
122020.12.03 20:15buy70.011839.001828.731855.62
132020.12.04 04:47buy80.011841.651838.241847.17
142020.12.04 08:00s/l80.011838.241838.241847.17-3.411007.22
152020.12.04 09:00buy90.011843.921836.891849.61
162020.12.04 14:15buy100.011842.701837.901850.46
172020.12.04 15:39s/l100.011837.901837.901850.46-4.801002.42
182020.12.04 15:39s/l90.011836.891836.891849.61-7.03995.39
192020.12.04 16:15buy110.011843.501830.791853.78
202020.12.04 16:18t/p40.011847.891811.451847.8920.781016.17
212020.12.04 17:54s/l110.011830.791830.791853.78-12.711003.46
222020.12.04 21:00buy120.011835.851833.561839.55
232020.12.07 01:23s/l120.011833.561833.561839.55-2.731000.73
242020.12.07 10:34s/l70.011828.731828.731855.62-11.14989.59
252020.12.07 14:15buy130.011832.091826.761840.71
262020.12.07 16:24t/p130.011840.711826.761840.718.62998.21
272020.12.07 23:45buy140.011864.891857.241877.27
282020.12.08 04:15buy150.011866.521860.091876.92
292020.12.08 13:08s/l150.011860.091860.091876.92-6.43991.78
302020.12.08 15:00buy160.011866.011859.711876.21
312020.12.09 02:30buy170.011870.041869.251871.32
322020.12.09 02:31s/l170.011869.251869.251871.32-0.79990.99
332020.12.09 05:39s/l160.011859.711859.711876.21-6.74984.26
342020.12.09 06:07s/l140.011857.241857.241877.27-8.52975.74
352020.12.09 09:45buy180.011861.181857.811866.64
362020.12.09 12:22s/l180.011857.811857.811866.64-3.37972.37
372020.12.09 13:30buy190.011860.241855.381868.10
382020.12.09 13:37s/l190.011855.381855.381868.10-4.86967.51
392020.12.09 15:45buy200.011861.661853.511874.84
402020.12.09 16:24s/l200.011853.511853.511874.84-8.15959.36
412020.12.09 23:45buy210.011839.361831.441852.18
422020.12.10 11:06s/l210.011831.441831.441852.18-9.23950.13
432020.12.10 14:30buy220.011837.621831.881846.90
442020.12.10 16:03t/p220.011846.901831.881846.909.28959.41
452020.12.11 03:30buy230.011838.871835.731843.95
462020.12.11 05:13s/l230.011835.731835.731843.95-3.14956.27
472020.12.11 06:15buy240.011837.261834.581841.60
482020.12.11 07:54s/l240.011834.581834.581841.60-2.68953.59
492020.12.11 08:45buy250.011836.931833.061843.19
502020.12.11 09:45s/l250.011833.061833.061843.19-3.87949.72
512020.12.11 11:30buy260.011836.171830.691845.03
522020.12.11 13:01s/l260.011830.691830.691845.03-5.48944.24
532020.12.11 14:00buy270.011833.331822.081851.53
542020.12.11 15:45buy280.011838.181829.271852.60
552020.12.14 04:45buy290.011837.461833.951843.14
562020.12.14 07:24s/l290.011833.951833.951843.14-3.51940.73
572020.12.14 10:24s/l280.011829.271829.271852.60-9.35931.38
582020.12.14 12:24s/l270.011822.081822.081851.53-11.69919.70
592020.12.14 16:00buy300.011833.081820.001854.24
602020.12.14 20:45buy310.011828.351825.321833.25
612020.12.14 21:54s/l310.011825.321825.321833.25-3.03916.67
622020.12.15 01:15buy320.011829.221827.371832.22
632020.12.15 01:39s/l320.011827.371827.371832.22-1.85914.82
642020.12.15 04:00buy330.011829.931824.801838.23
652020.12.15 07:37t/p330.011838.231824.801838.238.30923.12
662020.12.15 15:37t/p300.011854.241820.001854.2420.72943.84
672020.12.16 04:30buy340.011854.801850.781861.30
682020.12.16 10:45buy350.011860.661851.831874.94
692020.12.16 10:51t/p340.011861.301850.781861.306.50950.34
702020.12.16 15:22s/l350.011851.831851.831874.94-8.83941.51
712020.12.16 19:00buy360.011854.871851.871859.73
722020.12.16 19:25s/l360.011851.871851.871859.73-3.00938.51
732020.12.16 22:00buy370.011861.681841.081878.35
742020.12.17 05:15buy380.011864.961861.721870.20
752020.12.17 07:54t/p380.011870.201861.721870.205.24943.75
762020.12.17 10:24t/p370.011878.351841.081878.3515.36959.12
772020.12.18 01:00buy390.011884.901882.851888.22
782020.12.18 02:39s/l390.011882.851882.851888.22-2.05957.07
792020.12.18 06:15buy400.011883.041878.541890.32
802020.12.18 10:09s/l400.011878.541878.541890.32-4.50952.57
812020.12.18 13:45buy410.011880.781877.751885.68
822020.12.18 14:06t/p410.011885.681877.751885.684.90957.47
832020.12.18 20:00buy420.011884.341881.781888.48
842020.12.18 20:51s/l420.011881.781881.781888.48-2.56954.91
852020.12.21 01:30buy430.011884.501879.311892.90
862020.12.21 03:09t/p430.011892.901879.311892.908.40963.31
872020.12.21 15:45buy440.011883.161868.171907.42
882020.12.21 18:45buy450.011880.781873.551892.48
892020.12.22 01:15buy460.011881.401873.811893.68
902020.12.22 03:30buy470.011881.191874.821891.49
912020.12.22 07:45s/l470.011874.821874.821891.49-6.37956.94
922020.12.22 08:09s/l460.011873.811873.811893.68-7.59949.35
932020.12.22 08:09s/l450.011873.551873.551892.48-7.67941.68
942020.12.22 08:54s/l440.011868.171868.171907.42-15.43926.26
952020.12.22 12:15buy480.011874.671868.761884.23
962020.12.22 17:49s/l480.011868.761868.761884.23-5.91920.35
972020.12.22 21:33buy490.011864.301859.941871.36
982020.12.22 22:39s/l490.011859.941859.941871.36-4.36915.99
992020.12.23 03:00buy500.011864.321861.211869.36
1002020.12.23 09:04buy510.011866.311863.131871.45
1012020.12.23 10:54t/p500.011869.361861.211869.365.04921.03
1022020.12.23 11:09t/p510.011871.451863.131871.455.14926.17
1032020.12.23 15:45buy520.011869.151856.731889.25
1042020.12.24 02:00buy530.011873.011870.881876.45
1052020.12.24 03:24t/p530.011876.451870.881876.453.44929.61
1062020.12.24 08:45buy540.011876.601874.811879.50
1072020.12.24 10:19t/p540.011879.501874.811879.502.90932.51
1082020.12.24 16:00buy550.011874.511872.621877.57
1092020.12.24 16:09s/l550.011872.621872.621877.57-1.89930.62
1102020.12.28 03:00t/p520.011889.251856.731889.2517.92948.54
1112020.12.28 12:00buy560.011885.701880.681893.82
1122020.12.28 12:24s/l560.011880.681880.681893.82-5.02943.52
1132020.12.28 15:45buy570.011885.821872.031908.14
1142020.12.28 23:45s/l570.011872.031872.031908.14-13.79929.73
1152020.12.29 02:04buy580.011877.891871.171888.77
1162020.12.29 10:00buy590.011879.951874.881888.15
1172020.12.29 12:39s/l590.011874.881874.881888.15-5.07924.66
1182020.12.29 16:00buy600.011880.191873.451891.09
1192020.12.29 17:09s/l600.011873.451873.451891.09-6.74917.92
1202020.12.29 17:45buy610.011878.721870.361892.24
1212020.12.30 01:15buy620.011878.371877.131880.37
1222020.12.30 01:34s/l620.011877.131877.131880.37-1.24916.68
1232020.12.30 13:30buy630.011880.591877.181886.11
1242020.12.30 13:54s/l630.011877.181877.181886.11-3.41913.27
1252020.12.30 19:54t/p580.011888.771871.171888.7710.44923.71
1262020.12.30 22:51t/p610.011892.241870.361892.2413.08936.80
1272020.12.31 09:30buy640.011889.801885.361896.98
1282020.12.31 15:22t/p640.011896.981885.361896.987.18943.98
1292020.12.31 15:30buy650.011897.531892.301905.99
1302020.12.31 16:54s/l650.011892.301892.301905.99-5.23938.75
1312021.01.04 01:45buy660.011914.531884.871938.53
1322021.01.04 15:31t/p660.011938.531884.871938.5324.00962.75
1332021.01.04 20:15buy670.011942.881930.611962.74
1342021.01.05 05:45buy680.011942.141936.101951.92
1352021.01.05 16:16t/p680.011951.921936.101951.929.78972.53
1362021.01.05 18:45buy690.011949.061939.151965.10
1372021.01.06 01:22buy700.011951.581947.551958.10
1382021.01.06 03:24s/l700.011947.551947.551958.10-4.03968.50
1392021.01.06 08:30buy710.011944.911943.011947.99
1402021.01.06 09:09t/p710.011947.991943.011947.993.08971.58
1412021.01.06 14:36s/l690.011939.151939.151965.10-10.35961.23
1422021.01.06 14:39s/l670.011930.611930.611962.74-13.14948.09
1432021.01.06 21:30buy720.011914.031904.591929.31
1442021.01.07 07:30buy730.011918.341916.611921.14
1452021.01.07 07:30s/l730.011916.611916.611921.14-1.73946.36
1462021.01.07 15:30buy740.011918.691913.921926.41
1472021.01.07 15:46s/l740.011913.921913.921926.41-4.77941.59
1482021.01.07 20:15buy750.011914.051908.311923.33
1492021.01.08 06:37s/l750.011908.311908.311923.33-6.18935.42
1502021.01.08 09:54s/l720.011904.591904.591929.31-11.18924.24
1512021.01.08 13:45buy760.011894.341889.171902.70
1522021.01.08 14:34s/l760.011889.171889.171902.70-5.17919.07
1532021.01.08 23:00buy770.011848.061840.881859.68
1542021.01.11 03:00s/l770.011840.881840.881859.68-7.62911.45
1552021.01.11 07:00buy780.011834.441825.711848.56
1562021.01.11 08:33t/p780.011848.561825.711848.5614.12925.57
1572021.01.11 18:00buy790.011849.261830.631879.40
1582021.01.12 04:30buy800.011848.811839.871863.27
1592021.01.12 12:09t/p800.011863.271839.871863.2714.46940.03
1602021.01.12 20:15buy810.011844.121836.421856.58
1612021.01.12 21:31t/p810.011856.581836.421856.5812.46952.49
1622021.01.13 08:15buy820.011860.211856.961865.47
1632021.01.13 10:04s/l820.011856.961856.961865.47-3.25949.24
1642021.01.13 14:45buy830.011855.181851.341861.40
1652021.01.13 15:09s/l830.011851.341851.341861.40-3.84945.40
1662021.01.13 20:00buy840.011856.151852.421862.19
1672021.01.13 22:18s/l840.011852.421852.421862.19-3.73941.67
1682021.01.14 03:07close790.011849.771830.631879.40-1.67940.00
1692021.01.14 08:00buy850.011844.821837.821856.14
1702021.01.14 09:37s/l850.011837.821837.821856.14-7.00933.00
1712021.01.14 14:04buy860.011844.011837.041855.29
1722021.01.14 19:53t/p860.011855.291837.041855.2911.28944.28
1732021.01.14 23:04buy870.011848.091843.571855.41
1742021.01.15 02:15buy880.011848.991844.971855.49
1752021.01.15 10:45buy890.011852.821848.581859.68
1762021.01.15 11:39t/p870.011855.411843.571855.416.88951.17
1772021.01.15 11:39t/p880.011855.491844.971855.496.50957.67
1782021.01.15 13:52s/l890.011848.581848.581859.68-4.24953.43
1792021.01.15 21:45buy900.011829.491826.991833.53
1802021.01.15 22:07s/l900.011826.991826.991833.53-2.50950.93
1812021.01.18 04:45buy910.011829.611817.481849.23
1822021.01.18 13:15buy920.011837.471828.661851.73
1832021.01.18 15:00buy930.011835.971828.531848.01
1842021.01.19 08:30buy940.011839.951835.701846.83
1852021.01.19 14:55s/l940.011835.701835.701846.83-4.25946.68
1862021.01.19 18:15buy950.011842.161831.741859.02
1872021.01.20 04:08t/p930.011848.011828.531848.0111.17957.85
1882021.01.20 04:49t/p910.011849.231817.481849.2318.75976.60
1892021.01.20 08:06t/p920.011851.731828.661851.7313.39989.99
1902021.01.20 16:22t/p950.011859.021831.741859.0216.421006.41
1912021.01.20 16:30buy960.011860.281826.301887.77
1922021.01.21 05:00buy970.011872.001867.191879.78
1932021.01.21 09:39s/l970.011867.191867.191879.78-4.811001.60
1942021.01.21 13:00buy980.011870.471866.771876.45
1952021.01.21 14:54s/l980.011866.771866.771876.45-3.70997.90
1962021.01.21 19:39buy990.011864.711863.381866.87
1972021.01.21 20:52t/p990.011866.871863.381866.872.161000.06
1982021.01.22 11:15buy1000.011863.031858.371870.57
1992021.01.22 11:52s/l1000.011858.371858.371870.57-4.66995.40
2002021.01.22 17:00buy1010.011850.661834.621863.64
2012021.01.22 21:30close1010.011856.441834.621863.645.781001.18
2022021.01.22 21:30close960.011856.441826.301887.77-5.58995.60
2032021.01.25 02:45buy1020.011860.211854.601869.29
2042021.01.25 03:24s/l1020.011854.601854.601869.29-5.61989.99
2052021.01.25 07:15buy1030.011855.681853.281859.56
2062021.01.25 07:37s/l1030.011853.281853.281859.56-2.40987.59
2072021.01.25 11:21buy1040.011853.481851.441856.78
2082021.01.25 12:34t/p1040.011856.781851.441856.783.30990.89
2092021.01.25 20:30buy1050.011856.711854.551860.21
2102021.01.25 21:24s/l1050.011854.551854.551860.21-2.16988.73
2112021.01.26 01:30buy1060.011857.191854.101862.19
2122021.01.26 02:07s/l1060.011854.101854.101862.19-3.09985.64
2132021.01.26 13:19buy1070.011851.601848.211857.08
2142021.01.26 15:24t/p1070.011857.081848.211857.085.48991.12
2152021.01.26 22:45buy1080.011853.271849.031860.13
2162021.01.27 01:16s/l1080.011849.031849.031860.13-4.68986.44
2172021.01.27 02:00buy1090.011851.631848.691856.39
2182021.01.27 02:47s/l1090.011848.691848.691856.39-2.94983.50
2192021.01.27 07:15buy1100.011847.881845.011852.52
2202021.01.27 10:01t/p1100.011852.521845.011852.524.64988.14
2212021.01.27 17:15buy1110.011843.871828.841856.03
2222021.01.28 06:45buy1120.011838.361836.231841.80
2232021.01.28 07:53s/l1120.011836.231836.231841.80-2.13986.01
2242021.01.28 08:45buy1130.011838.361834.801844.12
2252021.01.28 09:09s/l1130.011834.801834.801844.12-3.56982.45
2262021.01.28 15:52t/p1110.011856.031828.841856.0310.85993.31
2272021.01.28 22:45buy1140.011843.301840.821847.32
2282021.01.28 23:01s/l1140.011840.821840.821847.32-2.48990.83
2292021.01.29 03:37buy1150.011843.901840.011850.20
2302021.01.29 06:15buy1160.011841.821841.241842.76
2312021.01.29 06:52t/p1160.011842.761841.241842.760.94991.77
2322021.01.29 08:54t/p1150.011850.201840.011850.206.30998.07
+
diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 1.gif b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..7a108b956486667f6d4f31e5f26f2db3e77a395f GIT binary patch literal 7239 zcmch3^;^^5`~T?C*nmhW3PTVC1tusWDpCe2DS{{+3P_CZF<^{l8$D`lqZ!>Xx{(;& zU4k_G@Opp$hwt+`&+EFcN1gke`=I2) zi5C#j6pSDPE`ADyi~wIiMAHl9MG2sgN5Fu5z{LWO{68IK7Xkhs0O%lIkl+#W|AYX5 zDe=O3VFq7R|K(9k0e}mdXqpeMMo<<^!50|9)bs)a|Hlwbs{w!xFu0m>!2$Bg|I0Pa z2beBUE=-6EGXH|S=#hc|gD=uAY(%0d`JyvZ1o2`^1ei#^D2NF1Me0Rz^@Wqz0RVRp z!3e~K=;D0;HFP2RZ)f6#icGm^*z|$}jLfWTYz_`j$j!?yC@d;2A(obvS5#J2 z*VNY4H#9aiw~$)f+B-VCx_f%@R0D%Ue}+d!$H?OolT*_(vvczci%ZKZt842Un_JsE zyMOog{~c`SQzcWMo+q6F&eyIYrWG~mF7b{>BW9E|SOuPTUX7SlR=*~BPCkHPp8N1W zgMH+ToL31FdY=>>AGx3!B4%7O$QhMM`YeN48E-4fdaK3tfUZQk_``eE*Y|{Cilsl) zCE!v7xfKCgR5WS1X<+Z^ULRT}+FxOhKlf47`?afr^@DMGZ|o>k*eJu2~5;VwrE>zgy2t|8C(nf~Ia8LnYZdJwjoTKGlITjWALtyI&ndjM8(D z02E_|$GvIj<(BjPqTjwke)074UIeh;Rv-4GVm|EkWq&_=BNqMa=h7Ey#bvG$U6*5y zI<#%Y-MAEmQ;BS<2{A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Oi}GkY>s^Yb36HQ&ME`8wtL<`SY3v zt>Cp^Di5z1vIl+sF31)k+fc@z5@2|B?s8*UtVnF%SDpJ2H>ZFk+4f&>M?B`%7L+8v w`YYUh9m7Wfwkk5&BmD2D3$O>bDue7JLaozp^D(xmsM<$H + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0031; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=1.5; xMaximumCandlesPerTrade=144; xShortCycleLength=14; xMediumCycleLength=20; xLongCycleLength=50; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
Bars in test61155Ticks modelled69617088Modelling quality40.15%
Mismatched charts errors30
Initial deposit1000.00SpreadCurrent (57)
Total net profit55.05Gross profit55.05Gross loss-0.00
Profit factorExpected payoff4.23
Absolute drawdown2.24Maximal drawdown23.46 (2.25%)Relative drawdown2.25% (23.46)
Total trades13Short positions (won %)0 (0.00%)Long positions (won %)13 (100.00%)
Profit trades (% of total)13 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade5.42loss trade-0.00
Averageprofit trade4.23loss trade-0.00
Maximumconsecutive wins (profit in money)13 (55.05)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)55.05 (13)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins13consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12021.01.06 02:00buy10.011950.770.001954.67
22021.01.06 03:09t/p10.011954.670.001954.673.901003.90
32021.04.08 14:00buy20.011746.300.001751.37
42021.04.08 16:07t/p20.011751.370.001751.375.071008.97
52021.04.21 04:30buy30.011779.880.001784.28
62021.04.21 06:09t/p30.011784.280.001784.284.401013.37
72021.07.14 12:00buy40.011814.480.001818.44
82021.07.14 15:04t/p40.011818.440.001818.443.961017.33
92021.10.01 23:45buy50.011760.130.001763.70
102021.10.04 01:22t/p50.011763.700.001763.703.131020.46
112021.10.21 09:45buy60.011786.730.001792.19
122021.10.22 09:37t/p60.011792.190.001792.195.021025.49
132021.12.21 14:15buy70.011797.690.001799.57
142021.12.21 15:00t/p70.011799.570.001799.571.881027.37
152022.07.29 21:30buy80.011766.250.001771.53
162022.08.01 12:55t/p80.011771.530.001771.534.841032.21
172022.09.05 04:45buy90.011711.750.001717.06
182022.09.06 03:23t/p90.011717.060.001717.064.871037.09
192022.09.21 13:00buy100.011673.720.001678.33
202022.09.21 21:33t/p100.011678.330.001678.334.611041.70
212022.11.15 04:45buy110.011771.860.001777.28
222022.11.15 09:31t/p110.011777.280.001777.285.421047.12
232022.11.30 10:00buy120.011755.480.001758.74
242022.11.30 10:52t/p120.011758.740.001758.743.261050.38
252023.02.09 13:15buy130.011884.520.001889.19
262023.02.09 15:58t/p130.011889.190.001889.194.671055.05
+
diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.gif b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..93e3b74079c182495d151af3f699715614a9e146 GIT binary patch literal 7247 zcmch5_dDC&|9|YDs@p0xYVTHW#HiA{M(J|jwH0mcT~#6_c4EZdM2r#yvG=Az?3oaI zZ(21&KJNGTfB3$x*Xz2T*JGXMIp>FSu9v3v3k5|>IT{>b6#$@6C;$MUudk0%jR!^l zsLY-`Y(@S4FFux)z(;0Q#5788gzw4TU%dYp#PX^>m~pI4+1q&t~da8 z`hU6BSb+5k<;oO&MPjeWs~#!QAkbC%m94tkdits}>*(sMA)`Un(^o}x^z>EgRdUmn zvl(O06Y`Tf_>mFT~btFKhkl&glVuQ&kK8Uz4c&HMlVBXPC*fdBRaz(9cl z0s@1ALqcKju<(dTL{xN4Y+QUoVp4KSYFc^*G82`Ros;_`FCSe{ScEAqDaDqRS5#J2 z*VNY4H#9aix3spkcXW3B?8f!<;`{ms28S?IqhsR}lLX?_G-+mbZhm2LX?bOJZGB^N zYkOyRZ~x%e@54Vw$NN~SOltBa@&a(VbtigW?G@ck9#VYtg1R0HpK9Non8oM1cV#c9 zkHd1F`SU&v`-eStSu0fVEiyhic10&#(z1DsJua{Ny?o9Fsiz|UwLXV5U6owrySF-; z!h#8va_?Hxi%|TWY5;vIn(UHn5OjXXpO%T%E%LAT!_@SFy*eNhc#*NT3xx_DnO0p? zKu;ePX7)!mZ*na)1bU+tJy5I9 zMyVUD-m<#yQ#ouJv}gvDEydbIZ*5@U^-g?Z)G7mQ+zuZu2!NYy)5+bFB3 zqDvP8T-O3RQ#}gcG6g=w!CcUE>%4p}dWNvz7z-FY1b!$#Zz5)j=A;wHT0s2(ayJaW zNm>|?c=O9Vv;CLG*&!X_@|Qv+LvUU&Iy=Zdbp!R3 zw-@~_4V+|PoPa>hq(#vK3iFCyR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6P{vJO`TYWd7j5@m!BgD+b>=gZmp1>LSaSzQFMzJOSWi7&p_cy^oWx6vf^RJFT_ z_{G_YOx3wn%3hQG3&>70jZ$N2{n{%?cH8}Y0ya@#%mkmno)#gFb2vKRYeOB@%HsL( zB<(1MhmBZKmBe(nFmVRGGR@V0Ym4z!FdONPYYKq<7|PP$rxD!^o^^*_;Rup@*FDzu zXH4-zI|8G(*p!|O#6KrNott8vvg$qv5amQH#a%sSGDv1QBYFEyM-txx>8qyVNf|uj z`C(?eBUZ1)Y6%{hQ&i3x6f;Fa#J8YFq;bO;cqH__bL-`3FkGc}VwgQ`=DUw1w8g*xS>_E#G;d2Ba}9w5kjaYOVC zqLnHw1vV|dW|6iHcg%e^W{X^O8X8cxKF3)O5shmB$u1O|?c>WIHd;OqGFAioPyQqw^u@Xdb6^Rj$z!7pus}QSDmb>;M1& literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.htm b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.htm new file mode 100644 index 0000000..62ee295 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 2.htm @@ -0,0 +1,84 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.4; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
Bars in test61155Ticks modelled69617088Modelling quality40.15%
Mismatched charts errors30
Initial deposit1000.00SpreadCurrent (59)
Total net profit1812.58Gross profit1812.58Gross loss-0.00
Profit factorExpected payoff226.57
Absolute drawdown290.70Maximal drawdown420.90 (37.24%)Relative drawdown37.24% (420.90)
Total trades8Short positions (won %)0 (0.00%)Long positions (won %)8 (100.00%)
Profit trades (% of total)8 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade270.90loss trade-0.00
Averageprofit trade226.57loss trade-0.00
Maximumconsecutive wins (profit in money)8 (1812.58)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)1812.58 (8)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins8consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12021.01.06 02:00buy10.301950.790.001957.29
22021.01.06 11:54t/p10.301957.290.001957.29195.001195.00
32021.04.08 14:00buy20.301746.320.001754.77
42021.04.08 16:36t/p20.301754.770.001754.77253.501448.50
52021.04.21 04:30buy30.301779.900.001787.23
62021.04.21 09:52t/p30.301787.230.001787.23219.901668.40
72021.07.14 12:00buy40.301814.500.001821.10
82021.07.14 15:06t/p40.301821.100.001821.10198.001866.40
92021.10.21 09:45buy50.301786.750.001795.85
102021.10.22 15:19t/p50.301795.850.001795.85259.942126.34
112022.09.05 04:45buy60.301711.770.001720.62
122022.09.06 03:32t/p60.301720.620.001720.62252.442378.78
132022.11.15 04:45buy70.301771.880.001780.91
142022.11.15 09:46t/p70.301780.910.001780.91270.902649.68
152022.11.30 10:00buy80.301755.500.001760.93
162022.11.30 11:08t/p80.301760.930.001760.93162.902812.58
+
diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.gif b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.gif new file mode 100644 index 0000000000000000000000000000000000000000..e7e420b10d0ffb15a501e5da59d7ef84ae6a8a5b GIT binary patch literal 7740 zcmch6^;28V+jf8g!D&me;w>#MH6Tz*4K37LyhVxxm*TF05J+*CU`cQb?hXm=A-KDH zn}^T${U6>lduHyrZ13Ik!`YctQc;waF?d4O1y}(9h(sa)0Kj6gL`*LTet{g+2H0RXOPj7c%59!^{~0bOHo6O(HU^dEyUsRsahL7;l#H3ulh|1a017+|tY zyf(qF$>MABxBk*QwXZ_18{JF96hw0m0$d zqU-hj*U+`-znL-DDm?MJVUuePP;3GMfUej5|NjxW-hIG--vU5M^a1$!2LuKMLqbBK zVX*KB_@BtA=$P2J_=LoyU6yFSf)P5k* zbUtm$<-Sq87~^}uBu(^p;&lhzu3WU${O zvDnbcl^GOmJ2}ppike1yIf8bk2_B;DCT%1E2KeBhd%3#6C%p8$v{!Th3>ZM-+VKeJY9MRO!Yu>!8_f47BeiKB@<_d!*ZQMPFSzt0QT%im`Oz;N%~xIYQa*?=Fz#|4(yq!+fUdZY?#Y!g~87mQ6w z)-?~}(w|>RAV~d9+MI)|e`N>Ya4FwS`%Empyer(I_}Ex52CD z>k3$obx_+<;MNwx&adsvmr-f$RQWUfgWNvx?JI+KBZ?Qa3zgq0TFGzk~9c{6F~PA5jyG1h=&SNeB&9m zmmCbpP%)zXX`U-dSD~xxfCCKw3w#&{*6Cb%3jE^m>txD2kgiF~!sfXYsj++06F)tE zIVm!m%&*fkzRNI#y~LyRBwkBFoNa5U6l6+E$AR1#97nWr3iOl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-9oHZOUS9{1ayryW0_f$M08MqNVfH;jX;ZsA>}0k+l#~;-3f+DX z2~x+uJ6MN)c_OXjz$*rI$3aDInB$PDIL>ic;|1OC5#p!!>c2<7{eb-*)3(9=9@qb& z4y5Ef+9YW>p>BCeO|)(U^<7|E9i~}*{RMdrg$c~I(e2xTQ zUQ}F=#J8>6<2ekAoC zTt4fia1AGMM6VZgGAy(70w>d3>b7Z`ms+;pm{bbd#yox@*CM$Ddt3Fj6t`Qqi9^Y1_id zG}HA--mkS#hx_@nM3V!_HD7)4u?@%rWc0p5zK*oA@uho04*cvw!%h7vNbx=!xg?O9 zaqI(g(Biz%E##XJk9R(xC10ATwRU}JA4vUtWO6xEkLh9Bn505KEFbIT$T6+kZjKT;i!9+cje zRx{!c4(@v2C*oxrz;(}xwL|S>FTz~}NU{p)d@=LN@=w@3GLD}elQ8uk;{r=URZ_hr z2I9=oU--FE!PQ^sBVv)*$yFB=mgHp9XOO7N$0YklX=?Nq6V!eAnXIpjQ6i}W)-ipG zHn>+^-_WlA%R~Oibv0`=UA)7^q5bUAA^H}uESK|+y ztNN7j;|Vig3qqB1zAE{SV6@>#@dBX?(mFJJSM>euGg8i%R&F&7GxTLbBB-4;a-6n@ zMqzX|%bJjywrcu`oA1{)u#D{M;YR>xDqOndN0zCH6DWz?-)u{zyEJ2}PIvO(irT3u z;k&_p72G2t0-8zFizhTB^>5$Wz1-|mDrT-4s)(~Ipn0+4WL>u;TIAXfojF1~*Kb)B kxzEzfp7l6492FFK?m}m;Hk=!;wu`)pG(SCWkOE}?4?}(SG5`Po literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.htm b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.htm new file mode 100644 index 0000000..3d0b7dc --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 3 - Short.htm @@ -0,0 +1,130 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
Bars in test61155Ticks modelled69617088Modelling quality40.15%
Mismatched charts errors30
Initial deposit1000.00SpreadCurrent (50)
Total net profit74.65Gross profit120.83Gross loss-46.18
Profit factor2.62Expected payoff2.41
Absolute drawdown14.66Maximal drawdown31.19 (3.07%)Relative drawdown3.07% (31.19)
Total trades31Short positions (won %)31 (90.32%)Long positions (won %)0 (0.00%)
Profit trades (% of total)28 (90.32%)Loss trades (% of total)3 (9.68%)
Largestprofit trade8.52loss trade-29.37
Averageprofit trade4.32loss trade-15.39
Maximumconsecutive wins (profit in money)14 (65.09)consecutive losses (loss in money)1 (-29.37)
Maximalconsecutive profit (count of wins)65.09 (14)consecutive loss (count of losses)-29.37 (1)
Averageconsecutive wins9consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.18 02:30sell10.011884.040.001881.04
22020.12.18 03:09t/p10.011881.040.001881.043.001003.00
32021.01.21 02:45sell20.011869.150.001862.63
42021.01.21 15:54t/p20.011862.630.001862.636.521009.52
52021.03.09 22:15sell30.011716.740.001710.17
62021.03.10 08:09t/p30.011710.170.001710.176.781016.30
72021.04.01 03:45sell40.011706.320.001699.80
82021.04.06 07:54close40.011736.320.001699.80-29.37986.93
92021.04.15 21:15sell50.011767.210.001764.56
102021.04.15 22:39t/p50.011764.560.001764.562.65989.58
112021.06.03 23:15sell60.011870.990.001865.94
122021.06.04 03:45sell70.011869.320.001862.92
132021.06.04 04:49t/p60.011865.940.001865.945.26994.84
142021.06.04 04:52t/p70.011862.920.001862.926.401001.24
152021.06.17 08:00sell80.011821.330.001815.18
162021.06.17 09:07t/p80.011815.180.001815.186.151007.39
172021.06.18 08:45sell90.011784.490.001778.54
182021.06.18 15:24t/p90.011778.540.001778.545.951013.34
192021.11.23 05:30sell100.011808.910.001803.19
202021.11.23 09:03t/p100.011803.190.001803.195.721019.06
212021.12.15 04:45sell110.011771.980.001769.33
222021.12.15 07:24t/p110.011769.330.001769.332.651021.71
232022.02.14 13:30sell120.011855.860.001851.26
242022.02.15 13:54t/p120.011851.260.001851.264.811026.52
252022.03.14 08:45sell130.011975.330.001973.43
262022.03.14 09:24t/p130.011973.430.001973.431.901028.42
272022.03.16 05:15sell140.011919.680.001911.16
282022.03.16 16:09t/p140.011911.160.001911.168.521036.94
292022.05.17 05:00sell150.011826.120.001823.95
302022.05.17 06:08t/p150.011823.950.001823.952.171039.11
312022.07.06 01:05sell160.011766.830.001763.96
322022.07.06 08:38t/p160.011763.960.001763.962.871041.98
332022.07.07 01:45sell170.011738.940.001734.79
342022.07.07 05:30sell180.011739.930.001734.46
352022.07.08 10:43t/p170.011734.790.001734.794.361046.34
362022.07.08 10:43t/p180.011734.460.001734.465.681052.02
372022.08.08 22:30sell190.011787.280.001782.58
382022.08.11 05:00close190.011788.480.001782.58-0.151051.87
392022.10.10 23:00sell200.011668.780.001663.88
402022.10.11 05:13t/p200.011663.880.001663.885.111056.98
412022.11.09 07:30sell210.011708.410.001706.31
422022.11.09 12:07t/p210.011706.310.001706.312.101059.08
432022.11.15 15:00sell220.011775.140.001769.87
442022.11.15 16:48t/p220.011769.870.001769.875.271064.35
452023.01.09 07:30sell230.011876.700.001874.15
462023.01.09 09:50t/p230.011874.150.001874.152.551066.90
472023.02.02 09:00sell240.011951.910.001946.44
482023.02.02 15:52t/p240.011946.440.001946.445.471072.37
492023.02.03 05:45sell250.011916.370.001914.42
502023.02.03 06:23t/p250.011914.420.001914.421.951074.32
512023.03.31 07:15sell260.011981.510.001980.14
522023.03.31 08:07t/p260.011980.140.001980.141.371075.69
532023.04.04 02:00sell270.011983.600.001979.28
542023.04.04 04:50t/p270.011979.280.001979.284.321080.01
552023.04.05 01:45sell280.012020.810.002019.39
562023.04.05 04:15sell290.012020.920.002016.45
572023.04.05 17:11t/p280.012019.390.002019.391.421081.43
582023.04.05 17:32t/p290.012016.450.002016.454.471085.90
592023.05.02 21:45sell300.012014.740.002009.54
602023.05.03 15:15t/p300.012009.540.002009.545.411091.31
612023.05.08 01:45sell310.012014.730.002007.43
622023.05.10 07:15close310.012031.810.002007.43-16.661074.65
+
diff --git a/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 4 - Short Long 0.3 0.4.gif b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 4 - Short Long 0.3 0.4.gif new file mode 100644 index 0000000000000000000000000000000000000000..0cd854187f05de99cb7e3ed4730d4a4ed3d79b3c GIT binary patch literal 7697 zcmch3_d6Tj`*%=;Sk+QRTccXL)m9N(t5#7RYPDKzV{f%f>_m*%V#X-3W5wQk?;=8N zVz1id>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4.htm new file mode 100644 index 0000000..cc169a5 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/X/StrategyTester 4 - Short Long 0.3 0.4.htm @@ -0,0 +1,162 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.4; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
Bars in test61155Ticks modelled69617088Modelling quality40.15%
Mismatched charts errors30
Initial deposit1000.00SpreadCurrent (56)
Total net profit4615.79Gross profit6210.29Gross loss-1594.49
Profit factor3.89Expected payoff98.21
Absolute drawdown199.80Maximal drawdown759.90 (18.60%)Relative drawdown34.47% (420.90)
Total trades47Short positions (won %)33 (87.88%)Long positions (won %)14 (100.00%)
Profit trades (% of total)43 (91.49%)Loss trades (% of total)4 (8.51%)
Largestprofit trade270.90loss trade-400.20
Averageprofit trade144.43loss trade-398.62
Maximumconsecutive wins (profit in money)18 (2440.63)consecutive losses (loss in money)1 (-400.20)
Maximalconsecutive profit (count of wins)2440.63 (18)consecutive loss (count of losses)-400.20 (1)
Averageconsecutive wins11consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.18 02:30sell10.301884.040.001881.04
22020.12.18 03:10t/p10.301881.040.001881.0490.001090.00
32021.01.06 02:00buy20.301950.760.001957.26
42021.01.06 11:54t/p20.301957.260.001957.26195.001285.00
52021.01.21 02:45sell30.301869.150.001862.63
62021.01.21 15:54t/p30.301862.630.001862.63195.601480.60
72021.03.09 22:15sell40.301716.740.001710.17
82021.03.10 08:09t/p40.301710.170.001710.17203.411684.01
92021.04.01 03:45sell50.301706.320.001699.80
102021.04.01 10:24close50.301719.660.001699.80-400.201283.81
112021.04.08 14:00buy60.301746.290.001754.74
122021.04.08 16:36t/p60.301754.740.001754.74253.501537.31
132021.04.15 21:15sell70.301767.210.001764.56
142021.04.15 22:39t/p70.301764.560.001764.5679.501616.81
152021.04.21 04:30buy80.301779.870.001787.20
162021.04.21 09:51t/p80.301787.200.001787.20219.901836.71
172021.05.04 23:15sell90.301779.150.001777.65
182021.05.05 03:09t/p90.301777.650.001777.6551.311888.01
192021.05.07 13:45sell100.301820.100.001817.98
202021.05.07 15:07t/p100.301817.980.001817.9863.601951.61
212021.06.03 23:15sell110.301870.990.001865.94
222021.06.04 04:49t/p110.301865.940.001865.94157.812109.42
232021.06.17 08:00sell120.301821.330.001815.18
242021.06.17 09:07t/p120.301815.180.001815.18184.502293.92
252021.06.18 08:45sell130.301784.490.001778.54
262021.06.18 15:24t/p130.301778.540.001778.54178.502472.42
272021.07.14 12:00buy140.301814.470.001821.07
282021.07.14 15:05t/p140.301821.070.001821.07198.002670.42
292021.08.26 13:45buy150.301787.220.001794.00
302021.08.26 17:31t/p150.301794.000.001794.00203.402873.82
312021.10.21 09:45buy160.301786.720.001795.82
322021.10.22 15:19t/p160.301795.820.001795.82259.943133.76
332021.11.23 05:30sell170.301808.910.001803.19
342021.11.23 10:49t/p170.301803.190.001803.19171.603305.36
352021.12.15 04:45sell180.301771.980.001769.33
362021.12.15 07:24t/p180.301769.330.001769.3379.503384.86
372022.02.09 11:30buy190.301827.840.001831.02
382022.02.09 15:07t/p190.301831.020.001831.0295.403480.26
392022.02.14 13:30sell200.301855.860.001851.26
402022.02.14 17:18close200.301869.200.001851.26-400.203080.06
412022.03.14 08:45sell210.301975.330.001973.43
422022.03.14 09:24t/p210.301973.430.001973.4357.003137.06
432022.03.16 05:15sell220.301919.680.001911.16
442022.03.16 16:09t/p220.301911.160.001911.16255.603392.66
452022.05.17 05:00sell230.301826.120.001823.95
462022.05.17 06:08t/p230.301823.950.001823.9565.103457.76
472022.06.24 05:00sell240.301823.760.001820.54
482022.06.24 16:00t/p240.301820.540.001820.5496.603554.36
492022.07.06 01:05sell250.301766.830.001763.96
502022.07.06 08:38t/p250.301763.960.001763.9686.103640.46
512022.07.07 01:45sell260.301738.940.001734.79
522022.07.08 10:43t/p260.301734.790.001734.79130.813771.26
532022.08.01 01:30buy270.301764.510.001771.11
542022.08.01 12:53t/p270.301771.110.001771.11198.003969.26
552022.08.08 22:30sell280.301787.280.001782.58
562022.08.09 16:33close280.301800.620.001782.58-393.893575.37
572022.08.22 14:15buy290.301735.850.001741.55
582022.08.23 11:20t/p290.301741.550.001741.55157.943733.31
592022.09.05 04:45buy300.301711.740.001720.59
602022.09.06 03:32t/p300.301720.590.001720.59252.443985.74
612022.10.10 23:00sell310.301668.780.001663.88
622022.10.11 05:13t/p310.301663.880.001663.88153.314139.05
632022.11.09 07:30sell320.301708.410.001706.31
642022.11.09 12:07t/p320.301706.310.001706.3163.004202.05
652022.11.15 04:45buy330.301771.850.001780.88
662022.11.15 09:46t/p330.301780.880.001780.88270.904472.95
672022.11.15 15:00sell340.301775.140.001769.87
682022.11.15 16:48t/p340.301769.870.001769.87158.104631.05
692022.11.21 23:45buy350.301738.480.001741.76
702022.11.22 03:03t/p350.301741.760.001741.7685.344716.39
712022.11.30 10:00buy360.301755.470.001760.90
722022.11.30 11:08t/p360.301760.900.001760.90162.904879.29
732023.01.09 07:30sell370.301876.700.001874.15
742023.01.09 09:51t/p370.301874.150.001874.1576.504955.79
752023.01.20 09:00buy380.301926.900.001935.08
762023.01.20 10:07t/p380.301935.080.001935.08245.405201.19
772023.02.02 09:00sell390.301951.910.001946.44
782023.02.02 15:52t/p390.301946.440.001946.44164.105365.29
792023.02.03 05:45sell400.301916.370.001914.42
802023.02.03 06:23t/p400.301914.420.001914.4258.505423.79
812023.03.21 07:45sell410.301981.970.001978.67
822023.03.21 08:22t/p410.301978.670.001978.6799.005522.79
832023.03.31 07:15sell420.301981.510.001980.14
842023.03.31 08:08t/p420.301980.140.001980.1441.105563.89
852023.04.04 02:00sell430.301983.600.001979.28
862023.04.04 04:54t/p430.301979.280.001979.28129.605693.49
872023.04.05 01:45sell440.302020.810.002019.39
882023.04.05 17:11t/p440.302019.390.002019.3942.605736.09
892023.04.14 07:30sell450.302044.780.002040.86
902023.04.14 08:38t/p450.302040.860.002040.86117.605853.69
912023.05.02 21:45sell460.302014.740.002009.54
922023.05.03 15:15t/p460.302009.540.002009.54162.316015.99
932023.05.08 01:45sell470.302014.730.002007.43
942023.05.08 18:29close470.302028.070.002007.43-400.205615.79
+
diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 1.gif b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf203aec1cf35642fdbd9208edd6257d3c226628 GIT binary patch literal 8424 zcmch6^;cBy_x&J9gS4aq(y1slNQePa0)jLm;z)OQGc(lCLnAp1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pVwoTtlQ(I5Jx5dl!1Pcm0>khH2BUG?Bg-GXC>crp}7T)BS8Q4A3E7-%YAb=mcH@dQfn z=BLb~)e#`*Lta+u=KSiEZV8WIOiAO0=6*6R=TTwq(~U15Wc4Wm?tdygN+(vj)|#rn zeTC{`-c@o!x1~_H7*nUulfO=!0;?t9s{5GgIdOkN4gYgBE?NFudD)x0JyJquVr>}2 zKG(Ndoy6O2tw1dfh&X%c^w_63wWDErwrA4GN!5mAbY@~$*O3=kLhSrFwFuMFRX9`v zVx07xEZTI0L>unTwn^0^XRKST40f=;z3G-^svTR1e%Y!%w^%IH^{4*w@+kBfV2X<1 zRS_GT{jBcwAjKm9T?Ie`?f80K)80InVE!*&JhSG(m%3OnHK+*p4VA8_$DoCbgX`Px zEx()H%YA$yM6xMc(V&aGbLTPD(KM_b7Yw6MyhbJ zDd$tFK?NCuvgq4=E5GacKP~62kM54b{chHUTQ5hW?@o*SZujk4ua~|; + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
Bars in test62709Ticks modelled71719330Modelling qualityn/a
Mismatched charts errors777
Initial deposit1000.00SpreadCurrent (60)
Total net profit64.36Gross profit198.76Gross loss-134.40
Profit factor1.48Expected payoff1.11
Absolute drawdown9.15Maximal drawdown38.61 (3.57%)Relative drawdown3.57% (38.61)
Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
Largestprofit trade14.58loss trade-15.38
Averageprofit trade5.85loss trade-5.60
Maximumconsecutive wins (profit in money)4 (23.01)consecutive losses (loss in money)3 (-26.09)
Maximalconsecutive profit (count of wins)23.01 (4)consecutive loss (count of losses)-26.09 (3)
Averageconsecutive wins2consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.03 23:30buy10.011841.440.001845.90
22020.12.04 15:31t/p10.011845.900.001845.904.021004.02
32020.12.08 18:30buy20.011870.350.001886.13
42020.12.09 05:19close20.011864.070.001886.13-6.72997.31
52020.12.30 03:45buy30.011883.290.001893.75
62020.12.30 10:00close30.011878.490.001893.75-4.80992.51
72020.12.30 18:00buy40.011885.860.001895.62
82020.12.31 02:15t/p40.011895.620.001895.628.451000.96
92021.01.05 11:30buy50.011944.710.001954.49
102021.01.06 03:09t/p50.011954.490.001954.499.341010.31
112021.04.05 17:30buy60.011729.420.001742.62
122021.04.05 22:00close60.011725.680.001742.62-3.741006.57
132021.04.19 06:15buy70.011778.720.001785.24
142021.04.19 07:15close70.011776.750.001785.24-1.971004.60
152021.04.26 21:00buy80.011780.010.001781.77
162021.04.26 23:39t/p80.011781.770.001781.771.761006.36
172021.05.18 23:45buy90.011870.210.001872.99
182021.05.19 05:00close90.011867.630.001872.99-3.021003.34
192021.05.20 08:15buy100.011876.090.001877.07
202021.05.20 08:30t/p100.011877.070.001877.070.981004.32
212021.05.21 11:30buy110.011876.530.001882.65
222021.05.21 15:21t/p110.011882.650.001882.656.121010.44
232021.05.24 19:15buy120.011884.010.001887.27
242021.05.25 01:15close120.011880.910.001887.27-3.541006.91
252021.05.25 10:45buy130.011884.160.001898.74
262021.05.25 21:06t/p130.011898.740.001898.7414.581021.49
272021.06.28 20:30buy140.011780.510.001785.35
282021.06.28 21:15close140.011778.020.001785.35-2.491019.00
292021.07.06 04:15buy150.011792.940.001796.10
302021.07.06 04:53t/p150.011796.100.001796.103.161022.16
312021.07.09 17:45buy160.011806.390.001814.91
322021.07.12 07:16close160.011801.870.001814.91-4.961017.20
332021.07.12 19:30buy170.011805.330.001808.45
342021.07.13 04:34t/p170.011808.450.001808.452.681019.89
352021.08.12 23:00buy180.011753.790.001757.21
362021.08.13 09:09t/p180.011757.210.001757.212.981022.87
372021.09.01 22:30buy190.011815.330.001820.69
382021.09.02 02:45close190.011813.220.001820.69-3.421019.45
392021.09.03 05:15buy200.011813.490.001819.35
402021.09.03 15:34t/p200.011819.350.001819.355.861025.31
412021.09.29 06:00buy210.011740.530.001751.43
422021.09.29 16:24close210.011736.210.001751.43-4.321020.99
432021.11.16 04:45buy220.011867.860.001877.40
442021.11.16 09:45close220.011863.300.001877.40-4.561016.43
452021.12.07 04:30buy230.011781.010.001785.23
462021.12.07 05:45close230.011778.500.001785.23-2.511013.92
472021.12.07 20:30buy240.011784.430.001788.51
482021.12.08 04:07t/p240.011788.510.001788.513.641017.57
492021.12.28 08:15buy250.011813.150.001819.37
502021.12.28 15:37t/p250.011819.370.001819.376.221023.79
512022.01.10 21:30buy260.011801.220.001805.98
522022.01.11 04:24t/p260.011805.980.001805.984.321028.11
532022.01.19 11:15buy270.011816.130.001824.95
542022.01.19 15:54t/p270.011824.950.001824.958.821036.93
552022.01.24 23:15buy280.011843.380.001853.74
562022.01.25 11:04close280.011838.270.001853.74-5.551031.39
572022.01.31 11:30buy290.011791.280.001798.92
582022.01.31 16:39t/p290.011798.920.001798.927.641039.03
592022.02.16 09:30buy300.011856.110.001860.85
602022.02.16 15:00close300.011852.740.001860.85-3.371035.66
612022.03.03 22:15buy310.011937.410.001946.73
622022.03.04 02:36t/p310.011946.730.001946.738.881044.54
632022.03.04 13:00buy320.011947.630.001961.75
642022.03.04 18:09t/p320.011961.750.001961.7514.121058.66
652022.03.11 21:30buy330.011986.950.001999.25
662022.03.14 00:45close330.011972.860.001999.25-14.531044.14
672022.03.24 13:30buy340.011946.500.001957.42
682022.03.24 14:03t/p340.011957.420.001957.4210.921055.06
692022.04.05 16:15buy350.011935.270.001956.63
702022.04.05 18:45close350.011925.680.001956.63-9.591045.47
712022.04.13 08:30buy360.011969.860.001973.40
722022.04.13 11:19t/p360.011973.400.001973.403.541049.01
732022.05.20 09:45buy370.011848.340.001859.62
742022.05.20 16:30close370.011840.610.001859.62-7.731041.28
752022.05.23 01:15buy380.011845.310.001848.55
762022.05.23 02:07t/p380.011848.550.001848.553.241044.52
772022.06.08 15:15buy390.011851.320.001858.82
782022.06.08 18:07t/p390.011858.820.001858.827.501052.02
792022.07.05 02:15buy400.011810.010.001814.79
802022.07.05 10:30close400.011806.730.001814.79-3.281048.74
812022.10.26 07:45buy410.011656.860.001658.96
822022.10.26 08:41t/p410.011658.960.001658.962.101050.84
832022.10.27 08:45buy420.011669.970.001683.09
842022.10.27 09:45close420.011661.850.001683.09-8.121042.72
852022.11.02 04:00buy430.011650.460.001653.36
862022.11.02 10:00t/p430.011653.360.001653.362.901045.62
872022.11.14 17:45buy440.011770.180.001784.24
882022.11.15 08:45close440.011769.440.001784.24-1.181044.44
892022.11.30 05:45buy450.011754.150.001759.19
902022.11.30 10:57t/p450.011759.190.001759.195.041049.48
912023.01.11 06:30buy460.011877.620.001882.84
922023.01.11 07:37t/p460.011882.840.001882.845.221054.70
932023.02.09 05:00buy470.011879.530.001889.99
942023.02.09 16:01t/p470.011889.990.001889.9910.461065.16
952023.02.16 21:30buy480.011843.520.001847.54
962023.02.17 01:15close480.011835.010.001847.54-8.951056.22
972023.02.22 05:15buy490.011837.180.001840.68
982023.02.22 10:03t/p490.011840.680.001840.683.501059.72
992023.03.28 17:00buy500.011963.690.001968.77
1002023.03.28 17:57t/p500.011968.770.001968.775.081064.80
1012023.03.30 10:45buy510.011969.560.001976.42
1022023.03.30 19:01t/p510.011976.420.001976.426.861071.66
1032023.04.26 13:30buy520.012000.140.002005.44
1042023.04.26 16:24t/p520.012005.440.002005.445.301076.96
1052023.04.27 06:00buy530.011999.160.002014.50
1062023.04.27 15:45close530.011983.780.002014.50-15.381061.58
1072023.05.15 19:45buy540.012020.300.002031.78
1082023.05.15 22:00close540.012014.590.002031.78-5.711055.87
1092023.06.09 17:30buy550.011967.630.001988.83
1102023.06.09 18:30close550.011962.630.001988.83-5.001050.87
1112023.06.13 03:15buy560.011961.000.001966.36
1122023.06.13 15:30t/p560.011966.360.001966.365.361056.23
1132023.07.12 03:45buy570.011936.100.001941.76
1142023.07.12 15:30t/p570.011941.760.001941.765.661061.89
1152023.07.19 23:00buy580.011978.780.001982.56
1162023.07.20 04:30t/p580.011982.560.001982.562.471064.36
+
diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 2.gif b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..e8b04beda0fc707b326f389f08422f93b412c3a3 GIT binary patch literal 8400 zcmch5^;;C&^Y+rq(g;dOD&0!RBB7#EOB!@Zx1zw(&9ZcN!_p{u5;#^>z;e=nK|dT^HKi8D{&)XoL;~d0D!?@006+?;2;J$0FL~NG&4g!Ku9xi zBpUE=Fc@?s_yIziJun|!00un^22=nZHhA{`@i2cQ!T$pQ1IULUcozLXA^>29d`Nvr zet?i>72u{w%%&OmK{L_}Y1Z^04FC*)!A+P46i|WwpNd%pz-$xqK#y#CsPGVc=m--D z20v(l|FdA^Lw^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d=`VgdttB>5AS;}L3&Ob#vK zW8YZPK103N@DQGqk7=qNhosz9&#P5Q)=X*d+Hm&0?%W#SI z>)~^n-Q*?}U6!5jP#AbQ5a75OZxDWE9C=~-XM_`)4&BL)PzFy&=DoPu$SWUq-7nMm z4dsdydr!af&LfQC2>LR;VJTSRzIG+x=1yXzjb7^YYR@AByMt_-VJ3wE9)re{iD%8P zPNtrDHBByc+}*9NazuEnciRh;?*3jCh0cWS*rgoLWk|Q2?PwTCUtA?XGm`) zm5cA`FzJ1|sK@1Y@F{lG=X{zNhGLHNp(@G5`-=YtViJilcC1{)lLoevJK6YE8D3M`8thm<>Ux~X2!}J^adBLL9&0?Dq)JR zvnexrWjVn@@K34P)EDNmyhtKg4Eb84`>RLPN09+ygT`b-n%(SHYH;fkWBPKJ4SHd+2l4&R1oe~4^MK>;S+!kXs`W9s6Q}0 z4y;U`2CM+EGD(FBp9#pts|RJ_ZoW{PQ~HdL=UIyJHx)L8LbQjYqtVs50#$W_P9{M( zUr?mtepu(Bgl76fI}uIfRz_xNKHNnxSXmq{S~LjML*qXJY5oEYr{$E zHW=lUT@lYsMdLErr}bynQ~1UoDif2zTUg3Nta}n4@e*)L4kH9E>CBikqa6 zDbFC!KNHZ+ck4TSiCZLQ&cGhZTM_;3Q}3;-(XKTAMIcj?!Bl~sPE`r{4>53PHyo|q z5q7`#ZP#|%3FEYsw}f;WZL-C1=$J4urBDIUSFm5d16y(({>Z6)ilsc{;<;P*k4r~cBP%-p!|lD`(3! z`UT@bPx=fFCETNQ7kYz4&d%z|JhI#jZYEW*|J7v_{fUUU-Qe-M8nkad%^ + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
ModelEvery tick (the most precise method based on all available least timeframes)
Bars in test62709Ticks modelled71719330Modelling qualityn/a
Mismatched charts errors777
Initial deposit1000.00SpreadCurrent (60)
Total net profit1287.21Gross profit3975.20Gross loss-2687.99
Profit factor1.48Expected payoff22.19
Absolute drawdown183.02Maximal drawdown772.20 (29.49%)Relative drawdown29.49% (772.20)
Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
Largestprofit trade291.60loss trade-307.60
Averageprofit trade116.92loss trade-112.00
Maximumconsecutive wins (profit in money)4 (460.18)consecutive losses (loss in money)3 (-521.80)
Maximalconsecutive profit (count of wins)460.18 (4)consecutive loss (count of losses)-521.80 (3)
Averageconsecutive wins2consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.03 23:30buy10.201841.440.001845.90
22020.12.04 15:31t/p10.201845.900.001845.9080.491080.49
32020.12.08 18:30buy20.201870.350.001886.13
42020.12.09 05:19close20.201864.070.001886.13-134.31946.18
52020.12.30 03:45buy30.201883.290.001893.75
62020.12.30 10:00close30.201878.490.001893.75-96.00850.18
72020.12.30 18:00buy40.201885.860.001895.62
82020.12.31 02:15t/p40.201895.620.001895.62169.081019.26
92021.01.05 11:30buy50.201944.710.001954.49
102021.01.06 03:09t/p50.201954.490.001954.49186.891206.15
112021.04.05 17:30buy60.201729.420.001742.62
122021.04.05 22:00close60.201725.680.001742.62-74.801131.35
132021.04.19 06:15buy70.201778.720.001785.24
142021.04.19 07:15close70.201776.750.001785.24-39.401091.95
152021.04.26 21:00buy80.201780.010.001781.77
162021.04.26 23:39t/p80.201781.770.001781.7735.201127.15
172021.05.18 23:45buy90.201870.210.001872.99
182021.05.19 05:00close90.201867.630.001872.99-60.311066.84
192021.05.20 08:15buy100.201876.090.001877.07
202021.05.20 08:30t/p100.201877.070.001877.0719.601086.44
212021.05.21 11:30buy110.201876.530.001882.65
222021.05.21 15:21t/p110.201882.650.001882.65122.401208.84
232021.05.24 19:15buy120.201884.010.001887.27
242021.05.25 01:15close120.201880.910.001887.27-70.711138.14
252021.05.25 10:45buy130.201884.160.001898.74
262021.05.25 21:06t/p130.201898.740.001898.74291.601429.74
272021.06.28 20:30buy140.201780.510.001785.35
282021.06.28 21:15close140.201778.020.001785.35-49.801379.94
292021.07.06 04:15buy150.201792.940.001796.10
302021.07.06 04:53t/p150.201796.100.001796.1063.201443.14
312021.07.09 17:45buy160.201806.390.001814.91
322021.07.12 07:16close160.201801.870.001814.91-99.111344.03
332021.07.12 19:30buy170.201805.330.001808.45
342021.07.13 04:34t/p170.201808.450.001808.4553.691397.72
352021.08.12 23:00buy180.201753.790.001757.21
362021.08.13 09:09t/p180.201757.210.001757.2159.691457.41
372021.09.01 22:30buy190.201815.330.001820.69
382021.09.02 02:45close190.201813.220.001820.69-68.321389.09
392021.09.03 05:15buy200.201813.490.001819.35
402021.09.03 15:34t/p200.201819.350.001819.35117.201506.29
412021.09.29 06:00buy210.201740.530.001751.43
422021.09.29 16:24close210.201736.210.001751.43-86.401419.89
432021.11.16 04:45buy220.201867.860.001877.40
442021.11.16 09:45close220.201863.300.001877.40-91.201328.69
452021.12.07 04:30buy230.201781.010.001785.23
462021.12.07 05:45close230.201778.500.001785.23-50.201278.49
472021.12.07 20:30buy240.201784.430.001788.51
482021.12.08 04:07t/p240.201788.510.001788.5172.891351.38
492021.12.28 08:15buy250.201813.150.001819.37
502021.12.28 15:37t/p250.201819.370.001819.37124.401475.78
512022.01.10 21:30buy260.201801.220.001805.98
522022.01.11 04:24t/p260.201805.980.001805.9886.491562.27
532022.01.19 11:15buy270.201816.130.001824.95
542022.01.19 15:54t/p270.201824.950.001824.95176.401738.67
552022.01.24 23:15buy280.201843.380.001853.74
562022.01.25 11:04close280.201838.270.001853.74-110.911627.76
572022.01.31 11:30buy290.201791.280.001798.92
582022.01.31 16:39t/p290.201798.920.001798.92152.801780.56
592022.02.16 09:30buy300.201856.110.001860.85
602022.02.16 15:00close300.201852.740.001860.85-67.401713.16
612022.03.03 22:15buy310.201937.410.001946.73
622022.03.04 02:36t/p310.201946.730.001946.73177.691890.86
632022.03.04 13:00buy320.201947.630.001961.75
642022.03.04 18:09t/p320.201961.750.001961.75282.402173.26
652022.03.11 21:30buy330.201986.950.001999.25
662022.03.14 00:45close330.201972.860.001999.25-290.511882.75
672022.03.24 13:30buy340.201946.500.001957.42
682022.03.24 14:03t/p340.201957.420.001957.42218.402101.15
692022.04.05 16:15buy350.201935.270.001956.63
702022.04.05 18:45close350.201925.680.001956.63-191.801909.35
712022.04.13 08:30buy360.201969.860.001973.40
722022.04.13 11:19t/p360.201973.400.001973.4070.801980.15
732022.05.20 09:45buy370.201848.340.001859.62
742022.05.20 16:30close370.201840.610.001859.62-154.601825.55
752022.05.23 01:15buy380.201845.310.001848.55
762022.05.23 02:07t/p380.201848.550.001848.5564.801890.35
772022.06.08 15:15buy390.201851.320.001858.82
782022.06.08 18:07t/p390.201858.820.001858.82150.002040.35
792022.07.05 02:15buy400.201810.010.001814.79
802022.07.05 10:30close400.201806.730.001814.79-65.601974.75
812022.10.26 07:45buy410.201656.860.001658.96
822022.10.26 08:41t/p410.201658.960.001658.9642.002016.75
832022.10.27 08:45buy420.201669.970.001683.09
842022.10.27 09:45close420.201661.850.001683.09-162.401854.35
852022.11.02 04:00buy430.201650.460.001653.36
862022.11.02 10:00t/p430.201653.360.001653.3658.001912.35
872022.11.14 17:45buy440.201770.180.001784.24
882022.11.15 08:45close440.201769.440.001784.24-23.511888.84
892022.11.30 05:45buy450.201754.150.001759.19
902022.11.30 10:57t/p450.201759.190.001759.19100.801989.64
912023.01.11 06:30buy460.201877.620.001882.84
922023.01.11 07:37t/p460.201882.840.001882.84104.402094.04
932023.02.09 05:00buy470.201879.530.001889.99
942023.02.09 16:01t/p470.201889.990.001889.99209.202303.24
952023.02.16 21:30buy480.201843.520.001847.54
962023.02.17 01:15close480.201835.010.001847.54-178.912124.33
972023.02.22 05:15buy490.201837.180.001840.68
982023.02.22 10:03t/p490.201840.680.001840.6870.002194.33
992023.03.28 17:00buy500.201963.690.001968.77
1002023.03.28 17:57t/p500.201968.770.001968.77101.602295.93
1012023.03.30 10:45buy510.201969.560.001976.42
1022023.03.30 19:01t/p510.201976.420.001976.42137.202433.13
1032023.04.26 13:30buy520.202000.140.002005.44
1042023.04.26 16:24t/p520.202005.440.002005.44106.002539.13
1052023.04.27 06:00buy530.201999.160.002014.50
1062023.04.27 15:45close530.201983.780.002014.50-307.602231.53
1072023.05.15 19:45buy540.202020.300.002031.78
1082023.05.15 22:00close540.202014.590.002031.78-114.202117.33
1092023.06.09 17:30buy550.201967.630.001988.83
1102023.06.09 18:30close550.201962.630.001988.83-100.002017.33
1112023.06.13 03:15buy560.201961.000.001966.36
1122023.06.13 15:30t/p560.201966.360.001966.36107.202124.53
1132023.07.12 03:45buy570.201936.100.001941.76
1142023.07.12 15:30t/p570.201941.760.001941.76113.202237.73
1152023.07.19 23:00buy580.201978.780.001982.56
1162023.07.20 04:30t/p580.201982.560.001982.5649.482287.21
+
diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.gif b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..b615ee31627ecae9d03966daf1da6d4df378fe16 GIT binary patch literal 8417 zcmch5^8{b;rAWs< zyx!mc;d>wVp2vAS&+|ObIrsi{6_wveNPc=w&<)rC0B|@Q008Lk@5j~lL6CoIEi7v9 zpjrzEau#rRaJX3{CfwbW6PylB3e<~IjfW* z>j;O0K<>04|5-@wU4H<;>|Hk&$lALyNJ#DMopWbe?lO^gU>^X|cgMP`gS;c%&GcUr zck%y_+Sys;?DU;yaTfz%?xgNSEg=8Rc{i-Zop(3-|L4Vfcl&_<-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7oDIN>e>pIcpZ(xKMUqEy_~HfBN& zAw2B#Pj%Z&%!J(LJIuhxD7AYZ@O<-kacuNWdYuJ`@`suQ=9`FVl*tF3{%>|h98CIZ z!L{FwefP{$z0@!t%qr98?^)lkWSlY(OV01?u#JTGt0BcIYS0Rw@F)#uRoDSQ;6591 zxZ%W`pXJRbuRrKFg0?0_C9=AybNMS%JEW7))1B&w{$68Mb6wT(&QkaNYS58`cnifx z9uI8axN9vm!!$-agrVghx|j!`ZGSv+4<6$tyw z6CzA_nu8i_a#Wz~-%?%r1E@X3`r+8o?18i=GM0Lyk#6X``&8S?Bq?KjUxeYZGCFU0 z00mJd4nz(QZK&J80N(YIGJ+XE!ofLJ(B!C-;SJ0{XLdj^xiiHz@FmxdFHlTM}k?46(q@@r9K{sQQ3)wFxH!vvR&A!CmD;=)xQaGT zBQRDidVCpXT7Dp@E=_f0;@B={{I8JW=cM*q(I585I+-~3os?Lqyg8Cj+82IPlp!UxXD|Vo_Z-nvWBGs~cRXiL2?uG{(3S*; z1+R#N|9d07a73)}t(cJiJm3k-QF12f8i{OjHG2~k^0#z@Xj^`oqS=wtr1Vz)j2r6h zBswYa#^~J;sGR%FixxZa6U2zm+oN#*>otM4i=pV-f2F4C0RVv1{{aq>Dw_ZR literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.htm b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.htm new file mode 100644 index 0000000..d2417ad --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 3.htm @@ -0,0 +1,183 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
Bars in test62709Ticks modelled71719330Modelling qualityn/a
Mismatched charts errors777
Initial deposit1000.00SpreadCurrent (60)
Total net profit1930.81Gross profit5962.79Gross loss-4031.98
Profit factor1.48Expected payoff33.29
Absolute drawdown274.52Maximal drawdown1158.30 (33.79%)Relative drawdown39.80% (479.56)
Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
Largestprofit trade437.40loss trade-461.40
Averageprofit trade175.38loss trade-168.00
Maximumconsecutive wins (profit in money)4 (690.28)consecutive losses (loss in money)3 (-782.70)
Maximalconsecutive profit (count of wins)690.28 (4)consecutive loss (count of losses)-782.70 (3)
Averageconsecutive wins2consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.03 23:30buy10.301841.440.001845.90
22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
32020.12.08 18:30buy20.301870.350.001886.13
42020.12.09 05:19close20.301864.070.001886.13-201.46919.28
52020.12.30 03:45buy30.301883.290.001893.75
62020.12.30 10:00close30.301878.490.001893.75-144.00775.28
72020.12.30 18:00buy40.301885.860.001895.62
82020.12.31 02:15t/p40.301895.620.001895.62253.611028.89
92021.01.05 11:30buy50.301944.710.001954.49
102021.01.06 03:09t/p50.301954.490.001954.49280.341309.23
112021.04.05 17:30buy60.301729.420.001742.62
122021.04.05 22:00close60.301725.680.001742.62-112.201197.03
132021.04.19 06:15buy70.301778.720.001785.24
142021.04.19 07:15close70.301776.750.001785.24-59.101137.93
152021.04.26 21:00buy80.301780.010.001781.77
162021.04.26 23:39t/p80.301781.770.001781.7752.801190.73
172021.05.18 23:45buy90.301870.210.001872.99
182021.05.19 05:00close90.301867.630.001872.99-90.461100.27
192021.05.20 08:15buy100.301876.090.001877.07
202021.05.20 08:30t/p100.301877.070.001877.0729.401129.67
212021.05.21 11:30buy110.301876.530.001882.65
222021.05.21 15:21t/p110.301882.650.001882.65183.601313.27
232021.05.24 19:15buy120.301884.010.001887.27
242021.05.25 01:15close120.301880.910.001887.27-106.061207.20
252021.05.25 10:45buy130.301884.160.001898.74
262021.05.25 21:06t/p130.301898.740.001898.74437.401644.60
272021.06.28 20:30buy140.301780.510.001785.35
282021.06.28 21:15close140.301778.020.001785.35-74.701569.90
292021.07.06 04:15buy150.301792.940.001796.10
302021.07.06 04:53t/p150.301796.100.001796.1094.801664.70
312021.07.09 17:45buy160.301806.390.001814.91
322021.07.12 07:16close160.301801.870.001814.91-148.661516.04
332021.07.12 19:30buy170.301805.330.001808.45
342021.07.13 04:34t/p170.301808.450.001808.4580.541596.58
352021.08.12 23:00buy180.301753.790.001757.21
362021.08.13 09:09t/p180.301757.210.001757.2189.541686.12
372021.09.01 22:30buy190.301815.330.001820.69
382021.09.02 02:45close190.301813.220.001820.69-102.491583.63
392021.09.03 05:15buy200.301813.490.001819.35
402021.09.03 15:34t/p200.301819.350.001819.35175.801759.43
412021.09.29 06:00buy210.301740.530.001751.43
422021.09.29 16:24close210.301736.210.001751.43-129.601629.83
432021.11.16 04:45buy220.301867.860.001877.40
442021.11.16 09:45close220.301863.300.001877.40-136.801493.03
452021.12.07 04:30buy230.301781.010.001785.23
462021.12.07 05:45close230.301778.500.001785.23-75.301417.73
472021.12.07 20:30buy240.301784.430.001788.51
482021.12.08 04:07t/p240.301788.510.001788.51109.341527.07
492021.12.28 08:15buy250.301813.150.001819.37
502021.12.28 15:37t/p250.301819.370.001819.37186.601713.67
512022.01.10 21:30buy260.301801.220.001805.98
522022.01.11 04:24t/p260.301805.980.001805.98129.741843.41
532022.01.19 11:15buy270.301816.130.001824.95
542022.01.19 15:54t/p270.301824.950.001824.95264.602108.01
552022.01.24 23:15buy280.301843.380.001853.74
562022.01.25 11:04close280.301838.270.001853.74-166.361941.65
572022.01.31 11:30buy290.301791.280.001798.92
582022.01.31 16:39t/p290.301798.920.001798.92229.202170.85
592022.02.16 09:30buy300.301856.110.001860.85
602022.02.16 15:00close300.301852.740.001860.85-101.102069.75
612022.03.03 22:15buy310.301937.410.001946.73
622022.03.04 02:36t/p310.301946.730.001946.73266.542336.28
632022.03.04 13:00buy320.301947.630.001961.75
642022.03.04 18:09t/p320.301961.750.001961.75423.602759.88
652022.03.11 21:30buy330.301986.950.001999.25
662022.03.14 00:45close330.301972.860.001999.25-435.762324.12
672022.03.24 13:30buy340.301946.500.001957.42
682022.03.24 14:03t/p340.301957.420.001957.42327.602651.72
692022.04.05 16:15buy350.301935.270.001956.63
702022.04.05 18:45close350.301925.680.001956.63-287.702364.02
712022.04.13 08:30buy360.301969.860.001973.40
722022.04.13 11:19t/p360.301973.400.001973.40106.202470.22
732022.05.20 09:45buy370.301848.340.001859.62
742022.05.20 16:30close370.301840.610.001859.62-231.902238.32
752022.05.23 01:15buy380.301845.310.001848.55
762022.05.23 02:07t/p380.301848.550.001848.5597.202335.52
772022.06.08 15:15buy390.301851.320.001858.82
782022.06.08 18:07t/p390.301858.820.001858.82225.002560.52
792022.07.05 02:15buy400.301810.010.001814.79
802022.07.05 10:30close400.301806.730.001814.79-98.402462.12
812022.10.26 07:45buy410.301656.860.001658.96
822022.10.26 08:41t/p410.301658.960.001658.9663.002525.12
832022.10.27 08:45buy420.301669.970.001683.09
842022.10.27 09:45close420.301661.850.001683.09-243.602281.52
852022.11.02 04:00buy430.301650.460.001653.36
862022.11.02 10:00t/p430.301653.360.001653.3687.002368.52
872022.11.14 17:45buy440.301770.180.001784.24
882022.11.15 08:45close440.301769.440.001784.24-35.262333.26
892022.11.30 05:45buy450.301754.150.001759.19
902022.11.30 10:57t/p450.301759.190.001759.19151.202484.46
912023.01.11 06:30buy460.301877.620.001882.84
922023.01.11 07:37t/p460.301882.840.001882.84156.602641.06
932023.02.09 05:00buy470.301879.530.001889.99
942023.02.09 16:01t/p470.301889.990.001889.99313.802954.86
952023.02.16 21:30buy480.301843.520.001847.54
962023.02.17 01:15close480.301835.010.001847.54-268.362686.50
972023.02.22 05:15buy490.301837.180.001840.68
982023.02.22 10:03t/p490.301840.680.001840.68105.002791.50
992023.03.28 17:00buy500.301963.690.001968.77
1002023.03.28 17:57t/p500.301968.770.001968.77152.402943.90
1012023.03.30 10:45buy510.301969.560.001976.42
1022023.03.30 19:01t/p510.301976.420.001976.42205.803149.70
1032023.04.26 13:30buy520.302000.140.002005.44
1042023.04.26 16:24t/p520.302005.440.002005.44159.003308.70
1052023.04.27 06:00buy530.301999.160.002014.50
1062023.04.27 15:45close530.301983.780.002014.50-461.402847.30
1072023.05.15 19:45buy540.302020.300.002031.78
1082023.05.15 22:00close540.302014.590.002031.78-171.302676.00
1092023.06.09 17:30buy550.301967.630.001988.83
1102023.06.09 18:30close550.301962.630.001988.83-150.002526.00
1112023.06.13 03:15buy560.301961.000.001966.36
1122023.06.13 15:30t/p560.301966.360.001966.36160.802686.80
1132023.07.12 03:45buy570.301936.100.001941.76
1142023.07.12 15:30t/p570.301941.760.001941.76169.802856.60
1152023.07.19 23:00buy580.301978.780.001982.56
1162023.07.20 04:30t/p580.301982.560.001982.5674.212930.81
+
diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 4.gif b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..2f235e8c29db3f76a4f4b019e3b945dc6e973c5b GIT binary patch literal 8374 zcmch5g;!MH_x1pa4Bd?&(jg!c4yk~IlqeEPiZqC#bPPQ~4BZU_4BbP6bT zwywK_>a0NsEa2|K;jjqM9aLw1$GkHEI4lMPr~upz5a$2!aDNe?{{eu(x;rNbgZ&>7 z0I;sR3%v`zgX*j+KrIN|Z)?z5rA9no@^ z;m&zi5e@+Y-D!dTn?ZGV^#K6byK1Zvb$4kHpgQcGaW}QxMI!FNK>%p*j&+v@aYwpa z(|<+W`Ts-euvi2Zb7xuK`2ZDnQg@=(2rL!^xa-!|cdPsV-h}RUAMoG306f5f0f9lm zA)#RqC=4DR5gCPuj){$nPe@EkPDxEm&&bTm&dJToM-~(op^8gN%gQS%tEy{i>*~=B zjZMuht!?ccKRdg+dwTo&2L^|RM@Gj=@Fu6GXJ#>T^Vo&OrR9~?we?@WH~wsHZSU;v z?H?Q-{rz`*a(Z@HftQJYeVcIuxZR;etSD;Vr+T;$hgf~7MfOO3h&FmnS(8re7JCNE zeG$N+0DH$6^Ghv^`%Ok%Qp|4+xUfa*6k{y1_q|l^)Fi-Fk!@HFp}LIz;lfIy`O)O?h`B#ezzNEk^$g8WY0<&HS+?)&X-`}5^U z=6kwV|MqjM$sZnachS9BZG~LvY5k^pc@Id<6V7dQLLEXJEBvv&{do{484I&X#!xna z1Vsw{3U`wiB8bA+XjE^w-}zB}74K@sz50{K)2=(0rw&lb$K)K;GzwO-QsBXmSC3=L znlDGX3z@?h1uZMG1`;sFjA9K`&@mY18{eDT7^kKOx{0+nZfMlSDR2)tYFq#D-nAI@ zg8lJ*HMNg~^fBgKB$gBAoQHD^i9q5F)x?mQ&k$0#0$ZsWAfGhP3t~b;ZcZpcp=b`C zU@gX?XN-LIt z*kEa;GedvghzC6B0r+F=y1jx-4ASejPX9y?+Awv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))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.3; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
Bars in test62709Ticks modelled71719330Modelling qualityn/a
Mismatched charts errors777
Initial deposit1000.00SpreadCurrent (60)
Total net profit2201.41Gross profit5962.79Gross loss-3761.38
Profit factor1.59Expected payoff37.96
Absolute drawdown274.52Maximal drawdown997.50 (28.19%)Relative drawdown39.80% (479.56)
Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
Largestprofit trade437.40loss trade-313.66
Averageprofit trade175.38loss trade-156.72
Maximumconsecutive wins (profit in money)4 (690.28)consecutive losses (loss in money)3 (-621.90)
Maximalconsecutive profit (count of wins)690.28 (4)consecutive loss (count of losses)-621.90 (3)
Averageconsecutive wins2consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.03 23:30buy10.301841.440.001845.90
22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
32020.12.08 18:30buy20.301870.350.001886.13
42020.12.09 05:19close20.301864.070.001886.13-201.46919.28
52020.12.30 03:45buy30.301883.290.001893.75
62020.12.30 10:00close30.301878.490.001893.75-144.00775.28
72020.12.30 18:00buy40.301885.860.001895.62
82020.12.31 02:15t/p40.301895.620.001895.62253.611028.89
92021.01.05 11:30buy50.301944.710.001954.49
102021.01.06 03:09t/p50.301954.490.001954.49280.341309.23
112021.04.05 17:30buy60.301729.420.001742.62
122021.04.05 22:00close60.301725.680.001742.62-112.201197.03
132021.04.19 06:15buy70.301778.720.001785.24
142021.04.19 07:15close70.301776.750.001785.24-59.101137.93
152021.04.26 21:00buy80.301780.010.001781.77
162021.04.26 23:39t/p80.301781.770.001781.7752.801190.73
172021.05.18 23:45buy90.301870.210.001872.99
182021.05.19 05:00close90.301867.630.001872.99-90.461100.27
192021.05.20 08:15buy100.301876.090.001877.07
202021.05.20 08:30t/p100.301877.070.001877.0729.401129.67
212021.05.21 11:30buy110.301876.530.001882.65
222021.05.21 15:21t/p110.301882.650.001882.65183.601313.27
232021.05.24 19:15buy120.301884.010.001887.27
242021.05.25 01:15close120.301880.910.001887.27-106.061207.20
252021.05.25 10:45buy130.301884.160.001898.74
262021.05.25 21:06t/p130.301898.740.001898.74437.401644.60
272021.06.28 20:30buy140.301780.510.001785.35
282021.06.28 21:15close140.301778.020.001785.35-74.701569.90
292021.07.06 04:15buy150.301792.940.001796.10
302021.07.06 04:53t/p150.301796.100.001796.1094.801664.70
312021.07.09 17:45buy160.301806.390.001814.91
322021.07.12 07:16close160.301801.870.001814.91-148.661516.04
332021.07.12 19:30buy170.301805.330.001808.45
342021.07.13 04:34t/p170.301808.450.001808.4580.541596.58
352021.08.12 23:00buy180.301753.790.001757.21
362021.08.13 09:09t/p180.301757.210.001757.2189.541686.12
372021.09.01 22:30buy190.301815.330.001820.69
382021.09.02 02:45close190.301813.220.001820.69-102.491583.63
392021.09.03 05:15buy200.301813.490.001819.35
402021.09.03 15:34t/p200.301819.350.001819.35175.801759.43
412021.09.29 06:00buy210.301740.530.001751.43
422021.09.29 16:24close210.301736.210.001751.43-129.601629.83
432021.11.16 04:45buy220.301867.860.001877.40
442021.11.16 09:45close220.301863.300.001877.40-136.801493.03
452021.12.07 04:30buy230.301781.010.001785.23
462021.12.07 05:45close230.301778.500.001785.23-75.301417.73
472021.12.07 20:30buy240.301784.430.001788.51
482021.12.08 04:07t/p240.301788.510.001788.51109.341527.07
492021.12.28 08:15buy250.301813.150.001819.37
502021.12.28 15:37t/p250.301819.370.001819.37186.601713.67
512022.01.10 21:30buy260.301801.220.001805.98
522022.01.11 04:24t/p260.301805.980.001805.98129.741843.41
532022.01.19 11:15buy270.301816.130.001824.95
542022.01.19 15:54t/p270.301824.950.001824.95264.602108.01
552022.01.24 23:15buy280.301843.380.001853.74
562022.01.25 11:04close280.301838.270.001853.74-166.361941.65
572022.01.31 11:30buy290.301791.280.001798.92
582022.01.31 16:39t/p290.301798.920.001798.92229.202170.85
592022.02.16 09:30buy300.301856.110.001860.85
602022.02.16 15:00close300.301852.740.001860.85-101.102069.75
612022.03.03 22:15buy310.301937.410.001946.73
622022.03.04 02:36t/p310.301946.730.001946.73266.542336.28
632022.03.04 13:00buy320.301947.630.001961.75
642022.03.04 18:09t/p320.301961.750.001961.75423.602759.88
652022.03.11 21:30buy330.301986.950.001999.25
662022.03.14 00:22close330.301976.930.001999.25-313.662446.22
672022.03.24 13:30buy340.301946.500.001957.42
682022.03.24 14:03t/p340.301957.420.001957.42327.602773.82
692022.04.05 16:15buy350.301935.270.001956.63
702022.04.05 18:24close350.301925.270.001956.63-300.002473.82
712022.04.13 08:30buy360.301969.860.001973.40
722022.04.13 11:19t/p360.301973.400.001973.40106.202580.02
732022.05.20 09:45buy370.301848.340.001859.62
742022.05.20 16:30close370.301840.610.001859.62-231.902348.12
752022.05.23 01:15buy380.301845.310.001848.55
762022.05.23 02:07t/p380.301848.550.001848.5597.202445.32
772022.06.08 15:15buy390.301851.320.001858.82
782022.06.08 18:07t/p390.301858.820.001858.82225.002670.32
792022.07.05 02:15buy400.301810.010.001814.79
802022.07.05 10:30close400.301806.730.001814.79-98.402571.92
812022.10.26 07:45buy410.301656.860.001658.96
822022.10.26 08:41t/p410.301658.960.001658.9663.002634.92
832022.10.27 08:45buy420.301669.970.001683.09
842022.10.27 09:45close420.301661.850.001683.09-243.602391.32
852022.11.02 04:00buy430.301650.460.001653.36
862022.11.02 10:00t/p430.301653.360.001653.3687.002478.32
872022.11.14 17:45buy440.301770.180.001784.24
882022.11.15 08:45close440.301769.440.001784.24-35.262443.06
892022.11.30 05:45buy450.301754.150.001759.19
902022.11.30 10:57t/p450.301759.190.001759.19151.202594.26
912023.01.11 06:30buy460.301877.620.001882.84
922023.01.11 07:37t/p460.301882.840.001882.84156.602750.86
932023.02.09 05:00buy470.301879.530.001889.99
942023.02.09 16:01t/p470.301889.990.001889.99313.803064.66
952023.02.16 21:30buy480.301843.520.001847.54
962023.02.17 01:15close480.301835.010.001847.54-268.362796.30
972023.02.22 05:15buy490.301837.180.001840.68
982023.02.22 10:03t/p490.301840.680.001840.68105.002901.30
992023.03.28 17:00buy500.301963.690.001968.77
1002023.03.28 17:57t/p500.301968.770.001968.77152.403053.70
1012023.03.30 10:45buy510.301969.560.001976.42
1022023.03.30 19:01t/p510.301976.420.001976.42205.803259.50
1032023.04.26 13:30buy520.302000.140.002005.44
1042023.04.26 16:24t/p520.302005.440.002005.44159.003418.50
1052023.04.27 06:00buy530.301999.160.002014.50
1062023.04.27 15:35close530.301989.140.002014.50-300.603117.90
1072023.05.15 19:45buy540.302020.300.002031.78
1082023.05.15 22:00close540.302014.590.002031.78-171.302946.60
1092023.06.09 17:30buy550.301967.630.001988.83
1102023.06.09 18:30close550.301962.630.001988.83-150.002796.60
1112023.06.13 03:15buy560.301961.000.001966.36
1122023.06.13 15:30t/p560.301966.360.001966.36160.802957.40
1132023.07.12 03:45buy570.301936.100.001941.76
1142023.07.12 15:30t/p570.301941.760.001941.76169.803127.20
1152023.07.19 23:00buy580.301978.780.001982.56
1162023.07.20 04:30t/p580.301982.560.001982.5674.213201.41
+
diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.gif b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..905a6a2169f0b5c39c3c649d0f43b0127c237b84 GIT binary patch literal 8582 zcmc(D^;eYN_x%v!3?(HkDV>7Ukb+8=ill(jje>;K&@)2~-5oP@2ty+(-CaW~Ih0D* ze0aUTf5i7$_qpq=efHUB-+R}(KU`Jym(nutpAz%|HUR(}4hH}LhK7c4=s_^zFWS}? zeFvd!!3YfC?#JOU2=E<*w!LHCg#a984h*OP+zs&D|Ks8QBEbIx0E6heBzO+kx&>s zDmo@M4iTS_n3SB7nwFlCnU$TBo0nfuSX5ksM3t76S5#J2*VNX1t#3d#HZ`}jwzYSB z>-_%XXIFPmZ(skw;Lz~M=vW2bi&yH&Fa`CTkb8Y~)SQ^BtlFmI!mc=B*nzA+-yTTAn{Q7gPhfi)XXYj&j!EB1~ zH}na=)grm{bCS{$HZ-Dy-givVCzkZSl`7m>?Ei|?Rbddh*YLFdmA-~54_9*i(^s$6 z@I0y#;PwDKt$U=<0r)N;MCCpeFU4;O6XO>o^rT<`J{PWPXB=1ey-u%#h3XPULcObh z2ZdkBS&q269_p`kK(AhDZ%`@|f~dHoxvWp9!if`w%sM+|LOIBo7~ka#;2 zYW;!;ePCid`f9k}mA$c!XDx@Y@q}~Q1ABSu1e4?>XQQH4w3d^C42HktOsHzR9O*_e zM$!v>sL2~hnKPk((o6{(gU@~9)xS+}X}zzP+Hm95RCaL++AkTkZ!{ykenPeAczjPy z&5VdP!SXT5hY3rLqj|bi5b>sJYWR!|l++7pFEs<=mF9j%Ok~8x0V6<(7T^igP#BX4 zM;k#wyrg30zBFx}^F)lD0HwIcU2FtI;$wQDY_vm0g*Z0s8Z@0iGLOOtAVpsTAeULK zu}%bN`G%4M^=ecApd*S+^3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`UU+ zySwTiiLm`n@Sz{$+z;EkG~9JnZbWV56mm87@Amav`P3djiMF(e4eb0l39H|AW@5BW zBR_W0JOD|TE*-^KUSeLDpRk-~?>!Td1MGEdda26y?{7*!;ojfZNYbK_-tic$ literal 0 HcmV?d00001 diff --git a/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.htm b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.htm new file mode 100644 index 0000000..1f7f2fa --- /dev/null +++ b/Bkp/Used/14020502/Docs/Reports/XR/StrategyTester 5.htm @@ -0,0 +1,213 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.3; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +xrR2R=2; xrMarketLength=7; xrMarketRangeMult=7; xrFastMult=3; xrSlowMult=7; xrSwingLength=7;
Bars in test62709Ticks modelled71719330Modelling qualityn/a
Mismatched charts errors777
Initial deposit1000.00SpreadCurrent (60)
Total net profit2656.05Gross profit8026.93Gross loss-5370.88
Profit factor1.49Expected payoff36.38
Absolute drawdown169.22Maximal drawdown954.90 (24.18%)Relative drawdown31.06% (374.26)
Total trades73Short positions (won %)0 (0.00%)Long positions (won %)73 (56.16%)
Profit trades (% of total)41 (56.16%)Loss trades (% of total)32 (43.84%)
Largestprofit trade528.00loss trade-313.66
Averageprofit trade195.78loss trade-167.84
Maximumconsecutive wins (profit in money)4 (991.20)consecutive losses (loss in money)3 (-208.69)
Maximalconsecutive profit (count of wins)991.20 (4)consecutive loss (count of losses)-493.50 (2)
Averageconsecutive wins2consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.03 23:30buy10.301841.440.001845.90
22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
32020.12.08 18:30buy20.301870.350.001886.13
42020.12.09 03:19close20.301867.580.001886.13-96.161024.58
52020.12.30 03:45buy30.301883.290.001893.75
62020.12.30 10:00close30.301878.490.001893.75-144.00880.58
72020.12.30 18:00buy40.301885.860.001895.62
82020.12.31 02:15t/p40.301895.620.001895.62253.611134.19
92020.12.31 13:45buy50.301894.880.001901.64
102021.01.04 01:00t/p50.301901.640.001901.64176.681310.87
112021.01.05 11:30buy60.301944.710.001954.49
122021.01.06 03:09t/p60.301954.490.001954.49280.341591.20
132021.04.05 17:30buy70.301729.420.001742.62
142021.04.05 22:00close70.301725.680.001742.62-112.201479.00
152021.04.26 21:00buy80.301780.010.001781.77
162021.04.26 23:39t/p80.301781.770.001781.7752.801531.80
172021.05.11 09:00buy90.301837.410.001840.21
182021.05.11 09:51close90.301834.840.001840.21-77.101454.70
192021.05.18 23:45buy100.301870.210.001872.99
202021.05.19 05:00close100.301867.630.001872.99-90.461364.24
212021.05.20 08:15buy110.301876.090.001877.07
222021.05.20 08:30t/p110.301877.070.001877.0729.401393.64
232021.05.21 11:30buy120.301876.530.001882.65
242021.05.21 15:21t/p120.301882.650.001882.65183.601577.24
252021.05.24 19:15buy130.301884.010.001887.27
262021.05.25 01:15close130.301880.910.001887.27-106.061471.18
272021.05.25 10:45buy140.301884.160.001898.74
282021.05.25 21:06t/p140.301898.740.001898.74437.401908.58
292021.06.28 20:30buy150.301780.510.001785.35
302021.06.28 21:15close150.301778.020.001785.35-74.701833.88
312021.07.02 02:00buy160.301776.630.001777.79
322021.07.02 03:39t/p160.301777.790.001777.7934.801868.68
332021.07.06 04:15buy170.301792.940.001796.10
342021.07.06 04:53t/p170.301796.100.001796.1094.801963.48
352021.07.09 17:45buy180.301806.390.001814.91
362021.07.12 07:16close180.301801.870.001814.91-148.661814.82
372021.07.13 17:45buy190.301811.870.001825.27
382021.07.13 21:07close190.301806.200.001825.27-170.101644.72
392021.08.11 05:30buy200.301732.250.001747.61
402021.08.11 18:06t/p200.301747.610.001747.61460.802105.52
412021.08.12 23:00buy210.301753.790.001757.21
422021.08.13 09:09t/p210.301757.210.001757.2189.542195.06
432021.08.18 04:30buy220.301789.150.001796.39
442021.08.18 12:30close220.301787.880.001796.39-38.102156.96
452021.09.01 22:30buy230.301815.330.001820.69
462021.09.02 02:45close230.301813.220.001820.69-102.492054.47
472021.09.02 03:15buy240.301815.430.001819.79
482021.09.02 05:30close240.301813.160.001819.79-68.101986.37
492021.09.03 05:15buy250.301813.490.001819.35
502021.09.03 15:34t/p250.301819.350.001819.35175.802162.17
512021.09.27 03:45buy260.301753.930.001763.97
522021.09.27 12:49close260.301749.120.001763.97-144.302017.87
532021.10.22 02:15buy270.301786.030.001793.21
542021.10.22 09:54t/p270.301793.210.001793.21215.402233.27
552021.11.16 04:45buy280.301867.860.001877.40
562021.11.16 09:45close280.301863.300.001877.40-136.802096.47
572021.12.07 04:30buy290.301781.010.001785.23
582021.12.07 05:45close290.301778.500.001785.23-75.302021.17
592021.12.07 20:30buy300.301784.430.001788.51
602021.12.08 04:07t/p300.301788.510.001788.51109.342130.51
612021.12.28 08:15buy310.301813.150.001819.37
622021.12.28 15:37t/p310.301819.370.001819.37186.602317.11
632022.01.10 21:30buy320.301801.220.001805.98
642022.01.11 04:24t/p320.301805.980.001805.98129.742446.85
652022.01.19 11:15buy330.301816.130.001824.95
662022.01.19 15:54t/p330.301824.950.001824.95264.602711.45
672022.01.24 23:15buy340.301843.380.001853.74
682022.01.25 12:36close340.301836.700.001853.74-213.462497.98
692022.01.31 11:30buy350.301791.280.001798.92
702022.01.31 16:39t/p350.301798.920.001798.92229.202727.18
712022.02.16 09:30buy360.301856.110.001860.85
722022.02.16 15:00close360.301852.740.001860.85-101.102626.08
732022.02.28 16:15buy370.301914.460.001926.88
742022.02.28 18:09close370.301904.460.001926.88-300.002326.08
752022.03.03 22:15buy380.301937.410.001946.73
762022.03.04 02:36t/p380.301946.730.001946.73266.542592.62
772022.03.04 13:00buy390.301947.630.001961.75
782022.03.04 18:09t/p390.301961.750.001961.75423.603016.22
792022.03.11 21:30buy400.301986.950.001999.25
802022.03.14 00:22close400.301976.930.001999.25-313.662702.56
812022.03.21 06:45buy410.301928.320.001933.60
822022.03.21 14:30close410.301923.730.001933.60-137.702564.86
832022.03.24 13:30buy420.301946.500.001957.42
842022.03.24 14:03t/p420.301957.420.001957.42327.602892.46
852022.04.05 16:15buy430.301935.270.001956.63
862022.04.05 18:24close430.301925.270.001956.63-300.002592.46
872022.04.13 08:30buy440.301969.860.001973.40
882022.04.13 11:19t/p440.301973.400.001973.40106.202698.66
892022.05.04 11:30buy450.301869.680.001876.04
902022.05.04 17:15close450.301863.310.001876.04-191.102507.56
912022.05.20 09:45buy460.301848.340.001859.62
922022.05.20 16:31close460.301840.590.001859.62-232.502275.06
932022.05.23 01:15buy470.301845.310.001848.55
942022.05.23 02:07t/p470.301848.550.001848.5597.202372.26
952022.05.30 06:45buy480.301859.800.001862.94
962022.05.30 08:42t/p480.301862.940.001862.9494.202466.46
972022.06.08 15:15buy490.301851.320.001858.82
982022.06.08 18:07t/p490.301858.820.001858.82225.002691.46
992022.07.05 02:15buy500.301810.010.001814.79
1002022.07.05 10:30close500.301806.730.001814.79-98.402593.06
1012022.09.09 04:30buy510.301715.930.001727.53
1022022.09.09 10:22t/p510.301727.530.001727.53348.002941.06
1032022.10.27 08:45buy520.301669.970.001683.09
1042022.10.27 09:45close520.301661.850.001683.09-243.602697.46
1052022.11.02 04:00buy530.301650.460.001653.36
1062022.11.02 10:00t/p530.301653.360.001653.3687.002784.46
1072022.11.16 12:15buy540.301783.620.001796.96
1082022.11.16 16:37close540.301773.620.001796.96-300.002484.46
1092022.11.30 05:45buy550.301754.150.001759.19
1102022.11.30 10:57t/p550.301759.190.001759.19151.202635.66
1112022.12.08 15:15buy560.301787.360.001794.56
1122022.12.08 17:28t/p560.301794.560.001794.56216.002851.66
1132022.12.21 16:45buy570.301818.300.001822.80
1142022.12.21 17:37t/p570.301822.800.001822.80135.002986.66
1152023.01.09 18:45buy580.301876.980.001885.82
1162023.01.10 02:26close580.301868.360.001885.82-271.662715.00
1172023.01.11 06:30buy590.301877.620.001882.84
1182023.01.11 07:37t/p590.301882.840.001882.84156.602871.60
1192023.02.09 05:00buy600.301879.530.001889.99
1202023.02.09 16:01t/p600.301889.990.001889.99313.803185.40
1212023.02.16 21:30buy610.301843.520.001847.54
1222023.02.17 01:15close610.301835.010.001847.54-268.362917.04
1232023.02.22 05:15buy620.301837.180.001840.68
1242023.02.22 10:03t/p620.301840.680.001840.68105.003022.04
1252023.03.17 04:45buy630.301929.140.001946.74
1262023.03.17 15:02t/p630.301946.740.001946.74528.003550.04
1272023.03.28 17:00buy640.301963.690.001968.77
1282023.03.28 17:57t/p640.301968.770.001968.77152.403702.44
1292023.03.30 10:45buy650.301969.560.001976.42
1302023.03.30 19:01t/p650.301976.420.001976.42205.803908.24
1312023.04.26 13:30buy660.302000.140.002005.44
1322023.04.26 15:30close660.301993.710.002005.44-192.903715.34
1332023.04.27 06:00buy670.301999.160.002014.50
1342023.04.27 15:35close670.301989.140.002014.50-300.603414.74
1352023.05.09 08:15buy680.302027.060.002032.32
1362023.05.09 14:30t/p680.302032.320.002032.32157.803572.54
1372023.05.15 19:45buy690.302020.300.002031.78
1382023.05.15 22:00close690.302014.590.002031.78-171.303401.24
1392023.06.09 17:30buy700.301967.630.001988.83
1402023.06.09 18:30close700.301962.630.001988.83-150.003251.24
1412023.06.13 03:15buy710.301961.000.001966.36
1422023.06.13 15:30t/p710.301966.360.001966.36160.803412.04
1432023.07.12 03:45buy720.301936.100.001941.76
1442023.07.12 15:30t/p720.301941.760.001941.76169.803581.84
1452023.07.19 23:00buy730.301978.780.001982.56
1462023.07.20 04:30t/p730.301982.560.001982.5674.213656.05
+
diff --git a/Bkp/Used/14020502/Docs/Signalling Conditions.md b/Bkp/Used/14020502/Docs/Signalling Conditions.md new file mode 100644 index 0000000..ac8aec4 --- /dev/null +++ b/Bkp/Used/14020502/Docs/Signalling Conditions.md @@ -0,0 +1,501 @@ +# OSC Signalling Conditions + +there are some Verifications For signals. +here i described them. + +## Long + +- OSC +- When Market Middleage Cross Over MC Fast +- When MCFast Under MC Slow +- When MakretMiddleage + +```mql4 + // // + // // XMA Based Signals ... + // hasLongSignal = + // // + // // XMA ... + // // + // // SC Fast Cross Over Market Middleage ... + // xmaState.scFast > xmaState.marketMiddleage + // && !(xmaState.scFastPrev > xmaState.marketMiddleage) + // // + // // when Short Cycle is Trending Up ... + // && xmaState.scFast > xmaState.scSlow + // && xmaState.scFastPrev > xmaState.scSlowPrev + // // + // // When Medium Cycle is Trending Up ... + // && xmaState.mcFast > xmaState.mcSlow + // && xmaState.mcFastPrev > xmaState.mcSlowPrev + // // + // // and Medium Cycle TrendPower is Going Up ... + // && MathAbs(xmaState.mcFast - xmaState.mcSlow) > + // MathAbs(xmaState.mcFastPrev - xmaState.mcSlowPrev) + // // + // // When Long Cycle is Trending Up ... + // && xmaState.lcFast > xmaState.lcSlow + // && xmaState.lcFastPrev > xmaState.lcSlowPrev + // // + // // and Long Cycle TrendPower is Going Up ... + // && MathAbs(xmaState.lcFast - xmaState.lcSlow) > + // MathAbs(xmaState.lcFastPrev - xmaState.lcSlowPrev) + // // + // // Short Cycle Slow bigger thhan Medium Cycle Fast ... + // && xmaState.scSlow > xmaState.mcFast + // // + // // OSC ... + // // Check OSC Fast and Slow is Less than 0.5 ... + // && oscState.fastOSC < 0.5 + // && oscState.slowOSC < 0.5 + // && oscState.fastOSCPrev < 0.5 + // && oscState.slowOSCPrev < 0.5 + // && oscState.fastOSC > oscState.fastOSCPrev + // // + // // Check OSC Minimum Signal Power ... + // // this Helps for Detect Market exits from Ranging ... + // && minPowOSC > 0 + // ? + // // + // // Check Conditions only if value provided ... + // oscState.powerOSCPrev < 0 + // && MathAbs(oscState.powerOSCPrev) > minPowOSC + // : + // // + // // ... other wise, ignore ... + // true + // // + // // Check Previous Candle Signal Power must be Lower than + // // Current Signal Power and the Direction Must be Up Trend ... + // && oscState.powerOSCPrev < oscState.powerOSC + // // + // // Also we Have to Check Market not ranging ... + // && !IsOSCMarketRanging( + // bar_index + 1, + // marketLen, + // minPowOSC, + // fastOSCLen, + // fastOSCMul, + // slowOSCLen, + // slowOSCMul + // ) + // // + // // ZIGZAG ... + // && zigZagState.isWaitForTrendDown + // && !zigZagState.isWaitForTrendUp + // // + // // XADX ... + // // TODO: add XADX Base Conditions for Long Trades ... + // // When ADX Trend Power bigger than 20 and less than 50 ... + // && !adxState.trendPower < 23 + // && !adxState.trendPowerPrev < 23 + // // + // // Check Trend Direction for Signals ... + // && adxState.upDirection > adxState.downDirection + // && adxState.upDirectionPrev > adxState.downDirectionPrev + // // && adxState.trendPower < 50 + // // && adxState.trendPower > adxState.trendPowerPrev + // // + // // PRICE Checking ... + // // price must be less than Candle High at openning time ... + // && longEntryPrice <= candleHigh + // // + // // also Candle High and Low must be above than lc Fast & lc Slow ... + // && longEntryPrice > xmaState.lcFast + // && longEntryPrice > xmaState.lcSlow + // && ( + // !IsSharpBullishHappens( + // bar_index, + // marketLen * 2 + // ) + // || IsSharpBearishHappens( + // bar_index, + // marketLen * 2 + // ) + // ) + // ; + + // + // Check for Long Trades if some Sharp Bullish Happens, + // Decrease sl size for fixing tps ... + // if (isSharpBullishHappens) { + // sl = sl / 1.5; + // } + + // + // TODO: Remove this ... + // if (xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage) { + // r2rRatio = r2rRatio * 2; + // } + + // + hasLongSignal = + // + // Global ... + true + // + && ( + // + // XMA ... + ( + // + true + // + // Check Medium Cycle is in TrendDown ... + && xmaStates[0].mcSlow > xmaStates[0].mcFast + && xmaStates[1].mcSlow > xmaStates[1].mcFast + && xmaStates[2].mcSlow > xmaStates[2].mcFast + // + // Check Market Middleage Cross Over MC Slow ... + // && isMarketMiddleCrossOverMCSlow + // && xmaStates[0].marketMiddleage >= (5 * _Point); + && xmaStates[0].marketMiddleage > xmaStates[0].mcSlow + && !(xmaStates[1].marketMiddleage >= xmaStates[1].mcSlow) + // + // IMPORTANT: by passing this condition i can Increase r2r ration ... + // && xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[0].marketMiddleage - xmaStates[1].marketMiddleage) > _Point + ) + // || + // + // OSC ... + // ( + // // + // true + // // + // // Check osc fast cross over slow ... + // && oscStates[1].fastOSC > oscStates[1].slowOSC + // && !(oscStates[2].fastOSC >= oscStates[2].slowOSC) + // // + // // Check OSC Fast bigger than 0.5 ... + // && oscStates[1].fastOSC > 0.5 + // && ( + // xmaStates[1].mcFast > xmaStates[1].mcSlow + // ? + // // + // xmaStates[1].marketMiddleage > xmaStates[1].mcSlow + // // + // && xmaStates[1].marketMiddleage > xmaStates[2].marketMiddleage + // && xmaStates[1].marketMiddleage > xmaStates[3].marketMiddleage + // && xmaStates[2].marketMiddleage > xmaStates[3].marketMiddleage + // : + // true + // ) + // ) + ) + ; +``` + +```mql4 + // + // TODO: Determines Where and How close Long Trades on Trend Reversal Points ... + closeLongTrades = + false + // + // This is One Conditions ... + // ( + // // + // xmaStates[0].marketMiddleage < xmaStates[0].mcFast + // && ( + // xmaStates[0].marketMiddleage < xmaStates[0].mcSlow + // || xmaStates[1].marketMiddleage < xmaStates[1].mcSlow + // || xmaStates[2].marketMiddleage < xmaStates[2].mcSlow + // ) + // // + // && xmaStates[0].mcFast > xmaStates[0].mcSlow + // // + // && xmaStates[0].marketMiddleage < xmaStates[1].marketMiddleage + // && xmaStates[1].marketMiddleage < xmaStates[2].marketMiddleage + // ) + ; + + // + waitForLongSignals = + true; + // waitForLongSignals + // ? + // // + // true + // // + // // Closing Options ... + // // + // // Trades Doesnt Closed ... + // && !closeLongTrades + // // + // // PRICE ... + // // + // // Bullish Sharp doesnt occured ... + // && !isSharpBullishHappens + // // + // // XMA ... + // // + // && xmaStates[0].marketMiddleage < xmaStates[0].mcFast + // && !( + // // + // // On MC Trend Up ... + // xmaStates[0].mcFast > xmaStates[0].mcSlow + // ? + // // + // // Market Middleage doesnt Trending Down ... + // xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[1].marketMiddleage - xmaStates[1].mcFast + // && xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[2].marketMiddleage - xmaStates[2].mcFast + // && xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[3].marketMiddleage - xmaStates[3].mcFast + // && xmaStates[1].marketMiddleage - xmaStates[1].mcFast > xmaStates[3].marketMiddleage - xmaStates[3].mcFast + // : + // true + // ) + // : + // // + // true + // && ( + // // + // // PRICE ... + // // isSharpBearishHappens + // // + // // XMA ... + // isMCFastCrossUnderSlow + // || isMarketMiddleCrossUnderMCSlow + // ) + ; +``` + +```mql4 + // + bool xmaHasLongSignal = + // + // Global ... + true + // + // XMA ... + // + // Check Medium Cycle is in TrendDown ... + // && xmaStates[0].mcSlow > xmaStates[0].mcFast + // && xmaStates[1].mcSlow > xmaStates[1].mcFast + // && xmaStates[2].mcSlow > xmaStates[2].mcFast + // + // Check Market Middleage Cross Over MC Slow ... + && isMarketMiddleageTrendUp + // + // Check distance between Medium Cycle Market + && isMarketMiddleCrossOverMCSlow + // && xmaStates[0].marketMiddleage > xmaStates[0].mcSlow + // && MathAbs(xmaStates[1].marketMiddleage - xmaStates[2].mcSlow) > _Point + // + // IMPORTANT: by passing this condition i can Increase r2r ration ... + // && xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[1].marketMiddleage - xmaStates[2].marketMiddleage) > _Point + // + // OSC ... + && oscStates[1].fastOSC > 0.5 + && !isOSCPowerTrendDown + && oscStates[1].powerOSC > 0 + // + // PRICE ... + && !isSharpBullishHappens + && longEntryPrice < marketHigh[0] + && marketHigh[0] > marketHigh[1] + && marketHigh[0] > marketHigh[2] + ; + + // + bool oscHasLongSignal = + // + false + // + // OSC ... + // + // Check osc is Trending Up ... + // isOSCTrendUp + // + // Check osc fast cross over slow ... + // isOSCFastCrossOverSlow + // + // Check OSC Market not Ranging ... + // && !isOSCMarketRanging + // + // Check OSC Fast bigger than 0.5 ... + // && oscStates[1].fastOSC > 0.5 + // && oscStates[1].slowOSC > 0.5 + // + // PRICE ... + // && !isSharpBullishHappens + // && longEntryPrice < marketHigh[0] + // && marketHigh[0] > marketHigh[1] + // && marketHigh[0] > marketHigh[2] + ; + + // + bool hasLongSignal = + xmaHasLongSignal + || + oscHasLongSignal + ; +``` + +```mql4 + // + bool hasLongSignal = + // + // Global ... + true + // + && + // XMA ... + // + // Check Parabolic Sar Cross Under Market Middleage + // Or Trending Down ... + isParabolicCrossUnderMarketMiddle + && + // + // Check PSar Value is Bigger Than Market Middleage ... + xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + && + // + // Check Parabolic Revrse Change bigger than Prev Cancle Close ... + xmaStates[1].parabolicSAR < MathMin(marketOpen[1], marketClose[1]) + && + // + // Now We Have Separate our Conditions based on + // Market Trends ... + // + // Medium Cycle Market Trends Up ... + isMCTrendUp + ? + ( + // + // Market Middle must be in Trending Up ... + isMarketMiddleageTrendUp + && + // + // Market Middle Must be less than Maximum in Cycle ... + xmaStates[1].marketMiddleage < marketMiddlesMinMax.max + && + // + // Market Middleage must be above of MC Fast ... + xmaStates[1].marketMiddleage > xmaStates[1].mcFast + && + // + // Check Distance between SC Fast and Market Middle ... + MathAbs(xmaStates[1].scFast - xmaStates[1].scSlow) > (3 * _Point) + // + // Minimum Signal Power of OSC ... + // MathAbs(oscStates[1].powerOSC > minPowOSC) + ) + : + // + // Medium Cycle Market Trends Down ... + false + // () + ; +``` + +```mql4 + // + // Based On MC Market Trend Up ... + // + // Based On MC Market Down Trend ... + // isMCTrendDown + // || isMCFastCrossUnderSlow + // ? + // ( + // + // Find SC Fast Cross Over SC Slow, which happens betweentwo of SC Fast Under SC Slow ... + // isSCFastCrossOverSlow + + // // + // // Find the Moment which Market Middleage Cross Over MC Fast ... + // isMarketMiddleCrossOverMCFast + // // + // // Check Parabolix SAR for Long Trades ... + // && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + // && xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + // // + // // Check Market Middle and Parabolic SAR Distance ... + // && MathAbs(xmaStates[1].marketMiddleage - xmaStates[1].parabolicSAR) >= 1 + // // + // // Check Distance between MCSlow and MCFast bigger than MarketMiddle and Parabolic SAR ... + // && MathAbs(xmaStates[1].mcFast - xmaStates[1].mcSlow) > MathAbs(xmaStates[1].marketMiddleage - xmaStates[1].parabolicSAR) + // ) + // : + // // + // // Based On MC Market Up Trend ... + // false +``` + +```mql4 + // + oscHasLongSignal = + // + oscStates[0].fastOSC > oscStates[0].slowOSC + && ( + ( + oscStates[0].fastOSC > 0.5 + && oscStates[0].fastOSC < 0.75 + ) + || oscStates[0].fastOSC <= 0.5 + ) + && ( + oscStates[0].powerOSC > 0 + || oscStates[1].powerOSC > 0 + ) + // + && xmaStates[0].scFast > xmaStates[0].marketMiddleage + && MathAbs(xmaStates[0].scFast - xmaStates[0].marketMiddleage) > (20 * _Point) + // + && xmaStates[1].scFast > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[1].scFast - xmaStates[1].marketMiddleage) > (20 * _Point) + // + && xmaStates[2].scFast > xmaStates[2].marketMiddleage + // + && xmaStates[0].mcFast > xmaStates[0].mcSlow + && MathAbs(xmaStates[0].mcFast - xmaStates[0].mcSlow) > (50 * _Point) + // + && xmaStates[0].mcFast < xmaStates[0].scFast + && xmaStates[0].mcFast < xmaStates[0].parabolicSAR + // + && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + && xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + // + && !isSharpBullishHappens + // + && longEntryPrice > xmktStates[0].highestLow + && longEntryPrice > xmaStates[0].marketMiddleage + // + && xmktStates[0].highestLow > xmaStates[0].scFast + && xmktStates[0].lowestHigh < xmaStates[0].scFast + && xmktStates[0].lowestHigh < xmaStates[0].marketMiddleage + ; +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` diff --git a/Bkp/Used/14020502/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020502/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..cf8b38d --- /dev/null +++ b/Bkp/Used/14020502/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,710 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_EA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 2; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.0003; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.45; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + static bool tradingPauseAlerted; + + // + allowDoTrade = false; + + // + if (!tradingPauseAlerted) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + + // + tradingPauseAlerted = true; + } + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + lotsPerTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", ProvidedBy: ", GetProviderIdentifier(request.signal.provider), + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // XSignalling ... + if (enableXSignalling) { + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xMaximumCandlesPerTrade, + X_XXX_PROVIDER + ); + } + + // + // XR Signalling ... + if (enableXRSignalling) { + // + if (xrCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xrCloseLongTrades = false; + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xRMaximumCandlesPerTrade, + X_XR_PROVIDER + ); + } + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // START XR Signal Handler ... + // + // + if (enableXRSignalling) { + // + CheckXRSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + CheckXRLongSignalConditions( + bar_index + ); + + // + XSignalRequest xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xrWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + } + } + // + // END XR Signal Handler ... + // + + // + // START X Signal Handler ... + // + // + if (enableXSignalling) { + // + CheckXSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xWaitForLongSignals) { + // + CheckXLongSignalConditions( + bar_index + ); + + // + XSignalRequest xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } + } else { + ClearXLongSignalConditions(); + } + } + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xWaitForShortSignals) { + // + CheckXShortSignalConditions( + bar_index + ); + + // + XSignalRequest xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal + ); + + // + if (isReady && xWaitForShortSignals) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + } else { + ClearXShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020502/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020502/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020502/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020502/Indicators/x-saherelm.xtpow.mq4 b/Bkp/Used/14020502/Indicators/x-saherelm.xtpow.mq4 new file mode 100644 index 0000000..006b37a --- /dev/null +++ b/Bkp/Used/14020502/Indicators/x-saherelm.xtpow.mq4 @@ -0,0 +1,267 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 20.0); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + SetLevelValue(3, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,3,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + double ema = GetMA( + bar_index, + marketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..948d5a7 --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,350 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +static XRState lastXRState; +XRState GetXRange( + const int bar_index, + const int rangeMarketLength +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + rangeMarketLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= rangeMarketLength) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +XTPOWStatee GetXTPowState( + const int bar_index, + const int marketLen +) { + // + XTPOWStatee result = {}; + + // + // + double powerUp = 0; + double powerDown = 0; + double signal = 0; + + // // + // int dailyCount = GetDailyCandleCount(); + // double dailyHH = GetMarketHighestHigh( + // bar_index, + // dailyCount + // ); + // double dailyLL = GetMarketLowestLow( + // bar_index, + // dailyCount + // ); + // double dailyDiff = dailyHH - dailyLL; + // double rate = dailyDiff / 100; + + // // + // for (int i = bar_index; i < bar_index + marketLen; i++) { + // // + // XOHCL c = GetCandleModel(i); + + // // + // double cRange = + // MathAbs(c.open - c.close) + // // MathAbs(c.high - c.low) + // ; + // bool isBullish = c.open < c.close; + + // // + // if (isBullish) { + // powerUp += cRange; + // } else { + // powerDown += cRange; + // } + // } + + // // + // powerUp = powerUp / rate; + // powerDown = powerDown / rate; + + // // + // double ema = GetMA( + // bar_index, + // marketLen, + // 0, + // MODE_EMA, + // PRICE_WEIGHTED + // ); + + // // + // double signalAddition = MathMin(powerUp, powerDown); + // signal = (ema / 100) * rate + signalAddition; + + // + string indicatorName = "x-saherelm.xtpow"; + + // + int pUpIndex = 0; + int pDownIndex = 1; + int signalIndex = 2; + + // + powerUp = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pUpIndex, + bar_index + ); + + // + powerDown = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pDownIndex, + bar_index + ); + + // + signal = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + signalIndex, + bar_index + ); + + // + result.signal = signal; + result.powerUp = powerUp; + result.powerDown = powerDown; + + // + return result; +} +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..e2124e3 --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1604 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +static datetime lastBarTime; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..150bacf --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,137 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +struct XTPOWStatee { + // + double powerUp; + double powerDown; + + // + double signal; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..db67c0c --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1525 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } + + // + return result; +} + +// +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isProviderVerified + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entry + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { + // + ClearXShortSignalConditions(); + // ClearXRShortSignalConditions(); +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..ab23a9d --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,1033 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xStarter = "- X Signal Provider -"; // ---> X Signal Provider <--- + +// +input bool enableXSignalling = true; // X Signalling Enable + +// +input double xR2R = 2.5; // X Risk To Reward Ratio +input int xMaximumCandlesPerTrade = 206; // X Maximum Candles which a Trade can open + +// +input int xOscillatorLength = 7; // X Oscillator Length + +// +input double xPSarStep = 0.02; // X Parabolic Sar Step +input double xPSarMaximum = 0.2; // X Parabolic Sar Maximum + +// +input int xRangeMarketLength = 5; // X Range Detector Length + +// +input int xSwingLength = 7; // X Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XMarketState { + double psar; + double fast; + double slow; + double open; + double verifier; + double oscillator; + double oscillatorVerifier; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; + +// +static XSignalConditions xShortConds; +static bool xCloseShortTrades = false; +static bool xWaitForShortSignals = true; + +// +static double xMaximumDrawDown = 0; + +// +datetime lastVerifierTouched; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + // + if (!enableXSignalling) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); + XTPOWStatee tPowState = GetXTPowState( + bar_index + 1, + xSwingLength + ); + + // + XMarketState state = GetXMarketState( + bar_index + 1 + ); + + // + // Check Verifier Last Touched ... + bool isVerifierTouched = pCandle.high > state.verifier + && pCandle.low < state.verifier; + + // + // Enable Or Disable Long Signalling ... + if (isVerifierTouched) { + // + lastVerifierTouched = barTime; + + // + if (xWaitForLongSignals) { + xWaitForLongSignals = false; + } + + // + if (xWaitForShortSignals) { + xWaitForShortSignals = false; + } + } else { + // + int lastVerifierTouchedBarIndex = iBarShift( + _Symbol, + _Period, + lastVerifierTouched + ); + + // + int distance = MathAbs(lastVerifierTouchedBarIndex - bar_index); + + // + if ( + !xWaitForLongSignals + && distance > (xSwingLength * 2) + ) { + xWaitForLongSignals = true; + } + + // + if ( + !xWaitForShortSignals + && ( + distance > (xSwingLength * 2) + || ( + tPowState.powerDown > tPowState.powerUp + && tPowState.powerDown < 49 + ) + ) + ) { + xWaitForShortSignals = true; + } + } + + // + // Close All Long Open Trades ... + if ( + tPowState.powerDown > 55 + && tPowState.powerDown > tPowState.powerUp + ) { + // xCloseLongTrades = true; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXSignalling + || !xWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXSignalling + || !xWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + xShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!enableXSignalling) { + return result; + } + + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + + // + double reward = risk * xR2R; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + XRState range = GetXRange( + bar_index, + xRangeMarketLength + ); + + // + double affectedValue = range.ll; + xMaximumDrawDown = + affectedValue > xMaximumDrawDown ? + affectedValue : + xMaximumDrawDown; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + if (!enableXSignalling) { + return false; + } + + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.entryTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + // && MathAbs(signalBarIndex - startBarIndex) >= 1 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXShortConditions() { + // + if (!enableXSignalling) { + return false; + } + + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.entryTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.entryTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.entryTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if (!enableXSignalling) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve Range ... + XRState range = GetXRange( + signalBarIndex, + xRangeMarketLength + ); + + // + // Retrive XMarket States ... + XMarketState xState0 = GetXMarketState(signalBarIndex); + XMarketState xState1 = GetXMarketState(signalBarIndex + 1); + XMarketState xState2 = GetXMarketState(signalBarIndex + 2); + + // + // Retrieve Trend Powers ... + XTPOWStatee xTPow0 = GetXTPowState( + signalBarIndex, + xSwingLength + ); + XTPOWStatee xTPow1 = GetXTPowState( + signalBarIndex + 1, + xSwingLength + ); + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (600 * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry < hh + // + // && signal.entry < range.hh + // && signal.entry > range.mid + // // + // && candle.high > xState0.verifier + // && signal.entry > xState0.verifier + // + // && pCandle.low != ll + && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWStatee iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp < iTPowState.powerDown + || iTPowState.signal > MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers > 1 + && tPowUnverifyConditions == 0 + ; + + // + isPSarVerified = + xState0.psar < signal.entry + && xState0.psar < candle.low; + + // + isStateVerified = + // + // Start ... + true + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + xState0.psar > signal.entry + && xState0.psar > candle.high + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry > ll + // && signal.entry < hh - (MathAbs(hh - ll) / 2) + // + // && signal.entry > range.ll + // && signal.entry < range.mid + // + // && candle.high < xState0.verifier + // && signal.entry < xState0.verifier + // + && pCandle.low != ll + // && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWStatee iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp > iTPowState.powerDown + || iTPowState.signal < MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers < 1 + // && ( + // ( + // xTPow0.powerUp > 20 + // || xTPow1.powerUp > 20 + // ) || ( + // (xTPow0.powerUp + xTPow1.powerUp) / 2 > (20 * 2) + // ) + // ) + // && xTPow0.signal < 20 + && tPowUnverifyConditions == 0 + ; + + // + isStateVerified = + // + // Start ... + true + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XMarketState GetXMarketState( + const int bar_index +) { + // + XMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double slow = GetMA( + bar_index, + xSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double oscillator = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + double oscillatorVerifier = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xPSarStep, + xPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.open = open; + result.slow = slow; + result.verifier = verifier; + result.oscillator = oscillator; + result.oscillatorVerifier = oscillatorVerifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/Used/14020502/Libraries/x-saherelm.xr.signal.lib.mq4 b/Bkp/Used/14020502/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..2344d0c --- /dev/null +++ b/Bkp/Used/14020502/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,654 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = false; // XR Signalling Enable + +// +input double xrR2R = 2; // XR Risk To Reward Ratio +input int xRMaximumCandlesPerTrade = 252; // XR Maximum Candles which a Trade can open + +// +input int xrOscillatorLength = 7; // XR Oscillator Length +input int xrFastLength = 20; // XR Fast Length +input int xrSlowLength = 50; // XR Slow Length +input int xrRangeMarketLength = 50; // XR Range Detector Length + +// +input int xrSwingLength = 7; // XR Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + + // + double prevFast; + double prevSlow; + + // + double oscillator; + double prevOscillator; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + // + datetime startTime; + datetime signalTime; + datetime entryTime; + + // + double value; + XRState state; +}; + +// +static XRSignalConditions xrLongConds; +static bool xrCloseLongTrades = false; +static bool xrWaitForLongSignals = true; + +// +static double xrMaximumDrawDown = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if (!enableXRSignalling) { + return; + } + + // + XOHCL candle = GetCandleModel(bar_index); + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + if (xrWaitForLongSignals) { + // + if ( + state.oscillator < state.fast + && state.oscillator < state.slow + && state.prevOscillator < state.prevFast + && state.prevOscillator < state.prevSlow + && candle.low < xrMaximumDrawDown + ) { + // + xrMaximumDrawDown = 0; + xrCloseLongTrades = true; + } + } else { + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if (!enableXRSignalling) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index + 1); + + // + XRState xrState = GetXRange( + bar_index, + xrRangeMarketLength + ); + + // + double affectedValue = xrState.mid; + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + bool isCrossOver = + state.fast > state.slow + && !(state.prevFast > state.prevSlow) + ; + + // + bool isCrossUnder = + state.fast < state.slow + && !(state.prevFast < state.prevSlow) + ; + + // + if ( + isCrossUnder + && xrLongConds.startTime == 0 + ) { + // + xrLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xrLongConds.startTime > 0 + && xrLongConds.signalTime == 0 + ) { + // + xrLongConds.value = affectedValue; + xrLongConds.state = xrState; + + // + xrLongConds.signalTime = barTime; + xrLongConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!enableXRSignalling) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xrSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xrSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = risk * xrR2R; + + // + double sl = requestLong ? + 0 : + ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + xrMaximumDrawDown = + xrMaximumDrawDown == 0 ? + xrLongConds.state.mid : + xrMaximumDrawDown > xrLongConds.state.mid ? + xrMaximumDrawDown : + xrLongConds.state.mid; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXRLongConditions() { + // + if (!enableXRSignalling) { + return false; + } + + // + bool isConditionsFilled = + xrLongConds.startTime > 0 + && xrLongConds.signalTime > 0 + && xrLongConds.entryTime > 0 + // + && xrLongConds.value > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.signalTime + ); + + // + // Count Affected Value Touches ... + int cStartBarIndex = iBarShift( + _Symbol, + _Period, + xrLongConds.state.start + ); + + // + int cEndBarIndex = cStartBarIndex + xrLongConds.state.length; + + // + int highTouched = 0; + int valueTouched = 0; + for (int i = cStartBarIndex; i <= cStartBarIndex + cEndBarIndex; i++) { + // + XOHCL iCandle = GetCandleModel(i); + + // + if ( + iCandle.low < xrLongConds.value + && iCandle.high > xrLongConds.value + ) { + valueTouched++; + } + + // + if ( + iCandle.low < xrLongConds.state.hh + && iCandle.high > xrLongConds.state.hh + ) { + highTouched++; + } + } + + // + isBLFilled = + // + xrLongConds.signalTime > xrLongConds.startTime + && xrLongConds.entryTime >= xrLongConds.signalTime + // + && highTouched < 2 + && valueTouched > (cEndBarIndex - cStartBarIndex) / 6 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xrWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xrLongConds.startTime = 0; + xrLongConds.signalTime = 0; + xrLongConds.entryTime = 0; + + // + xrLongConds.value = 0; + + // + XRState e = {}; + xrLongConds.state = e; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if (!enableXRSignalling) { + return result; + } + + // + XRMarketState state = GetXRMarketState(0); + + // + double fSDif = MathAbs(state.fast - state.slow); + double fSDifP = MathAbs(state.prevFast - state.prevSlow); + + // + double emaSlope = GetSlope( + 1, + state.prevOscillator, + 2, + state.oscillator + ); + + // + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + // Starter ... + true + // + && state.oscillator > state.fast + && emaSlope > 0 + && signal.entry > state.verifier + // + && fSDif > fSDifP + // + && signal.entry < xrLongConds.state.hh + && signal.entry > xrLongConds.state.mid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Prepare Market Length ... + int xrVerifierMarketLength = GetDailyCandleCount(); + + // + // Calculate Fast and Prev Fast ... + // + // Fast ... + double fast = GetMA( + bar_index + 1, + xrFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Fast ... + double prevFast = GetMA( + bar_index + 2, + xrFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Slow and Prev Slow ... + + // + // Slow ... + double slow = GetMA( + bar_index + 1, + xrSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Slow ... + double prevSlow = GetMA( + bar_index + 2, + xrSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Oscillator and Prev Oscillator ... + + // + // Oscillator ... + double oscillator = GetMA( + bar_index, + xrOscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Prev Oscillator ... + double prevOscillator = GetMA( + bar_index + 1, + xrOscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Calculate Verifier ... + double verifier = GetMA( + bar_index, + xrVerifierMarketLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + result.fast = fast; + result.slow = slow; + result.verifier = verifier; + result.prevFast = prevFast; + result.prevSlow = prevSlow; + result.oscillator = oscillator; + result.prevOscillator = prevOscillator; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/Used/14020510/read-conditions.tpw.long.mq4 b/Bkp/Used/14020510/read-conditions.tpw.long.mq4 new file mode 100644 index 0000000..9ac8f51 --- /dev/null +++ b/Bkp/Used/14020510/read-conditions.tpw.long.mq4 @@ -0,0 +1,1074 @@ + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && isHHVerified + && signal.entry < hh + && !isBigSharpOccured + && signal.entry < candle0.high + && MathAbs(signal.entry - hh) > 50 * _Point + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow.signal < MathMax(tPow.powerUp, tPow.powerDown) + ; + + // + isPSarVerified = + // + // Starter ... + true + // + && state0.psar < signal.entry + ; + + // + // bool isLastFastCrossSlowVerified = + // lastFastCrossOverSlowTime > 0 + // && lastFastCrossUnderSlowTime > 0 + // ? + // MathAbs(GetLastFastCrossOverSlowBarIndex() - GetLastFastCrossUnderSlowBarIndex()) > (xTPWSwingLength * 2) + // : + // false + // ; + + // + isStateVerified = + // + // Start ... + true + // + // && state0.fast > state1.fast + // && state1.fast > state2.fast + // + // && state0.rangeFast > state0.rangeSlow + // && state1.rangeFast > state1.rangeSlow + // // + // && state0.rangeWeight > state0.verifier + // && state1.rangeWeight > state1.verifier + // // + // && state0.verifier < state0.rangeSlow + // && state1.verifier < state1.rangeSlow + // + && MathAbs(state0.range - state0.rangeWeight) > 50 * _Point + // + && MathAbs(state0.verifier - state0.rangeWeight) > 50 * _Point + // + // && ( + // lastRangeCrossOverRangeWeightTime > 0 + // && lastRangeCrossUnderRangeWeightTime > 0 + // ? + // // + // MathMin( + // GetLastRangeCrossOverRangeWeightBarIndex(), + // GetLastRangeCrossUnderRangeWeightBarIndex() + // ) - signalBarIndex > xTPWSwingLength + // : + // // + // false + // ) + // + // && ( + // state0.range < state0.verifier + // ? + // // + // false + // : + // // + // ( + // state0.rangeWeight > state0.range + // ? + // // + // MathAbs(state0.rangeWeight - state0.range) <= MathAbs(state0.range - state0.verifier) + // : + // // + // MathAbs(state0.rangeWeight - state0.range) <= MathAbs(state0.range - state0.verifier) + // ) + // ) + // + // // && isLastFastCrossSlowVerified + // && !( + // ll < llState.verifier + // && hh > state0.verifier + // ) + ; + + +// // +// datetime lastPriceOverVerifierTime; +// datetime lastFastCrossOverSlowTime; +// datetime lastPriceUnderVerifierTime; +// datetime lastPriceTouchVerifierTime; +// datetime lastFastCrossUnderSlowTime; +// datetime lastRangeCrossOverVerifierTime; +// datetime lastRangeCrossUnderVerifierTime; +// datetime lastRangeCrossOverRangeWeightTime; +// datetime lastRangeCrossUnderRangeWeightTime; +// datetime lastRangeWeightCrossOverVerifierTime; +// datetime lastRangeWeightCrossUnderVerifierTime; + +// // +// datetime lastTPowAboveMaxVerifierTime; + +// // +// // Find Crosses between fast and slow ... + +// // +// bool isFastCrossOverSlow = +// state1.fast > state1.slow +// && !(state2.fast > state2.slow) +// ; +// if (isFastCrossOverSlow) { +// lastFastCrossOverSlowTime = barTime; +// } + +// // +// bool isFastCrossUnderSlow = +// state1.fast < state1.slow +// && !(state2.fast < state2.slow) +// ; +// if (isFastCrossUnderSlow) { +// lastFastCrossUnderSlowTime = barTime; +// } + +// // +// // Find Range and Verifier Cross ... + +// // +// bool isRangeCrossOverVerifier = +// state1.range > state1.verifier +// && !(state2.range > state2.verifier) +// ; +// if (isRangeCrossOverVerifier) { +// lastRangeCrossOverVerifierTime = barTime; +// } + +// // +// bool isRangeCrossUnderVerifier = +// state1.range < state1.verifier +// && !(state2.range < state2.verifier) +// ; +// if (isRangeCrossUnderVerifier) { +// lastRangeCrossUnderVerifierTime = barTime; +// } + +// // +// // Find Crosses between range and rangeWeight ... + +// // +// bool isRangeCrossOverRangeWeight = +// state1.range > state1.rangeWeight +// && !(state2.range > state2.rangeWeight) +// ; +// if (isRangeCrossOverRangeWeight) { +// lastRangeCrossOverRangeWeightTime = barTime; +// } + +// // +// bool isRangeCrossUnderRangeWeight = +// state1.range < state1.rangeWeight +// && !(state2.range < state2.rangeWeight) +// ; +// if (isRangeCrossUnderRangeWeight) { +// lastRangeCrossUnderRangeWeightTime = barTime; +// } + +// // +// // Find RangeWeight and Verifier Cross ... + +// // +// bool isRangeWehigthCrossOverVerifier = +// state1.rangeWeight > state1.verifier +// && !(state2.rangeWeight > state2.verifier) +// ; +// if (isRangeWehigthCrossOverVerifier) { +// lastRangeWeightCrossOverVerifierTime = barTime; +// } + +// // +// bool isRangeWeightCrossUnderVerifier = +// state1.rangeWeight < state1.verifier +// && !(state2.rangeWeight < state2.verifier) +// ; +// if (isRangeWeightCrossUnderVerifier) { +// lastRangeWeightCrossUnderVerifierTime = barTime; +// } + +// // +// // Find Price Crosses by Verifier ... + +// // +// bool isPriceOverVerifier = +// candle1.low > state1.verifier +// && !(candle2.low > state1.verifier) +// ; +// if (isPriceOverVerifier) { +// lastPriceOverVerifierTime = barTime; +// } + +// // +// bool isPriceUnderVerifier = +// candle1.high < state1.verifier +// && !(candle2.high < state1.verifier) +// ; +// if (isPriceUnderVerifier) { +// lastPriceUnderVerifierTime = barTime; +// } + +// // +// bool isPriceTouchVerifier = +// isPriceOverVerifier +// || isPriceUnderVerifier +// ; + +// // +// if (isPriceTouchVerifier) { +// lastPriceTouchVerifierTime = barTime; +// } + +// // +// bool isTPowUpperBelowMaxVerifier = MathMax(tPow1.powerUp, tPow1.powerDown) < tPowerMaxVerifier; +// bool isTPowUpperAboveMaxVerifier = MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier; +// if (isTPowUpperAboveMaxVerifier) { +// lastTPowAboveMaxVerifierTime = barTime; +// } + +// // +// int GetLastFastCrossOverSlowBarIndex() { +// // +// int result = -1; + +// // +// if (lastFastCrossOverSlowTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastFastCrossOverSlowTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastFastCrossUnderSlowBarIndex() { +// // +// int result = -1; + +// // +// if (lastFastCrossUnderSlowTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastFastCrossUnderSlowTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeCrossOverVerifierBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeCrossOverVerifierTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeCrossOverVerifierTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeCrossUnderVerifierBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeCrossUnderVerifierTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeCrossUnderVerifierTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeCrossOverRangeWeightBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeCrossOverRangeWeightTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeCrossOverRangeWeightTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeCrossUnderRangeWeightBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeCrossUnderRangeWeightTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeCrossUnderRangeWeightTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeWeightCrossOverVerifierBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeWeightCrossOverVerifierTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeWeightCrossOverVerifierTime +// ); +// } + +// // +// return result; +// } + +// // +// int GetLastRangeWeightCrossUnderVerifierBarIndex() { +// // +// int result = -1; + +// // +// if (lastRangeWeightCrossUnderVerifierTime > 0) { +// // +// result = iBarShift( +// _Symbol, +// _Period, +// lastRangeWeightCrossUnderVerifierTime +// ); +// } + +// // +// return result; +// } + + + // // + // // Detect Sharp Changes ... + // double ll = GetMarketLowestLow( + // bar_index, + // xTPWSwingLength + // ); + // double sharpDetectionValue = + // xTPWSharpDetectionFactor * _Point; + // double isSharpDetectionOccured = + // MathAbs(candle0.low - ll) > sharpDetectionValue + // ; + + // // + // // Retrieve State Min and Max ... + // double stateMin0 = GetXTPWStateMin(state0); + // double stateMax0 = GetXTPWStateMax(state0); + // bool isStateDistanceValid = + // MathAbs(stateMax0 - stateMin0) < sharpDetectionValue; + + // // + // // Fast Slow Verification ... + // // + // double topBound = MathMax(state1.range, state1.rangeWeight); + // topBound = MathMax(topBound, state1.verifier); + + // // + // double bottomBound = MathMin(state1.range, state1.rangeWeight); + // bottomBound = MathMin(bottomBound, state1.verifier); + + // + // bool isFastSlowValid = + // ( + // state1.fast > topBound + // || state1.fast < bottomBound + // ) && ( + // state1.slow > topBound + // || state1.slow < bottomBound + // ); + + // + bool longCondition1 = + // + // Condition 1 ... + true + // + && tPow0.powerDown > tPow0.powerUp + && state0.range > state0.verifier + && state1.range > state1.verifier + && state1.range > state1.rangeWeight + && tPow0.powerDown > tPow1.powerDown + && tPow1.powerDown > tPowerMaxVerifier + && tPow2.powerDown < tPowerMaxVerifier + && state1.rangeWeight > state1.verifier + && !( + ( + candle1.high > state1.verifier + && candle1.low < state1.verifier + ) || ( + candle1.low > state1.verifier + ) + ) + ; + + // + bool longCondition2 = + // + // Condition 2 ... + true + // + && tPow0.powerUp > tPow0.powerDown + && tPow1.powerUp > tPow1.powerDown + && tPow2.powerUp > tPow2.powerDown + && tPow1.powerUp < tPowerVerifier + // + && state1.fast > state1.slow + && state1.range > state1.verifier + && state0.fast < state0.rangeWeight + && state1.fast < state1.rangeWeight + && state1.rangeWeight > state1.range + && MathAbs(state1.rangeWeight - state1.range) > + (MathAbs(state1.range - state1.verifier) / 2) + // + && candle0.low > state0.verifier + && candle1.low > state1.verifier + ; + + // + bool longCondition3 = + // + // Condition 3 ... + true + // + && isCrossOver + && state0.fast >= state2.fast + && state1.psar < candle1.low + && state1.verifier < state1.fast + // + && MathMax(tPow1.powerUp, tPow1.powerDown) < tPowerMaxVerifier + ; + + +// +// Get Minimum value of State ... +double GetXTPWStateMin( + const XTPWMarketState &state +) { + // + double result = 0; + + // + result = state.psar; + result = MathMin(result, state.fast); + result = MathMin(result, state.slow); + result = MathMin(result, state.range); + result = MathMin(result, state.verifier); + result = MathMin(result, state.rangeWeight); + + // + return result; +} + +// +// Get Maximum value of State ... +double GetXTPWStateMax( + const XTPWMarketState &state +) { + // + double result = 0; + + // + result = state.psar; + result = MathMax(result, state.fast); + result = MathMax(result, state.slow); + result = MathMax(result, state.range); + result = MathMax(result, state.verifier); + result = MathMax(result, state.rangeWeight); + + // + return result; +} + + +// +// + // + // Count range weight Crosses ... + if ( + // + // Range Weight Cross Over Verifier ... + ( + iState1.rangeWeight > iState1.verifier + && !(iState2.rangeWeight > iState2.verifier) + ) + || + // + // Range Weight Cross Under Verifier ... + ( + iState1.rangeWeight < iState1.verifier + && !(iState2.rangeWeight < iState2.verifier) + ) + || + // + // Range Weight Cross Over Range ... + ( + iState1.rangeWeight > iState1.range + && !(iState2.rangeWeight > iState2.range) + ) + || + // + // Range Weight Cross Under Range ... + ( + iState1.rangeWeight < iState1.range + && !(iState2.rangeWeight < iState2.range) + ) + ) { + rangeWeightCrosses++; + } + + // + // Count Price above range ... + if ( + iCandle.low > iState1.range + || ( + iCandle.low < iState1.range + && iCandle.high > iState1.range + ) + ) { + // + priceAboveRange++; + } + + // + // Count Price above verifier ... + if ( + iCandle.low > iState1.verifier + || ( + iCandle.low < iState1.verifier + && iCandle.high > iState1.verifier + ) + ) { + // + priceAboveVerifier++; + } + + // + // Count between Range and Verifier ... + double vUpper = MathMax(iState0.range, iState0.verifier); + double vDowner = MathMin(iState0.range, iState0.verifier); + if ( + !( + iState0.fast > vUpper + && iState0.slow > vUpper + ) + && + !( + iState0.fast < vDowner + && iState0.slow < vDowner + ) + ) { + fastAndSlowBetweenRangeAndVerifier++; + } + +// +// Short ... + // + if ( + !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPower State ... + XTPOWStatee tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWStatee tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWStatee tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPWMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + bool isTPowUp = tPow2.powerUp > tPow2.powerDown; + + // + double tPowUpper = MathMax(tPow2.powerUp, tPow2.powerDown); + + // + bool startCondition = false; + bool signalCondition = false; + + // + startCondition = + // + true + // + && tPow2.powerDown > tPowerVerifier + ; + + // + signalCondition = + // + true + // + && tPow1.powerDown > tPow2.powerDown + && tPow1.powerDown > tPowerMaxVerifier + ; + + // // + // bool isCrossOver = + // state1.fast > state1.slow + // && !(state2.fast > state2.slow) + // ; + + // // + // bool isCrossUnder = + // state0.fast < state0.slow + // && state1.fast < state1.slow + // && !(state2.fast < state2.slow) + // ; + + // + double tPowerMedian = tPowerMaxVerifier - tPowerVerifier / 2; + + // + bool signalCondition1 = + isCrossUnder + ; + + // + bool signalCondition2 = + // + tPow0.powerDown > tPow0.powerUp + // + && tPow1.powerDown > tPow1.powerUp + && tPow2.powerDown > tPow2.powerUp + // + && tPow0.powerDown > tPowerMedian + && tPow1.powerDown > tPowerMedian + && tPow2.powerDown > tPowerMedian + // + && tPow0.signal > tPow0.powerDown + ; + + // + if ( + ( + ( + startCondition + && signalCondition + ) || ( + signalCondition1 + || signalCondition2 + ) + ) + && xTPWShortConds.startTime == 0 + && xTPWShortConds.signalTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + + // + return; + } + + +// +// Short ... + // + isPSarVerified = + // + // Starter ... + true + // + && state0.psar > candle0.high + && state0.psar > signal.entry + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && priceAboveRange < 1 + && priceAboveVerifier == 0 + ; + + // + // Find Minimum Value of HH BarIndex Market State rangeWeight and verifier ... + double hhValidationValue = MathMin( + hhState.rangeWeight, + hhState.verifier + ); + bool isHHValidForShortSignal = + hh < hhValidationValue + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && isHHValidForShortSignal + // + && aboveTPowerMaxVerifier < 4 + ; + + // + isStateVerified = + // + // Start ... + true + // + && rangeWeightCrosses == 0 + // + && state0.slow > state0.fast + // + && state0.range < state0.verifier + // + && state0.rangeWeight > state0.range + && state0.rangeWeight < state0.verifier + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + + // // + // int aboveTPowerVerifier = 0; + // int abovePowerUpTPowerVerifier = 0; + // int abovePowerDownTPowerVerifier = 0; + + // // + // int aboveTPowerMaxVerifier = 0; + // int abovePowerUpTPowerMaxVerifier = 0; + // int abovePowerDownTPowerMaxVerifier = 0; + + // // + // int belowTPowerVerifier = 0; + // int belowPowerUpTPowerVerifier = 0; + // int belowPowerDownTPowerVerifier = 0; + + // // + // int belowTPowerMaxVerifier = 0; + // int belowPowerUpTPowerMaxVerifier = 0; + // int belowPowerDownTPowerMaxVerifier = 0; + + // // + // double powerUpSum = 0; + // double powerDownSum = 0; + + // // + // int priceAboveRange = 0; + // int priceAboveVerifier = 0; + // int fastAndSlowBetweenRangeAndVerifier = 0; + + // // + // int rangeWeightCrosses = 0; + + // // + // for (int i = signalBarIndex; i < signalBarIndex + xTPWSwingLength; i++) { + // // + // XOHCL iCandle = GetCandleModel(i); + + // // + // XTPOWStatee iTPow = GetXTPowState( + // i, + // xTPWSwingLength + // ); + + // // + // double isTPowUp = iTPow.powerUp > iTPow.powerDown; + + // // + // double tPowUpper = MathMax(iTPow.powerUp, iTPow.powerDown); + + // // + // // Summarise ... + // powerUpSum += iTPow.powerUp; + // powerDownSum += iTPow.powerDown; + + // // + // XTPWMarketState iState0 = GetXTPWMarketState( + // i + // ); + // XTPWMarketState iState1 = GetXTPWMarketState( + // i + 1 + // ); + // XTPWMarketState iState2 = GetXTPWMarketState( + // i + 2 + // ); + + + // // + // // Count Above TPow Verifier ... + // if (tPowUpper > tPowerVerifier) { + // // + // aboveTPowerVerifier++; + + // // + // if (isTPowUp) { + // abovePowerUpTPowerVerifier++; + // } else { + // abovePowerDownTPowerVerifier++; + // } + // } else if (tPowUpper < tPowerVerifier) { + // // + // belowTPowerVerifier++; + + // // + // if (isTPowUp) { + // belowPowerUpTPowerVerifier++; + // } else { + // belowPowerDownTPowerVerifier++; + // } + // } + + // // + // // Count Above TPow Max Verifier ... + // if (tPowUpper > tPowerMaxVerifier) { + // // + // aboveTPowerMaxVerifier++; + + // // + // if (isTPowUp) { + // abovePowerUpTPowerMaxVerifier++; + // } else { + // abovePowerDownTPowerMaxVerifier++; + // } + // } else if (tPowUpper < tPowerMaxVerifier) { + // // + // belowTPowerMaxVerifier++; + + // // + // if (isTPowUp) { + // belowPowerUpTPowerMaxVerifier++; + // } else { + // belowPowerDownTPowerMaxVerifier++; + // } + // } + // } + + + + // // + // int doubleMarketLength = (xTPWSwingLength * 2); + // int verifierLength = GetDailyCandleCount(); + // int rangeLength = verifierLength / 2; + + // // + // // Find Highest High ... + + // // + // double rangeHH = GetMarketHighestHigh( + // signalBarIndex, + // rangeLength + // ); + + // // + // double verifierHH = GetMarketHighestHigh( + // signalBarIndex, + // verifierLength + // ); + + // // + // // Find HH Bar Index ... + // int hhBarIndex = iHighest( + // _Symbol, + // _Period, + // MODE_HIGH, + // xTPWSwingLength, + // signalBarIndex + // ); + + // // + // // Find HH ... + // double hh = iHigh( + // _Symbol, + // _Period, + // hhBarIndex + // ); + + // // + // // Retrieve Market State on HH Bar Index ... + // XTPWMarketState hhState = GetXTPWMarketState( + // hhBarIndex + // ); + + // // + // // Retrieve TPow State on HH Bar Index ... + // XTPOWStatee hhTPow = GetXTPowState( + // hhBarIndex, + // xTPWSwingLength + // ); + + // // + // // Find Lowest Low ... + + // // + // double rangeLL = GetMarketLowestLow( + // signalBarIndex, + // rangeLength + // ); + + // // + // double verifierLL = GetMarketLowestLow( + // signalBarIndex, + // verifierLength + // ); + + // // + // // Find LL Bar Index ... + // int llBarIndex = iLowest( + // _Symbol, + // _Period, + // MODE_LOW, + // xTPWSwingLength, + // signalBarIndex + // ); + + // // + // // Find LL ... + // double ll = iLow( + // _Symbol, + // _Period, + // llBarIndex + // ); + + // // + // // Retrieve Market State on LL Bar Index ... + // XTPWMarketState llState = GetXTPWMarketState(llBarIndex); + + // // + // // Retrieve TPow State on LL Bar Index ... + // XTPOWStatee llTPow = GetXTPowState( + // llBarIndex, + // xTPWSwingLength + // ); + + // // + // // Find Sharp Changes ... + // double diffChange = (hh - ll); + // double sharpDetectionValue = + // (xTPWSharpDetectionFactor * _Point); + // bool isBigSharpOccured = + // diffChange > sharpDetectionValue; + // ; + + // // + // bool isHHVerified = + // !( + // hh == rangeHH + // && rangeHH == verifierHH + // ) + // || + // ( + // hh > rangeHH + // || hh > verifierHH + // ); + + // // + // bool isLLVerified = + // !( + // ll == rangeLL + // && rangeLL == verifierLL + // ) + // || + // ( + // ll < rangeLL + // || ll < verifierLL + // ); diff --git a/Bkp/Used/14020512/Experts/x-saherelm.ea.mq4 b/Bkp/Used/14020512/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..e7b7141 --- /dev/null +++ b/Bkp/Used/14020512/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,1004 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_EA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 7; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = false; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + maxOpenTrades <= 0 + || maxEquityPercent < 0 + || minBalancePercent < 0 + || lotsPerTradePercent < 0 + || maxDrawdownPercentPerPTrade < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + static bool tradingPauseAlerted; + + // + allowDoTrade = false; + + // + if (!tradingPauseAlerted) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + + // + tradingPauseAlerted = true; + } + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + // Retrieve Signal Lots Per Trade ... + double lPTradePercent = GetSignalLottage( + request.signal, + lotsPerTradePercent + ); + + // + bool isPositionOpened = TradeSignal( + request.signal, + lPTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", ProvidedBy: ", GetSignalProviderIdentifier(request.signal.provider), + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // XSignalling ... + if (enableXSignalling) { + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + if (xCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XXX_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XXX_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xMaximumCandlesPerTrade, + X_XXX_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xFailedSignals++; + } + } + + // + // XR Signalling ... + if (enableXRSignalling) { + // + if (xRCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xRCloseLongTrades = false; + } + + // + if (xRCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XR_PROVIDER); + + // + xRCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XR_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XR_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xRMaximumCandlesPerTrade, + X_XR_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xRFailedSignals++; + } + } + + // + // XTPW Signalling ... + if (enableXTPWSignalling) { + // + if (xTPWCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XTPW_PROVIDER); + + // + xTPWCloseLongTrades = false; + } + + // + if (xTPWCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xTPWCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XTPW_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XTPW_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xTPWMaximumCandlesPerTrade, + X_XTPW_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xTPWFailedSignals++; + } + } + + // + // Close Maximum DrawDown Passed Trades ... + // this is the Maximum Controller ... + // + double maxOfXPercent = enableXSignalling ? + MathMax( + xLongMaxDrawdownPerTradePercent, + xShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXRPercent = enableXRSignalling ? + MathMax( + xRLongMaxDrawdownPerTradePercent, + xRShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXTPWPercent = enableXTPWSignalling ? + MathMax( + xTPWLongMaxDrawdownPerTradePercent, + xTPWShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxDrawDownPercent = MathMax( + maxOfXPercent, + maxOfXRPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxOfXTPWPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxDrawdownPercentPerPTrade + ); + + // + // we Calculate Max DrawDown Percent Per Trade ... + // then try to Close based on them ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawDownPercent + ); +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Define Template Signal Requests for Managing Multiple Signals ... + // + // X ... + XSignalRequest xLongSignalRequest = {}; + XSignalRequest xShortSignalRequest = {}; + // + // XR ... + XSignalRequest xrLongSignalRequest = {}; + XSignalRequest xrShortSignalRequest = {}; + // + // XTPW ... + XSignalRequest xTPWLongSignalRequest = {}; + XSignalRequest xTPWShortSignalRequest = {}; + + // + // START XR Signal Handler ... + // + // + if (enableXRSignalling) { + // + CheckXRSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xRWaitForLongSignals) { + // + CheckXRLongSignalConditions( + bar_index + ); + + // + xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xRWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + } else { + ClearXRLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + } + } + // + // END XR Signal Handler ... + // + + // + // START XTPW Signal Handler ... + // + if (enableXTPWSignalling) { + // + CheckXTPWSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xTPWWaitForLongSignals) { + // + CheckXTPWLongSignalConditions( + bar_index + ); + + // + xTPWLongSignalRequest = GenerateXTPWSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xTPWLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWLongSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForLongSignals) { + // + hasLongSignal = true; + signal = xTPWLongSignalRequest.signal; + } else { + ClearXTPWLongSignalConditions(); + } + } + } else { + ClearXTPWLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xTPWWaitForShortSignals) { + // + CheckXTPWShortSignalConditions( + bar_index + ); + + // + xTPWShortSignalRequest = GenerateXTPWSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xTPWShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWShortSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForShortSignals) { + // + hasShortSignal = true; + signal = xTPWShortSignalRequest.signal; + } else { + ClearXTPWShortSignalConditions(); + } + } + } else { + ClearXTPWShortSignalConditions(); + } + } + } + // + // END XTPW Signal Handler ... + // + + // + // START X Signal Handler ... + // + // + if (enableXSignalling) { + // + CheckXSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xWaitForLongSignals) { + // + CheckXLongSignalConditions( + bar_index + ); + + // + xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } + } else { + ClearXLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xWaitForShortSignals) { + // + CheckXShortSignalConditions( + bar_index + ); + + // + xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal + ); + + // + if (isReady && xWaitForShortSignals) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + } else { + ClearXShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/Used/14020512/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/14020512/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/14020512/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Indicators/x-saherelm.xrange.mq4 b/Bkp/Used/14020512/Indicators/x-saherelm.xrange.mq4 new file mode 100644 index 0000000..1359f57 --- /dev/null +++ b/Bkp/Used/14020512/Indicators/x-saherelm.xrange.mq4 @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XRange Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XRange Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 14; +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_plots 3 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Middle Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +#define highestHighBufferIndex 0 +#define lowestLowBufferIndex 1 +#define middleBufferIndex 2 + +// +double highestHighBuffer[]; +double lowestLowBuffer[]; +double middleBuffer[]; + +// +datetime startTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + string hhLbl = StringConcatenate( + "XR HH(", marketLength, ")" + ); + SetIndexBuffer(highestHighBufferIndex, highestHighBuffer); + SetIndexLabel(highestHighBufferIndex, hhLbl); + + // + string llLbl = StringConcatenate( + "XR LL(", marketLength, ")" + ); + SetIndexBuffer(lowestLowBufferIndex, lowestLowBuffer); + SetIndexLabel(lowestLowBufferIndex, llLbl); + + // + string midLbl = StringConcatenate( + "XR Mid(", marketLength, ")" + ); + SetIndexBuffer(middleBufferIndex, middleBuffer); + SetIndexLabel(middleBufferIndex, midLbl); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculations ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculations ... +void CalculateBuffers( + const int &bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + SetIndicatorBuffersNone(bar_index); + return; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + int startDistance = startBarIndex - bar_index; + if (startDistance < marketLength) { + // + SetIndicatorBuffersNone(bar_index); + return; + } + + // + // Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + bar_index + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + highestHighBuffer[bar_index] = hh; + + // + // Lowest Low ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + bar_index + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + lowestLowBuffer[bar_index] = ll; + + // + // Middle Buffer ... + double mid = (hh + ll) / 2; + middleBuffer[bar_index] = mid; + + // + // Reset Start Time ... + startTime = 0; +} + +// +void SetIndicatorBuffersNone( + const int bar_index +) { + // + int lastBarIndex = bar_index + 1; + + // + double lastHighestHigh; + double lastLowestLow; + + // + // Highest High ... + if (ArraySize(highestHighBuffer) > lastBarIndex) { + lastHighestHigh = highestHighBuffer[lastBarIndex]; + } else { + lastHighestHigh = 0; + } + + // + // Lowest Low ... + if (ArraySize(lowestLowBuffer) > lastBarIndex) { + lastLowestLow = lowestLowBuffer[lastBarIndex]; + } else { + lastLowestLow = 0; + } + + // + highestHighBuffer[bar_index] = lastHighestHigh; + lowestLowBuffer[bar_index] = lastLowestLow; + + // + double mid = (lastHighestHigh + lastLowestLow) / 2; + middleBuffer[bar_index] = mid; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Indicators/x-saherelm.xtpow.mq4 b/Bkp/Used/14020512/Indicators/x-saherelm.xtpow.mq4 new file mode 100644 index 0000000..46ff59e --- /dev/null +++ b/Bkp/Used/14020512/Indicators/x-saherelm.xtpow.mq4 @@ -0,0 +1,275 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 20.0); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + SetLevelValue(3, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,3,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + int doubleMarketLength = (marketLength * 2); + double ema = GetMA( + bar_index, + doubleMarketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double emaRate = GetMarketHighestHigh(bar_index, doubleMarketLength) - GetMarketLowestLow(bar_index, doubleMarketLength) / 100; + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..776cde4 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,2010 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Draw Highest High ... +bool DrawHighestHigh( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrAqua, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_HH(", marketLen ,")_", + hh, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + hhTime, + hh, + drawUntilTime, + hh, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Lowest Low ... +bool DrawLowestLow( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrFuchsia, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_LL(", marketLen ,")_", + ll, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + llTime, + ll, + drawUntilTime, + ll, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Market Middle ... +bool DrawMarketMiddle( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrYellow, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + double middle = ll + ((hh - ll) / 2); + datetime middleTime = hhIdx < llIdx + ? hhTime + : llTime + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_MID(", marketLen ,")_", + middle, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + middleTime, + middle, + drawUntilTime, + middle, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..4605408 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,375 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Reading specified Buffer From ADX Indicator ... +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading specified Buffer from XHL Indicator ... +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading ADX Values ... +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +// Calculate XRange from Market ... +static XRState lastXRState; +XRState GetXRange( + const int bar_index, + const int rangeMarketLength +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + rangeMarketLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= rangeMarketLength) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +// Reading XTPowState from Indicatoe ... +XTPOWState GetXTPowState( + const int bar_index, + const int marketLen +) { + // + XTPOWState result = {}; + + // + // + double powerUp = 0; + double powerDown = 0; + double signal = 0; + + // + string indicatorName = "x-saherelm.xtpow"; + + // + int pUpIndex = 0; + int pDownIndex = 1; + int signalIndex = 2; + + // + powerUp = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pUpIndex, + bar_index + ); + + // + powerDown = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pDownIndex, + bar_index + ); + + // + signal = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + signalIndex, + bar_index + ); + + // + result.signal = signal; + result.powerUp = powerUp; + result.powerDown = powerDown; + + // + return result; +} + +// +// Reading XRState From Indicator ... +XRState ReadXRange( + const int bar_index, + const int marketLen +) { + // + XRState result = {}; + + // + // Define Buffer Indexes ... + int hhBufferIndex = 0; + int llBufferIndex = 1; + int midBufferIndex = 2; + + // + string indicatorName = "x-saherelm.xrange"; + + // + // Read Values From XRange Indicator ... + + // + double hh = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + hhBufferIndex, // Buffer Index ... + bar_index + ); + + // + double ll = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + llBufferIndex, // Buffer Index ... + bar_index + ); + + // + double mid = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + midBufferIndex, // Buffer Index ... + bar_index + ); + + // + // Filling Result ... + result.hh = hh; + result.ll = ll; + result.mid = mid; + + // + return result; +} +// +// END Indicator Reading Data ... +// diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..cc0e23e --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1662 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +static datetime lastBarTime; + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +struct XPrice { + // + double askPrice; + double bidPrice; + double priceGap; + + // + double longEntry; + double longExit; + + // + double shortEntry; + double shortExit; +}; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// Retrieve Moving Average ... +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Retrieve Market Current Prices for Signals ... +XPrice GetPrice() { + // + XPrice result = {}; + + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(bidPrice - askPrice); + + // + result.askPrice = askPrice; + result.bidPrice = bidPrice; + result.priceGap = priceGap; + + // + result.longEntry = askPrice; + result.longExit = bidPrice; + + // + result.shortEntry = bidPrice; + result.shortExit = askPrice; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.models.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..1ade462 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,138 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER, + X_XTPW_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +struct XTPOWState { + // + double powerUp; + double powerDown; + + // + double signal; +}; +// +// End Models ... +// diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..c85d593 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1755 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" +#include "../Libraries/x-saherelm.xtpw.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetSignalProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + case X_XTPW_PROVIDER: + result = "XTPW"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetSignalProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XTPW_PROVIDER) + ) > -1 + ) { + result = X_XTPW_PROVIDER; + } + + // + return result; +} + +// +// Retrieve Signal Lots Per Trade ... +double GetSignalLottage( + const XSignal &signal, + const double defLotsPerTrade +) { + // + double result = defLotsPerTrade; + + // + bool isLong = signal.type == X_SIGNAL_LONG; + + // + switch (signal.provider) { + // + case X_XR_PROVIDER: + // + result = isLong ? + xRLongLotsPerTradePercent : + xRShortLotsPerTradePercent + ; + break; + + // + case X_XXX_PROVIDER: + // + result = isLong ? + xLongLotsPerTradePercent : + xShortLotsPerTradePercent + ; + break; + + // + case X_XTPW_PROVIDER: + // + result = isLong ? + xTPWLongLotsPerTradePercent : + xTPWShortLotsPerTradePercent + ; + break; + } + + // + return result; +} + +// +// Draw Specific Range On Chart ... +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetSignalProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetSignalProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetSignalProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetSignalProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_LONG + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderShortTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_SHORT + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isProviderVerified + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade, + const ENUM_X_SIGNAL_TYPE type = X_SIGNAL_NONE, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + string comment = OrderComment(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + bool isTypeVerified = + type == X_SIGNAL_NONE ? + true : + ( isLongOrder + && type == X_SIGNAL_LONG + ) || ( + !isLongOrder + && type == X_SIGNAL_SHORT + ) + ; + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isTypeVerified + && isProviderVerified + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + ( + openPrice < signal.entry + || MathAbs(openPrice - signal.entry) < 300 * _Point + ) + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); + ClearXTPWLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { + // + ClearXShortSignalConditions(); + ClearXTPWShortSignalConditions(); +} +// +// END Signal Conditions ... +// diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..84a2e13 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,1063 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xStarter = "- X Signal Provider -"; // ---> X Signal Provider <--- + +// +input bool enableXSignalling = true; // X Signalling Enable + +// +input bool enableXLong = true; // X Signalling Enable Long +input bool enableXShort = true; // X Signalling Enable Short + +// +input double xShortR2R = 3; // X Short Risk To Reward Ratio +input double xShortLotsPerTradePercent = 0.00001; // X Lots Percent per Short Trades +input double xShortMaxDrawdownPerTradePercent = 0.02; // X Max Allowed DrawDown Percent per Short Trade + +// +input double xLongR2R = 3; // X Long Risk To Reward Ratio +input double xLongLotsPerTradePercent = 0.00001; // X Lots Percent per Short Trades +input double xLongMaxDrawdownPerTradePercent = 0.02; // X Max Allowed DrawDown Percent per Long Trade + +// +input double xSharpDetectorFactor = 700; // X Sharp Detection Factor + +// +input int xMaximumCandlesPerTrade = 206; // X Maximum Candles which a Trade can open + +// +input int xOscillatorLength = 7; // X Oscillator Length + +// +input double xPSarStep = 0.02; // X Parabolic Sar Step +input double xPSarMaximum = 0.2; // X Parabolic Sar Maximum + +// +input int xRangeMarketLength = 5; // X Range Detector Length + +// +input int xSwingLength = 7; // X Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XMarketState { + double psar; + double fast; + double slow; + double open; + double verifier; + double oscillator; + double oscillatorVerifier; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; + +// +static XSignalConditions xShortConds; +static bool xCloseShortTrades = false; +static bool xWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xFailedSignals = 0; + +// +datetime lastVerifierTouched; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); + XTPOWState tPowState = GetXTPowState( + bar_index + 1, + xSwingLength + ); + + // + XMarketState state = GetXMarketState( + bar_index + 1 + ); + + // + // Check Verifier Last Touched ... + bool isVerifierTouched = pCandle.high > state.verifier + && pCandle.low < state.verifier; + + // + // Disable Signals if a signal Failed ... + if (xFailedSignals) { + // + // TODO: Complete this ... + } + + // + // Enable Or Disable Signalling ... + if (isVerifierTouched) { + // + lastVerifierTouched = barTime; + + // + if (xWaitForLongSignals) { + xWaitForLongSignals = false; + } + + // + if (xWaitForShortSignals) { + xWaitForShortSignals = false; + } + } else { + // + int lastVerifierTouchedBarIndex = iBarShift( + _Symbol, + _Period, + lastVerifierTouched + ); + + // + int distance = MathAbs(lastVerifierTouchedBarIndex - bar_index); + + // + if ( + !xWaitForLongSignals + && distance > (xSwingLength * 2) + ) { + xWaitForLongSignals = true; + } + + // + if ( + !xWaitForShortSignals + && ( + distance > (xSwingLength * 2) + || ( + tPowState.powerDown > tPowState.powerUp + && tPowState.powerDown < 49 + ) + ) + ) { + xWaitForShortSignals = true; + } + } + + // + // Close All Long Open Trades ... + if ( + tPowState.powerDown > 55 + && tPowState.powerDown > tPowState.powerUp + ) { + // xCloseLongTrades = true; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXLong + || !enableXSignalling + || !xWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXShort + || !enableXSignalling + || !xWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + xShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double reward = + requestLong ? + risk * xLongR2R : + risk * xShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + XRState range = GetXRange( + bar_index, + xRangeMarketLength + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + if ( + !enableXLong + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.entryTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + // && MathAbs(signalBarIndex - startBarIndex) >= 1 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXShortConditions() { + // + if ( + !enableXShort + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.entryTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.entryTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.entryTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve Range ... + XRState range = GetXRange( + signalBarIndex, + xRangeMarketLength + ); + + // + // Retrive XMarket States ... + XMarketState xState0 = GetXMarketState(signalBarIndex); + XMarketState xState1 = GetXMarketState(signalBarIndex + 1); + XMarketState xState2 = GetXMarketState(signalBarIndex + 2); + XMarketState xStateLast = GetXMarketState(signalBarIndex + xSwingLength); + + // + // Retrieve Trend Powers ... + XTPOWState xTPow0 = GetXTPowState( + signalBarIndex, + xSwingLength + ); + XTPOWState xTPow1 = GetXTPowState( + signalBarIndex + 1, + xSwingLength + ); + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (xSharpDetectorFactor * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry < hh + // + // && signal.entry < range.hh + // && signal.entry > range.mid + // // + // && candle.high > xState0.verifier + // && signal.entry > xState0.verifier + // + // && pCandle.low != ll + && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp < iTPowState.powerDown + || iTPowState.signal > MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers > 1 + && tPowUnverifyConditions == 0 + ; + + // + isPSarVerified = + xState0.psar < signal.entry + && xState0.psar < candle.low; + + // + isStateVerified = + // + // Start ... + true + // + // && xState0.open < xState0.slow + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + xState0.psar > signal.entry + && xState0.psar > candle.high + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry > ll + && pCandle.low != ll + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp > iTPowState.powerDown + || iTPowState.signal < MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers < 1 + && tPowUnverifyConditions == 0 + && MathAbs(xTPow0.powerUp - xTPow0.powerDown) > 50 * _Point + ; + + // + isStateVerified = + // + // Start ... + true + // + // && (xStateLast.verifier - xState0.verifier) >= 0 + // + && xState0.verifier > signal.entry + // + && MathAbs(signal.entry - xState0.verifier) < (xSharpDetectorFactor * _Point) + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XMarketState GetXMarketState( + const int bar_index +) { + // + XMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double slow = GetMA( + bar_index, + xSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double oscillator = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + double oscillatorVerifier = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xPSarStep, + xPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.open = open; + result.slow = slow; + result.verifier = verifier; + result.oscillator = oscillator; + result.oscillatorVerifier = oscillatorVerifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.xr.signal.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..a74e094 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,695 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = false; // XR Signalling Enable + +// +input bool enableXRLong = true; // XR Signalling Enable Long +input bool enableXRShort = true; // XR Signalling Enable Short + +// +input double xRShortR2R = 2; // XR Short Risk To Reward Ratio +input double xRShortLotsPerTradePercent = 0.00001; // XR Lots Percent per Short Trades +input double xRShortMaxDrawdownPerTradePercent = 0.01; // XR Max Allowed DrawDown Percent per Short Trade + +// +input double xRLongR2R = 2; // XR Long Risk To Reward Ratio +input double xRLongLotsPerTradePercent = 0.00001; // XR Lots Percent per Short Trades +input double xRLongMaxDrawdownPerTradePercent = 0.01; // XR Max Allowed DrawDown Percent per Long Trade + +// +input int xRMaximumCandlesPerTrade = 252; // XR Maximum Candles which a Trade can open + +// +input int xROscillatorLength = 7; // XR Oscillator Length +input int xRFastLength = 20; // XR Fast Length +input int xRSlowLength = 50; // XR Slow Length +input int xRRangeMarketLength = 50; // XR Range Detector Length + +// +input int xRSwingLength = 7; // XR Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + + // + double prevFast; + double prevSlow; + + // + double oscillator; + double prevOscillator; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + // + datetime startTime; + datetime signalTime; + datetime entryTime; + + // + double value; + XRState state; +}; + +// +static XRSignalConditions xRLongConds; +static bool xRCloseLongTrades = false; +static bool xRWaitForLongSignals = true; + +// +static XRSignalConditions xRShortConds; +static bool xRCloseShortTrades = false; +static bool xRWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xRFailedSignals = 0; + +// +double xRMaximumDrawDown = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return; + } + + // + XOHCL candle = GetCandleModel(bar_index); + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + if (xRWaitForLongSignals) { + // + if ( + state.oscillator < state.fast + && state.oscillator < state.slow + && state.prevOscillator < state.prevFast + && state.prevOscillator < state.prevSlow + && candle.low < xRMaximumDrawDown + ) { + // + xRMaximumDrawDown = 0; + xRCloseLongTrades = true; + } + } else { + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index + 1); + + // + XRState xrState = GetXRange( + bar_index, + xRRangeMarketLength + ); + + // + double affectedValue = xrState.mid; + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + bool isCrossOver = + state.fast > state.slow + && !(state.prevFast > state.prevSlow) + ; + + // + bool isCrossUnder = + state.fast < state.slow + && !(state.prevFast < state.prevSlow) + ; + + // + if ( + isCrossUnder + && xRLongConds.startTime == 0 + ) { + // + xRLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xRLongConds.startTime > 0 + && xRLongConds.signalTime == 0 + ) { + // + xRLongConds.value = affectedValue; + xRLongConds.state = xrState; + + // + xRLongConds.signalTime = barTime; + xRLongConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xRSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xRSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = + requestLong ? + risk * xRLongR2R : + risk * xRShortR2R + ; + + // + double sl = requestLong ? + 0 : + ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + xRMaximumDrawDown = + xRMaximumDrawDown == 0 ? + xRLongConds.state.mid : + xRMaximumDrawDown > xRLongConds.state.mid ? + xRMaximumDrawDown : + xRLongConds.state.mid; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXRLongConditions() { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRLongConds.startTime > 0 + && xRLongConds.signalTime > 0 + && xRLongConds.entryTime > 0 + // + && xRLongConds.value > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.signalTime + ); + + // + // Count Affected Value Touches ... + int cStartBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.state.start + ); + + // + int cEndBarIndex = cStartBarIndex + xRLongConds.state.length; + + // + int highTouched = 0; + int valueTouched = 0; + for (int i = cStartBarIndex; i <= cStartBarIndex + cEndBarIndex; i++) { + // + XOHCL iCandle = GetCandleModel(i); + + // + if ( + iCandle.low < xRLongConds.value + && iCandle.high > xRLongConds.value + ) { + valueTouched++; + } + + // + if ( + iCandle.low < xRLongConds.state.hh + && iCandle.high > xRLongConds.state.hh + ) { + highTouched++; + } + } + + // + isBLFilled = + // + xRLongConds.signalTime > xRLongConds.startTime + && xRLongConds.entryTime >= xRLongConds.signalTime + // + && highTouched < 2 + && valueTouched > (cEndBarIndex - cStartBarIndex) / 6 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xRLongConds.startTime = 0; + xRLongConds.signalTime = 0; + xRLongConds.entryTime = 0; + + // + xRLongConds.value = 0; + + // + XRState e = {}; + xRLongConds.state = e; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + XRMarketState state = GetXRMarketState(0); + + // + double fSDif = MathAbs(state.fast - state.slow); + double fSDifP = MathAbs(state.prevFast - state.prevSlow); + + // + double emaSlope = GetSlope( + 1, + state.prevOscillator, + 2, + state.oscillator + ); + + // + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + // Starter ... + true + // + && state.oscillator > state.fast + && emaSlope > 0 + && signal.entry > state.verifier + // + && fSDif > fSDifP + // + && signal.entry < xRLongConds.state.hh + && signal.entry > xRLongConds.state.mid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Prepare Market Length ... + int xrVerifierMarketLength = GetDailyCandleCount(); + + // + // Calculate Fast and Prev Fast ... + // + // Fast ... + double fast = GetMA( + bar_index + 1, + xRFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Fast ... + double prevFast = GetMA( + bar_index + 2, + xRFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Slow and Prev Slow ... + + // + // Slow ... + double slow = GetMA( + bar_index + 1, + xRSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Slow ... + double prevSlow = GetMA( + bar_index + 2, + xRSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Oscillator and Prev Oscillator ... + + // + // Oscillator ... + double oscillator = GetMA( + bar_index, + xROscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Prev Oscillator ... + double prevOscillator = GetMA( + bar_index + 1, + xROscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Calculate Verifier ... + double verifier = GetMA( + bar_index, + xrVerifierMarketLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + result.fast = fast; + result.slow = slow; + result.verifier = verifier; + result.prevFast = prevFast; + result.prevSlow = prevSlow; + result.oscillator = oscillator; + result.prevOscillator = prevOscillator; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/Used/14020512/Libraries/x-saherelm.xtpw.signal.lib.mq4 b/Bkp/Used/14020512/Libraries/x-saherelm.xtpw.signal.lib.mq4 new file mode 100644 index 0000000..ff71849 --- /dev/null +++ b/Bkp/Used/14020512/Libraries/x-saherelm.xtpw.signal.lib.mq4 @@ -0,0 +1,1332 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XTPW Signal Global Library +// --------------------------------------------------- +// XSaherElm EA Signal Provider based on +// XTPow Indicator... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xTPWStarter = "- XTPW Signal Provider -"; // ---> XTPW Signal Provider <--- + +// +input bool enableXTPWSignalling = false; // XTPW Signalling Enable + +// +input bool enableXTPWLong = true; // XTPW Signalling Enable Long +input bool enableXTPWShort = true; // XTPW Signalling Enable Short + +// +input double xTPWShortR2R = 2; // XTPW Short Risk To Reward Ratio +input double xTPWShortLotsPerTradePercent = 0.00001; // XTPW Lots Percent per Short Trades +input double xTPWShortMaxDrawdownPerTradePercent = 0.015; // XTPW Max Allowed DrawDown Percent per Short Trade + +// +input double xTPWLongR2R = 2; // XTPW Long Risk To Reward Ratio +input double xTPWLongLotsPerTradePercent = 0.00001; // XTPW Lots Percent per Short Trades +input double xTPWLongMaxDrawdownPerTradePercent = 0.015; // XTPW Max Allowed DrawDown Percent per Long Trade + +// +input int xTPWMaximumCandlesPerTrade = 206; // XTPW Maximum Candles which a Trade can open + +// +input double xTPWPSarStep = 0.02; // XTPW Parabolic Sar Step +input double xTPWPSarMaximum = 0.2; // XTPW Parabolic Sar Maximum + +// +input int xTPWSwingLength = 7; // XTPW Signal Swing Length +// +// END Inputs ... +// + +// +input double xTPWSharpDetectionFactor = 650; // XTPW Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XTPW Based Signal Conditions ... +struct XTPWSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XTPWMarketState { + // + double psar; + + // + double scFast; + double scSlow; + double scWeight; + + // + double mcFast; + double mcSlow; + double mcWeight; + + // + double lcFast; + double lcSlow; + double lcWeight; +}; + +// +struct XLHS { + // + double scHH; + double scLL; + + // + double mcHH; + double mcLL; + + // + double lcHH; + double lcLL; +}; + +// +static XTPWSignalConditions xTPWLongConds; +static bool xTPWCloseLongTrades = false; +static bool xTPWWaitForLongSignals = true; + +// +static XTPWSignalConditions xTPWShortConds; +static bool xTPWCloseShortTrades = false; +static bool xTPWWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xTPWFailedSignals = 0; + +// +double tPowerVerifier = 20; +double tPowerMaxVerifier = 55; + +// +int scFastLength = 0; +int scSlowLength = 0; + +// +int mcFastLength = 0; +int mcSlowLength = 0; + +// +int lcFastLength = 0; +int lcSlowLength = 0; + +// +datetime lastTurnOffLongTradesTime; +datetime lastTurnOffShortTradesTime; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXTPWSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 1); + + // + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // // + // // Disable Long Conditions ... + // if ( + // xTPWWaitForLongSignals + // && + // ( + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperAboveMaxVerifier + // ) + // ) { + // // + // xTPWWaitForLongSignals = false; + // lastTurnOffLongTradesTime = barTime; + // } + + // // + // // Enable Long Conditions ... + // if ( + // !xTPWWaitForLongSignals + // && lastTurnOffLongTradesTime > 0 + // && ( + // // isFastCrossOverSlow + // // || + // // isFastCrossUnderSlow + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperBelowMaxVerifier + // ) + // ) { + // // + // // Find Last Turn Off Bar Index ... + // int lastTurnOffLongTradesBarIndex = iBarShift( + // _Symbol, + // _Period, + // lastTurnOffLongTradesTime + // ); + + // // + // // the Distance must be bigger than market length ... + // if (MathAbs(lastTurnOffLongTradesBarIndex - bar_index) > xTPWSwingLength) { + // // + // xTPWWaitForLongSignals = true; + // lastTurnOffLongTradesTime = 0; + // } + // } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXTPWLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + || !xTPWWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPow States ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPowMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve XPrice Model ... + XPrice prices = GetPrice(); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XLHS lhs = GetXTPWLHS(bar_index); + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool longCondition1 = + // + true + // + && !isHHSame + // + && !( + lhs.scLL == lhs.mcLL + ) + // + && !( + lhs.scHH == lhs.mcHH + ) + // + && !( + prices.longEntry + && candle0.high < state0.scFast + && candle0.high < state0.scSlow + && candle0.high < state0.mcFast + && candle0.high < state0.mcSlow + && candle0.high < state0.lcFast + && candle0.high < state0.lcSlow + ) + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + // Start Conditions ... + startCondition = ( + longCondition1 + ) + ; + + // + if ( + startCondition + && xTPWLongConds.startTime == 0 + && xTPWLongConds.signalTime == 0 + && xTPWLongConds.entryTime == 0 + ) { + // + xTPWLongConds.startTime = barTime; + xTPWLongConds.signalTime = barTime; + xTPWLongConds.entryTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXTPWShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPower State ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPWMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XPrice prices = GetPrice(); + XLHS lhs = GetXTPWLHS(bar_index); + + // + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool shortCondition1 = + // + true + // + && tPow1.powerDown > tPowerMaxVerifier + && tPow2.powerDown < tPowerMaxVerifier + ; + + // + startCondition = ( + shortCondition1 + ) + ; + + // + if ( + startCondition + && xTPWShortConds.startTime == 0 + && xTPWShortConds.signalTime == 0 + && xTPWShortConds.entryTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXTPWSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + // Check Condition Validations ... + if (requestLong) { + // + // Check Long Condtion is Valid, if Long Requested ... + if ( + !ValidateXTPWLongConditions() + ) { + return result; + } + } else { + // + // Check Short Condtion is Valid, if Short Requested ... + if ( + !ValidateXTPWShortConditions() + ) { + return result; + } + } + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xTPWSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xTPWSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + // Price Calculations ... + XPrice prices = GetPrice(); + + // + // Read State ... + XTPWMarketState state0 = GetXTPWMarketState(bar_index); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 2); + + // + double risk = requestLong ? + // + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double longR2R = xTPWLongR2R; + double shortR2R = xTPWShortR2R; + + // + double sharpDetectorValue = xTPWSharpDetectionFactor * _Point; + + // + if ( + risk > 0 + && requestLong + ) { + return result; + } + + // + // Define Entry Price ... + double entryPrice = requestLong + ? + prices.longEntry + : + prices.shortEntry + ; + + // + // Fix TP Detects for Short Signals ... + if (!requestLong) { + risk = 0; + } + + // + double reward = requestLong ? + risk * longR2R : + risk * shortR2R + ; + + // + if (risk == 0) { + // + // Calculate Reward ... + reward = requestLong + ? + MathAbs(hh - entryPrice) + : + MathAbs(hh - entryPrice) + ; + + // + // Detect Sharp Change Occured or not ... + bool isSharpOccured = reward > sharpDetectorValue + || MathAbs(reward - sharpDetectorValue) < (50 * _Point); + + // + // Change Rewards on Special Conditions ... + if ( + ( + requestLong + && isSharpOccured + && ( + state0.lcFast < state0.lcSlow + || ( + state0.mcFast > state0.mcSlow + && state0.mcWeight < state0.mcSlow + ) + ) + ) + ) { + reward = reward / 2; + } + + // + if (reward < 50 * _Point) { + reward = (50 * _Point) + prices.priceGap; + } + + // // + // if (!requestLong) { + // reward = reward * shortR2R; + // } + } + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XTPW_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XTPW_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWLongConditions() { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime > 0 + && xTPWLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.entryTime + // ); + + // // + // int startSignalDiff = (signalBarIndex - startBarIndex); + // int entrySignalDiff = (entryBarIndex - signalBarIndex); + // int maxDiff = MathMax(startSignalDiff, entrySignalDiff); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWLongConds.signalTime >= xTPWLongConds.startTime + && xTPWLongConds.entryTime >= xTPWLongConds.signalTime + // + // && maxDiff < (xTPWSwingLength * 2) + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWShortConditions() { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime > 0 + && xTPWShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.entryTime + // ); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWShortConds.signalTime >= xTPWShortConds.startTime + && xTPWShortConds.entryTime >= xTPWShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXTPWLongSignalConditions() { + // + xTPWLongConds.startTime = 0; + xTPWLongConds.entryTime = 0; + xTPWLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXTPWShortSignalConditions() { + // + xTPWShortConds.startTime = 0; + xTPWShortConds.entryTime = 0; + xTPWShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXTPWSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve TPow State ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xTPWSwingLength + ); + + // + // Retrive XMarket States ... + XTPWMarketState state0 = GetXTPWMarketState(signalBarIndex); + XTPWMarketState state1 = GetXTPWMarketState(signalBarIndex + 1); + XTPWMarketState state2 = GetXTPWMarketState(signalBarIndex + 2); + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Calculate Sharp Detection Value ... + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + // Find State0 Min ... + double state0Min = MathMin(state0.scFast, state0.scSlow); + state0Min = MathMin(state0Min, state0.mcFast); + state0Min = MathMin(state0Min, state0.mcSlow); + state0Min = MathMin(state0Min, state0.lcFast); + state0Min = MathMin(state0Min, state0.lcSlow); + + // + // Find State0 Min ... + double state0Max = MathMax(state0.scFast, state0.scSlow); + state0Max = MathMax(state0Max, state0.mcFast); + state0Max = MathMax(state0Max, state0.mcSlow); + state0Max = MathMax(state0Max, state0.lcFast); + state0Max = MathMax(state0Max, state0.lcSlow); + + // + // Find Distance Between State0 Min and Max ... + double state0MinMaxDistance = MathAbs(state0Max - state0Min); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + isPSarVerified = + // + // Starter ... + true + // + ; + + // + isStateVerified = + // + // Start ... + true + // + && state0.mcFast > state0.mcSlow + && state1.mcFast > state1.mcSlow + // + && !( + state0.lcFast > state0.mcSlow + && state0.lcFast < state0.mcFast + ) + // + && MathAbs(state1.mcFast - state1.mcSlow) > (50 * _Point) + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + // + // Starter ... + true + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.signal > MathMax(tPow0.powerUp, tPow0.powerDown) + ; + + // + isStateVerified = + // + // Start ... + true + // + && ( + // + state0.scFast < state0.scSlow + && state0.mcFast < state0.mcSlow + && state0.lcFast < state0.lcSlow + ? + signal.entry > state0.scFast + : + // + // Find Minimum and Maximum Distance of State ... + state0MinMaxDistance > sharpDetectionValue + ? + signal.entry > state0Min + : + true + ) + // + && MathAbs(state0.mcFast - state0.mcSlow) > 50 * _Point + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +// +// Retrieve Market State ... +XTPWMarketState GetXTPWMarketState( + const int bar_index +) { + // + XTPWMarketState result = {}; + + // + int dayCount = GetDailyCandleCount(); + int halfDayCount = (int)(dayCount / 2); + + // + if (scFastLength == 0) { + scFastLength = xTPWSwingLength; + } + + // + if (scSlowLength == 0) { + scSlowLength = xTPWSwingLength * 2; + } + + // + if (mcFastLength == 0) { + mcFastLength = halfDayCount; + } + + // + if (mcSlowLength == 0) { + mcSlowLength = dayCount; + } + + // + if (lcFastLength == 0) { + lcFastLength = halfDayCount * 3; + } + + // + if (lcSlowLength == 0) { + lcSlowLength = dayCount * 3; + } + + // + double scFast = GetMA( + bar_index, + scFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scSlow = GetMA( + bar_index, + scSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scWeight = GetMA( + bar_index, + scSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double mcFast = GetMA( + bar_index, + mcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcSlow = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcWeight = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double lcFast = GetMA( + bar_index, + lcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcSlow = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcWeight = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xTPWPSarStep, + xTPWPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.scFast = scFast; + result.scSlow = scSlow; + result.mcFast = mcFast; + result.mcSlow = mcSlow; + result.lcFast = lcFast; + result.lcSlow = lcSlow; + result.scWeight = scWeight; + result.mcWeight = mcWeight; + result.lcWeight = lcWeight; + + // + return result; +} + +// +// Retrieve Highest Highs and Lowest Lows in Cycles ... +XLHS GetXTPWLHS( + const int bar_index +) { + // + XLHS result = {}; + + // + // Retrieve LL and HH (s) ... + + // + // SC HH ... + double scHH = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // SC LL ... + double scLL = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // MC HH ... + double mcHH = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // MC LL ... + double mcLL = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // LC HH ... + double lcHH = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + // LC LL ... + double lcLL = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + result.scHH = scHH; + result.scLL = scLL; + result.mcHH = mcHH; + result.mcLL = mcLL; + result.lcHH = lcHH; + result.lcLL = lcLL; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/Used/14020512/x-saherelm.xr.signal.lib.mq4 b/Bkp/Used/14020512/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..a74e094 --- /dev/null +++ b/Bkp/Used/14020512/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,695 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = false; // XR Signalling Enable + +// +input bool enableXRLong = true; // XR Signalling Enable Long +input bool enableXRShort = true; // XR Signalling Enable Short + +// +input double xRShortR2R = 2; // XR Short Risk To Reward Ratio +input double xRShortLotsPerTradePercent = 0.00001; // XR Lots Percent per Short Trades +input double xRShortMaxDrawdownPerTradePercent = 0.01; // XR Max Allowed DrawDown Percent per Short Trade + +// +input double xRLongR2R = 2; // XR Long Risk To Reward Ratio +input double xRLongLotsPerTradePercent = 0.00001; // XR Lots Percent per Short Trades +input double xRLongMaxDrawdownPerTradePercent = 0.01; // XR Max Allowed DrawDown Percent per Long Trade + +// +input int xRMaximumCandlesPerTrade = 252; // XR Maximum Candles which a Trade can open + +// +input int xROscillatorLength = 7; // XR Oscillator Length +input int xRFastLength = 20; // XR Fast Length +input int xRSlowLength = 50; // XR Slow Length +input int xRRangeMarketLength = 50; // XR Range Detector Length + +// +input int xRSwingLength = 7; // XR Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + + // + double prevFast; + double prevSlow; + + // + double oscillator; + double prevOscillator; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + // + datetime startTime; + datetime signalTime; + datetime entryTime; + + // + double value; + XRState state; +}; + +// +static XRSignalConditions xRLongConds; +static bool xRCloseLongTrades = false; +static bool xRWaitForLongSignals = true; + +// +static XRSignalConditions xRShortConds; +static bool xRCloseShortTrades = false; +static bool xRWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xRFailedSignals = 0; + +// +double xRMaximumDrawDown = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return; + } + + // + XOHCL candle = GetCandleModel(bar_index); + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + if (xRWaitForLongSignals) { + // + if ( + state.oscillator < state.fast + && state.oscillator < state.slow + && state.prevOscillator < state.prevFast + && state.prevOscillator < state.prevSlow + && candle.low < xRMaximumDrawDown + ) { + // + xRMaximumDrawDown = 0; + xRCloseLongTrades = true; + } + } else { + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index + 1); + + // + XRState xrState = GetXRange( + bar_index, + xRRangeMarketLength + ); + + // + double affectedValue = xrState.mid; + + // + XRMarketState state = GetXRMarketState( + bar_index + ); + + // + bool isCrossOver = + state.fast > state.slow + && !(state.prevFast > state.prevSlow) + ; + + // + bool isCrossUnder = + state.fast < state.slow + && !(state.prevFast < state.prevSlow) + ; + + // + if ( + isCrossUnder + && xRLongConds.startTime == 0 + ) { + // + xRLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xRLongConds.startTime > 0 + && xRLongConds.signalTime == 0 + ) { + // + xRLongConds.value = affectedValue; + xRLongConds.state = xrState; + + // + xRLongConds.signalTime = barTime; + xRLongConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xRSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xRSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + double reward = + requestLong ? + risk * xRLongR2R : + risk * xRShortR2R + ; + + // + double sl = requestLong ? + 0 : + ll; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + xRMaximumDrawDown = + xRMaximumDrawDown == 0 ? + xRLongConds.state.mid : + xRMaximumDrawDown > xRLongConds.state.mid ? + xRMaximumDrawDown : + xRLongConds.state.mid; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXRLongConditions() { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRLongConds.startTime > 0 + && xRLongConds.signalTime > 0 + && xRLongConds.entryTime > 0 + // + && xRLongConds.value > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.signalTime + ); + + // + // Count Affected Value Touches ... + int cStartBarIndex = iBarShift( + _Symbol, + _Period, + xRLongConds.state.start + ); + + // + int cEndBarIndex = cStartBarIndex + xRLongConds.state.length; + + // + int highTouched = 0; + int valueTouched = 0; + for (int i = cStartBarIndex; i <= cStartBarIndex + cEndBarIndex; i++) { + // + XOHCL iCandle = GetCandleModel(i); + + // + if ( + iCandle.low < xRLongConds.value + && iCandle.high > xRLongConds.value + ) { + valueTouched++; + } + + // + if ( + iCandle.low < xRLongConds.state.hh + && iCandle.high > xRLongConds.state.hh + ) { + highTouched++; + } + } + + // + isBLFilled = + // + xRLongConds.signalTime > xRLongConds.startTime + && xRLongConds.entryTime >= xRLongConds.signalTime + // + && highTouched < 2 + && valueTouched > (cEndBarIndex - cStartBarIndex) / 6 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xRLongConds.startTime = 0; + xRLongConds.signalTime = 0; + xRLongConds.entryTime = 0; + + // + xRLongConds.value = 0; + + // + XRState e = {}; + xRLongConds.state = e; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + XRMarketState state = GetXRMarketState(0); + + // + double fSDif = MathAbs(state.fast - state.slow); + double fSDifP = MathAbs(state.prevFast - state.prevSlow); + + // + double emaSlope = GetSlope( + 1, + state.prevOscillator, + 2, + state.oscillator + ); + + // + XOHCL pCandle = GetCandleModel(1); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + result = + // + // Starter ... + true + // + && state.oscillator > state.fast + && emaSlope > 0 + && signal.entry > state.verifier + // + && fSDif > fSDifP + // + && signal.entry < xRLongConds.state.hh + && signal.entry > xRLongConds.state.mid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + result = + false + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Prepare Market Length ... + int xrVerifierMarketLength = GetDailyCandleCount(); + + // + // Calculate Fast and Prev Fast ... + // + // Fast ... + double fast = GetMA( + bar_index + 1, + xRFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Fast ... + double prevFast = GetMA( + bar_index + 2, + xRFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Slow and Prev Slow ... + + // + // Slow ... + double slow = GetMA( + bar_index + 1, + xRSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Prev Slow ... + double prevSlow = GetMA( + bar_index + 2, + xRSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + // Calculate Oscillator and Prev Oscillator ... + + // + // Oscillator ... + double oscillator = GetMA( + bar_index, + xROscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Prev Oscillator ... + double prevOscillator = GetMA( + bar_index + 1, + xROscillatorLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + // Calculate Verifier ... + double verifier = GetMA( + bar_index, + xrVerifierMarketLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + result.fast = fast; + result.slow = slow; + result.verifier = verifier; + result.prevFast = prevFast; + result.prevSlow = prevSlow; + result.oscillator = oscillator; + result.prevOscillator = prevOscillator; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Experts/x-saherelm.osc.ea.mq4 b/Bkp/Used/OSC EA 14020410/Experts/x-saherelm.osc.ea.mq4 new file mode 100644 index 0000000..409a38d --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Experts/x-saherelm.osc.ea.mq4 @@ -0,0 +1,884 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST_OSC Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// +// ShortName: XST_OSC +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST_OSC Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_OSC"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 480; // Close All Open Trades After Passed Candles + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// Power OSC ... +input double minPowerOSC = 0.055; // Minimum Signal Power + +// +// Variance OSC ... +input double minVarianceOSC = 0; // Minimum Var Power + +// +// ZIGZAG Inputs ... +input int zDeviation = 5; // ZigZag Deviation +input int zBackStep = 3; // ZigZag Back Step + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = false; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.osc.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || minPowerOSC < 0 + || minVarianceOSC < 0 + || slowOSCLength <= fastOSCLength + // + // ZIGZAG ... + || zDeviation < 0 + || zBackStep < 0 + || zBackStep >= marketLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_OSC"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State in Big Picture ... + + // + int maShift = 0; + int fastMaLength = 10; + int slowMaLength = 50; + ENUM_MA_METHOD maMethod = MODE_SMA; + ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; + + // + double fastMa = iMA( + _Symbol, + _Period, + fastMaLength, + maShift, + maMethod, + maAppliedPrice, + 0 // Bar Index ... + ); + double fastMaPrev = iMA( + _Symbol, + _Period, + fastMaLength, + maShift, + maMethod, + maAppliedPrice, + 1 // Bar Index ... + ); + double fastMaPrevPrev = iMA( + _Symbol, + _Period, + fastMaLength, + maShift, + maMethod, + maAppliedPrice, + 2 // Bar Index ... + ); + + // + double slowMa = iMA( + _Symbol, + _Period, + slowMaLength, + maShift, + maMethod, + maAppliedPrice, + 0 // Bar Index ... + ); + double slowMaPrev = iMA( + _Symbol, + _Period, + slowMaLength, + maShift, + maMethod, + maAppliedPrice, + 1 // Bar Index ... + ); + double slowMaPrevPrev = iMA( + _Symbol, + _Period, + slowMaLength, + maShift, + maMethod, + maAppliedPrice, + 2 // Bar Index ... + ); + + // + bool isFastMACrossOverSlowMa = fastMa > slowMa + && !(fastMaPrev > slowMaPrev) + && !(fastMaPrevPrev > slowMaPrevPrev); + + // + bool isFastMACrossUnderSlowMa = fastMa < slowMa + && !(fastMaPrev < slowMaPrev) + && !(fastMaPrevPrev < slowMaPrevPrev); + + // + bool isSCFastCrossUnderSlow = xmaState.scFast < xmaState.scSlow + && !(xmaState.scFastPrev < xmaState.scSlowPrev); + + // + bool isMCFastCrossUnderSlow = xmaState.mcFast < xmaState.mcSlow + && !(xmaState.mcFastPrev < xmaState.mcSlowPrev); + + // + bool isLCFastCrossUnderSlow = xmaState.lcFast < xmaState.lcSlow + && !(xmaState.lcFastPrev < xmaState.lcSlowPrev); + + // + bool isSharpBullishHappens = IsSharpBullishHappens( + 0, // Bar Index ... + marketLength // Market Length ... + ); + + // + bool isSharpBearishHappens = IsSharpBullishHappens( + 0, // Bar Index ... + marketLength // Market Length ... + ); + + // + // TODO: Determines Where and How close Long Trades on Trend Reversal Points ... + closeLongTrades = + false + // ( + // isSCFastCrossUnderSlow + // && isMCFastCrossUnderSlow + // ) + // || + // ( + // isSCFastCrossUnderSlow + // && isLCFastCrossUnderSlow + // ) + // || + // ( + // isMCFastCrossUnderSlow + // && isLCFastCrossUnderSlow + // ) + // || + // IsSharpBearishHappens( + // 0, + // marketLength + // ) + ; + + // + waitForLongSignals = + true; + // waitForLongSignals + // ? + // true + // && !isSharpBullishHappens + // // && !adxState.trendPower > 50 + // // && adxState.trendPower < 20 + // : + // ( + // ( + // xmaState.lcFast > xmaState.lcSlow + // && !(xmaState.lcFastPrev > xmaState.lcSlowPrev) + // ) + // || + // ( + // xmaState.mcFast > xmaState.mcSlow + // && !(xmaState.mcFastPrev > xmaState.mcSlowPrev) + // ) + // || + // isSharpBearishHappens + // ) + // ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + // + countedBars++; + + // // + // LogMessage( + // StringConcatenate( + // "Check Signals, Bars: ", + // countedBars + // ) + // ); + + // + // Retrieve Signal Exists ... + // request = CalculateSignal( + // // + // // Bar Index ... + // 0, + // // + // // Market Specification Inpouts ... + // marketLength, // Market Length ... + // // + // // Risk To Reward Ratio ... + // riskToRewardRatio, + // // + // // XMA Inputs ... + // shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + // shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + // mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + // mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + // longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + // longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // // + // // Show/Hide Inputs ... + // showShortCycle, + // showShortCycleCrossLines, + // showMediumCycle, + // showMediumCycleCrossLines, + // showLongCycle, + // showLongCycleCrossLines, + // // + // // Color Inputs ... + // shortCycleFastColor, + // shortCycleSlowColor, + // mediumCycleFastColor, + // mediumCycleSlowColor, + // longCycleFastColor, + // longCycleSlowColor, + // // + // // OSC ... + // fastOSCLength, // FastOSC Length ... + // fastOSCMultiplier, // FastOSC Multiplier ... + // slowOSCLength, // SlowOSC Length ... + // slowOSCMultiplier, // SlowOSC Multiplier ... + // minPowerOSC, // Minimum Signal Power ... + // minVarianceOSC, // Minimum Var Power ... + // // + // // ZIGZAG Inputs ... + // zDeviation, // ZigZag Deviation ... + // zBackStep // ZigZag Back Step ... + // ); + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + + // + // Close In Profit Trades ... + // then Recheck Signal ... + // bool hasInProfitTradeClosed = CloseAllInProfitTrades(); + // if (hasInProfitTradeClosed) { + // ProcessSignals(); + // } + } + } + + // + // Retrieve Signal Exists ... + request = CalculateSignal( + // + // Bar Index ... + 0, + // + // Market Specification Inpouts ... + marketLength, // Market Length ... + // + // Risk To Reward Ratio ... + riskToRewardRatio, + // + // XMA Inputs ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showShortCycle, + showShortCycleCrossLines, + showMediumCycle, + showMediumCycleCrossLines, + showLongCycle, + showLongCycleCrossLines, + // + // Color Inputs ... + shortCycleFastColor, + shortCycleSlowColor, + mediumCycleFastColor, + mediumCycleSlowColor, + longCycleFastColor, + longCycleSlowColor, + // + // OSC ... + fastOSCLength, // FastOSC Length ... + fastOSCMultiplier, // FastOSC Multiplier ... + slowOSCLength, // SlowOSC Length ... + slowOSCMultiplier, // SlowOSC Multiplier ... + minPowerOSC, // Minimum Signal Power ... + minVarianceOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + zDeviation, // ZigZag Deviation ... + zBackStep // ZigZag Back Step ... + ); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + if (lastSignalledBar == countedBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // Prevent Signals if openTrades on last Market ... + // this means for each trades at least we have to wait market length passed from last signal ... + // if (lastSignalledBar + (marketLength) > countedBars) { + // return; + // } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // TODO: + // - Order 5 Long Time; + // - Order 8 Long Time; + // - Order 13 Long Time; + // - lcTrendDown; + // - mcTrendUp; + // - scTrendDown; + // - marketMiddleage < mcSlow; + // - longEntryPrice > lcSlow; + // - scTrendPowerUp; + // - Order 14 All Long Trades; + // - lcMarket TrendUp; + // - mcMarket TrendUp; + // - + // - Order 16 Long Time; + // - Ordrr 17 Long Time; + // - Ordrr 22 Long Time; + // - Ordrr 26 Long Time; + // - Ordrr 32 All Long Trades; + // - Ordrr 40 Long Time; + // - Ordrr 41 Long Time; + // - Ordrr 52 Long Time; + // - Ordrr 66 Long Time; + // - Ordrr 73 Long Time; + // - Ordrr 74 All Long Trades; + // - Ordrr 78 Long Time; + // - Ordrr 78 Long Time; + // - Ordrr 87 All Long Trades; + // - Ordrr 95 Long Time; + // - Ordrr 97 Long Time; + // - Ordrr 106 Long Time; + // - Ordrr 107 All Long Trades; + // - Ordrr 109 Long Time; + // - Ordrr 111 Long Time; + + // + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + waitForLongSignals = false; + } + } + + // + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + waitForShortSignals = false; + } + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + waitForLongSignals = false; + waitForShortSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // // + // if (!alertEvents) { + // return; + // } + + // // + // // Terminal Alert ... + // if (terminalAlert) { + // Alert(message); + // } + + // // + // // Push Alert ... + // if (pushAlert) { + // SendNotification(message); + // } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.adx.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.adx.mq4 new file mode 100644 index 0000000..3271a4e --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.adx.mq4 @@ -0,0 +1,220 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +input ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; // Averaging Applied Price +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 3 + +// +#property indicator_level1 0.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_level4 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// ADX ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Positive Direction ... +#property indicator_width2 1 +#property indicator_color2 clrLime +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +// Negative Direction ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// Declare Buffers ... +#define adxBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double adxBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexLabel(positiveBufferIndex, "DI+"); + + // + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + SetIndexLabel(negativeBufferIndex, "DI-"); + + // + SetIndexBuffer(adxBufferIndex, adxBuffer); + SetIndexLabel(adxBufferIndex, "ADX"); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..220bd33 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,330 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 5 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 5 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// Power OSC ... +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASHDOTDOT + +// +// Var OSC ... +#property indicator_width4 1 +#property indicator_type4 DRAW_HISTOGRAM +#property indicator_color4 clrBlueViolet +#property indicator_style4 STYLE_SOLID + +// +// Tan Fast/Slow OSC ... +#property indicator_width5 0 +#property indicator_type5 DRAW_NONE +#property indicator_color5 clrNONE +#property indicator_style5 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 +#define powerOSCBufferIndex 2 +#define varOSCBufferIndex 3 +#define fastSlowOSCAngleBufferIndex 4 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; +double fastSlowOSCAngleBuffer[]; +double powerOSCBuffer[]; +double varOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + // Power OSC Buffer ... + SetIndexBuffer(powerOSCBufferIndex, powerOSCBuffer); + SetIndexLabel(powerOSCBufferIndex, "Power OSC"); + + // + // Var OSC Buffer ... + SetIndexBuffer(varOSCBufferIndex, varOSCBuffer); + SetIndexLabel(varOSCBufferIndex, "Var OSC"); + + // + // Tan Fast/Slow OSC Buffer ... + SetIndexBuffer(fastSlowOSCAngleBufferIndex, fastSlowOSCAngleBuffer); + SetIndexLabel(fastSlowOSCAngleBufferIndex, "F/L OSC Angle"); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; + + // + // Signal Power ... + // Difference Variant between FastOSC and Slow OSC ... + double powerOSC = fastOCS - slowOCS; + powerOSCBuffer[bar_index] = powerOSC; + + // + // Var OSC ... + double varOSC = fastOCS - 0.5; + varOSCBuffer[bar_index] = varOSC; + + // + // Calculate Tan Fast/Slow OSC ... + double fastOSCSlope = fastOSCBuffer[bar_index] - fastOSCBuffer[bar_index + 1]; + double slowOSCSlope = slowOSCBuffer[bar_index] - slowOSCBuffer[bar_index + 1]; + double tanFastSlowOSC = MathAbs( + (fastOSCSlope - slowOSCSlope) / (1 + (fastOSCSlope * slowOSCSlope)) + ); + + // + // here we pass Tan of angle ... + // fastSlowOSCAngleBuffer[bar_index] = tanFastSlowOSC; + + // + // here we pass degree of angle ... + fastSlowOSCAngleBuffer[bar_index] = MathArctan(tanFastSlowOSC); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..20206ac --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,643 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 7 +#property indicator_plots 7 + +// +// Middle ... +#property indicator_label7 "Mid" +#property indicator_type7 DRAW_LINE +#property indicator_color7 clrBisque +#property indicator_style7 STYLE_DASHDOTDOT +#property indicator_width7 1 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..c1ccd2a --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1129 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + static datetime lastbar; + datetime curbar = (datetime)SeriesInfoInteger(_Symbol, _Period, SERIES_LASTBAR_DATE); + + // + if(lastbar != curbar) { + // + lastbar = curbar; + return true; + } + + // + return false; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishHappens( + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + bool result = false; + + // + double lowestHighInMarket = GetMarketLowestHigh( + bar_index + 1, + marketLen + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + result = high > lowestHighInMarket + && PriceToPips(high - lowestHighInMarket) >= 4 + ; + + // + return result; +} + +// +// Detect Market Has Sharp Bearish or not ... +bool IsSharpBearishHappens( + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + bool result = false; + + // + double highestLowInMarket = GetMarketHighestLow( + bar_index + 1, + marketLen + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + result = low < highestLowInMarket + && PriceToPips(highestLowInMarket - low) >= 4 + ; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +struct XMinMax { + double min; + double max; +}; + +// +// Find Min and Max Value of specific Buffer ... +XMinMax GetBufferMinMax(const double &buffer[]) { + // + XMinMax result = {}; + + // + int bufferSize = ArraySize(buffer); + if (bufferSize < 1) { + return result; + } + + // + double min = buffer[0]; + double max = buffer[0]; + + // + for (int i = 1; i < bufferSize; i++) { + // + if (buffer[i] < min) { + min = buffer[i]; + } else if (buffer[i] > max) { + max = buffer[i]; + } + } + + // + result.min = min; + result.max = max; + + // + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..0a1e0e2 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length = 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.models.lib.mq4 b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.models.lib.mq4 new file mode 100644 index 0000000..dbf8bd9 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.models.lib.mq4 @@ -0,0 +1,217 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// + +// +// Used Indicators List ... +const string xmaIndicatorName = "x-saherelm.xma"; +const string adxIndicatorName = "x-saherelm.adx"; +const string oscIndicatorName = "x-saherelm.osc"; +const string zigZagIndicatorName = "x-saherelm.zigzag"; + +// +// Direction ... +enum X_DIRECTION { + X_UP, + X_DOWN +}; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +// we model OSC Return Data ... +struct XOSCState { + // + double fastOSC; + double fastOSCPrev; + + // + double slowOSC; + double slowOSCPrev; + + // + double powerOSC; + double powerOSCPrev; + + // + double varOSC; + double varOSCPrev; + + // + double tanFSOSC; + + // + bool isOSCCrossOver; + bool isOSCCrossUnder; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XMAState { + // + // Short Cycle ... + // + // FAST ... + double scFast; + double scFastPrev; + + // + // SLOW ... + double scSlow; + double scSlowPrev; + + // + bool isSCTrendUp; + + // + // Medium Cycle ... + // + // FAST ... + double mcFast; + double mcFastPrev; + + // + // SLOW ... + double mcSlow; + double mcSlowPrev; + + // + // Long Cycle ... + // + // FAST ... + double lcFast; + double lcFastPrev; + + // + // SLOW ... + double lcSlow; + double lcSlowPrev; + + // + // MIDDLEAGE ... + double marketMiddleage; + double marketMiddleagePrev; +}; + +// +struct XMAOverView { + // + bool isSCTrendUp; + bool isSCTrendDown; + + // + bool isMCTrendUp; + bool isMCTrendDown; + + // + bool isLCTrendUp; + bool isLCTrendDown; +}; + +// +// Represent ADX State ... +struct XADXState { + // + double trendPower; + double trendPowerPrev; + + // + double upDirection; + double upDirectionPrev; + + // + double downDirection; + double downDirectionPrev; + + // + bool isUpTrend; + bool isDownTrend; +}; + +// +// ZigZag State ... +struct XZigZagState { + // + double zigZag; + datetime zigZagTime; + + // + double zigZagPrev; + datetime zigZagPrevTime; + + // + double zigZagPrevPrev; + datetime zigZagPrevPrevTime; + + // + double low; + int lowBarIndex; + datetime lowTime; + + // + double high; + int highBarIndex; + datetime highTime; + + // + double delta; + + // + bool isWaitForTrendUp; + bool isWaitForTrendDown; +}; + +// +// Parse Use full Info about ZigZag State ... +struct XZigZagOverView { + // + bool isTrendUp; + bool isTrendDown; +}; +// +// End Models ... +// diff --git a/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..e10bbf2 --- /dev/null +++ b/Bkp/Used/OSC EA 14020410/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,3195 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.osc.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; + +// +static XMAState xmaState; +static XOSCState oscState; +static XADXState adxState; +static XMAOverView xmaOverview; +static XZigZagState zigZagState; +static XZigZagOverView zigZagOverView; + +// +static double zigZagValues[]; +static datetime zigZagTimes[]; + +// +static double highs[]; +static datetime highTimes[]; + +// +static double lows[]; +static datetime lowTimes[]; + +// +static double scTrendPowerMax; +static double scTrendPowerMin; +static double scTrendPowers[]; +static datetime scTrendPowerTimes[]; + +// +static double mcTrendPowerMax; +static double mcTrendPowerMin; +static double mcTrendPowers[]; +static datetime mcTrendPowerTimes[]; + +// +static double lcTrendPowerMax; +static double lcTrendPowerMin; +static double lcTrendPowers[]; + +// +// Retrieve ZigZag State ... +XZigZagState GetZigZagState( + const int bar_index, + int zDpt = 7, + int zDev = 5, + int zBkStp = 3 +) { + // + XZigZagState result = {}; + + // + // Free Arrays ... + ArrayFree(zigZagTimes); + ArrayFree(zigZagValues); + + // + int counter = bar_index; + int numberOfZigZagValues = zDpt; + + // + // START Retrieve ZigZag ... + // + // + int lastNonZeroIndex = 0; + while (lastNonZeroIndex < numberOfZigZagValues - 1) { + // + // Retrieve ZigZag Value ... + double zigZagValue = iCustom( + _Symbol, + _Period, + zigZagIndicatorName, + zDpt, // Depth ... + zDev, // Deviation ... + zBkStp, // BackStep ... + 0, // Buffer Index ... + counter // Bar Index ... + ); + + // + if (zigZagValue != 0.0) { + // + // Retrieve Non Zero ZigZag Time ... + datetime zigZagTime = iTime( + _Symbol, + _Period, + counter + ); + + // + ArrayResize( + zigZagTimes, + ArraySize(zigZagTimes) + 1 + ); + ArrayResize( + zigZagValues, + ArraySize(zigZagValues) + 1 + ); + zigZagValues[lastNonZeroIndex] = zigZagValue; + zigZagTimes[lastNonZeroIndex] = zigZagTime; + + // + // Increase Index Value ... + lastNonZeroIndex++; + } + + // + // Increase Bar Index ... + counter++; + } + + // + double lastValue = zigZagValues[0]; + datetime lastValueTime = zigZagTimes[0]; + + // + double lastPrevValue = zigZagValues[1]; + datetime lastPrevValueTime = zigZagTimes[1]; + + // + double lastPrevPrevValue = zigZagValues[2]; + datetime lastPrevPrevValueTime = zigZagTimes[2]; + // + // END Retrieve ZigZag ... + // + + // + result.zigZag = lastValue; + result.zigZagTime = lastValueTime; + + // + result.zigZagPrev = lastPrevValue; + result.zigZagPrevTime = lastPrevValueTime; + + // + result.zigZagPrevPrev = lastPrevPrevValue; + result.zigZagPrevPrevTime = lastPrevPrevValueTime; + + // + double delta = lastPrevPrevValue - lastPrevValue; + result.delta = delta; + + // + bool isWaitForTrendUp = delta > 0; + result.isWaitForTrendUp = !isWaitForTrendUp; + + // + bool isWaitForTrendDown = delta < 0; + result.isWaitForTrendDown = !isWaitForTrendDown; + + // + double low = isWaitForTrendUp ? + lastPrevValue : + lastPrevPrevValue; + datetime lowTime = isWaitForTrendUp ? + lastPrevValueTime : + lastPrevPrevValueTime; + int lowBarIndex = iBarShift( + _Symbol, + _Period, + lowTime + ); + // + result.low = low; + result.lowTime = lowTime; + result.lowBarIndex = lowBarIndex; + + // + double high = isWaitForTrendUp ? + lastPrevPrevValue : + lastPrevValue; + datetime highTime = isWaitForTrendUp ? + lastPrevPrevValueTime : + lastPrevValueTime; + int highBarIndex = iBarShift( + _Symbol, + _Period, + highTime + ); + + // + result.high = high; + result.highTime = highTime; + result.highBarIndex = highBarIndex; + + // + return result; +} + +// +// Retrieve ZigZag Overview ... +XZigZagOverView GetZigZagOverView() { + // + XZigZagOverView result = {}; + + // + // Free Arrays ... + ArrayFree(highs); + ArrayFree(lows); + ArrayFree(lowTimes); + ArrayFree(highTimes); + + // + // Validate Arrays ... + int valuesBufferSize = ArraySize(zigZagValues); + if ( + valuesBufferSize <= 1 + || valuesBufferSize != ArraySize(zigZagTimes) + ) { + return result; + } + + // + // Calculate First high, low ... + bool isFirstItemLow = zigZagValues[0] < zigZagValues[1]; + + // + int pos = 0; + int index = 0; + while (index <= valuesBufferSize - 1) { + // + ArrayResize( + lows, + ArraySize(lows) + 1 + ); + lows[pos] = isFirstItemLow + ? zigZagValues[index] + : zigZagValues[index + 1]; + + // + ArrayResize( + lowTimes, + ArraySize(lowTimes) + 1 + ); + lowTimes[pos] = isFirstItemLow + ? zigZagTimes[index] + : zigZagTimes[index + 1]; + + // + ArrayResize( + highs, + ArraySize(highs) + 1 + ); + highs[pos] = isFirstItemLow + ? zigZagValues[index + 1] + : zigZagValues[index]; + + // + ArrayResize( + highTimes, + ArraySize(highTimes) + 1 + ); + highTimes[pos] = isFirstItemLow + ? zigZagTimes[index + 1] + : zigZagTimes[index]; + + // + pos++; + + // + index += 2; + } + + // + // Now we have going to calculate Trends Based on highs and lows ... + // these calculations done using Highs and Lows Buffer ... + // + double lastLow = 0; + double lastHigh = 0; + bool isTrendUp = true; + bool isTrendDown = true; + double smoothValue = (5 * _Point); + + // + int highBufferSize = ArraySize(highs); + if (highBufferSize > 2) { + // + for (int i = 0; i <= highBufferSize - 1; i++) { + // + lastHigh = i + 1 <= highBufferSize - 1 + ? + highs[i + 1] + : + 0 + ; + + // + isTrendUp = isTrendUp + && ( + highs[i] >= lastHigh + || MathAbs(highs[i] - lastHigh) <= smoothValue + ); + } + } else { + // + isTrendUp = false; + } + result.isTrendUp = isTrendUp; + + // + int lowsBufferSize = ArraySize(lows); + if (lowsBufferSize > 2) { + // + for (int i = 0; i <= lowsBufferSize - 1; i++) { + // + lastLow = i + 1 <= lowsBufferSize - 1 + ? + lows[i + 1] + : + 0 + ; + + // + isTrendDown = isTrendDown + && ( + lows[i] <= lastLow + || MathAbs(lows[i] - lastLow) <= smoothValue + ); + } + } else { + // + isTrendDown = false; + } + result.isTrendDown = isTrendDown; + + // + return result; +} + +// +// Retrieve State ... +XOSCState GetOSCState( + const int bar_index, + const int foLen, + const double foMul, + const int slLen, + const double slMul +) { + // + // Define Trend Direction Related Values ... + // + XOSCState result = {}; + + // + // START Extract Data from Oscillator ... + // + // + // Fast OSC ... + double fastOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + ); + result.fastOSC = fastOSC; + + // + // Prev FastOSC ... + double fastOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + 1 + ); + result.fastOSCPrev = fastOSCPrev; + + // + // Slow OSC ... + double slowOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + ); + result.slowOSC = slowOSC; + + // + // Prev Slow OSC ... + double slowOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + 1 + ); + result.slowOSCPrev = slowOSCPrev; + + // + // Power OSC ... + double powerOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + ); + result.powerOSC = powerOSC; + + // + double powerOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + 1 + ); + result.powerOSCPrev = powerOSCPrev; + + // + // Var OSC ... + double varOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + ); + result.varOSC = varOSC; + + // + double varOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + 1 + ); + result.varOSCPrev = varOSCPrev; + + // + // Tan FS OSC ... + double tanFSOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 4, // Tan F/S OSC Buffer Index ... + bar_index + ); + result.tanFSOSC = tanFSOSC; + // + // END Extract Data from Oscillator ... + // + + // + // Calculations ... + // + bool isOSCCrossOver = fastOSC > slowOSC && + !(fastOSCPrev > slowOSCPrev); + result.isOSCCrossOver = isOSCCrossOver; + + // + bool isOSCCrossUnder = fastOSC < slowOSC && + !(fastOSCPrev < slowOSCPrev); + result.isOSCCrossUnder = isOSCCrossUnder; + + // + return result; +} + +// +// Check Market Ranging or not based on OSC ... +bool IsOSCMarketRanging( + // + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double rangingThreshold, // Detect Ranging based On Power OSC ... + // + // OSC Specifications ... + const int foLen, // Fast OSC Length ... + const double foMul, // Fast OSC Multiplier ... + const int slLen, // Slow OSC Length ... + const double slMul // Slow OSC Multiplier ... +) { + // + bool result = false; + + // + // Detect Buffer Size ... + const int bufferSize = marketLen + bar_index; + double powerOSCBuffer[]; + ArraySetAsSeries( + powerOSCBuffer, + true + ); + ArrayResize( + powerOSCBuffer, + bufferSize + ); + + // + // Loop through Market for Extract PowerOSC from OSC Indicator ... + for (int i = bufferSize - 1; i >= 0; i--) { + // + // Retrieve OSC State at Specific Bar Index ... + XOSCState state = GetOSCState( + i, + foLen, + foMul, + slLen, + slMul + ); + + // + powerOSCBuffer[i] = state.powerOSC; + } + + // + // now we have to extract min and max value of Splitted Buffer ... + XMinMax minMax = GetBufferMinMax(powerOSCBuffer); + + // + // now Check Min and Max Direction and Compare them with Ranging Value ... + result = MathAbs(minMax.min) > rangingThreshold + || MathAbs(minMax.max) > rangingThreshold; + + // + return result; +} + +// +// Retrieve and Calculate XMA State ... +XMAState GetXMAState( + // + // Market Specification Inpouts ... + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + // XMA Inputs ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // Temp Result ... + XMAState result = {}; + + // + // START Reading Buffers ... + // + // + // Define BufferIndexes ... + int scFastBufIndex = 0; + int scSlowBufIndex = 1; + int mcFastBufIndex = 2; + int mcSlowBufIndex = 3; + int lcFastBufIndex = 4; + int lcSlowBufIndex = 5; + int midBufIndex = 6; + + // + // START Short Cycle ... + // + // + // Short Cycle Fast ... + double scFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + ); + result.scFast = scFast; + + // + // Short Cycle Previous Fast ... + double scFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scFastPrev = scFastPrev; + + // + // Short Cycle Slow ... + double scSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + ); + result.scSlow = scSlow; + + // + // Short Cycle Previous Slow ... + double scSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scSlowPrev = scSlowPrev; + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + // Medium Cycle Fast ... + double mcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + ); + result.mcFast = mcFast; + + // + // Medium Cycle Previous Fast ... + double mcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcFastPrev = mcFastPrev; + + // + // Medium Cycle Slow ... + double mcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.mcSlow = mcSlow; + + // + // Medium Cycle Previous Slow ... + double mcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcSlowPrev = mcSlowPrev; + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + // Long Cycle Fast ... + double lcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + ); + result.lcFast = lcFast; + + // + // Long Cycle Previous Fast ... + double lcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcFastPrev = lcFastPrev; + + // + // Long Cycle Slow ... + double lcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.lcSlow = lcSlow; + + // + // Long Cycle Previous Slow ... + double lcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcSlowPrev = lcSlowPrev; + // + // END Long Cycle ... + // + + // + // START Makret Middleage ... + // + // + // Market Middleage ... + double marketMiddleage = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + ); + result.marketMiddleage = marketMiddleage; + + // + // Previous Market Middleage ... + double marketMiddleagePrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.marketMiddleagePrev = marketMiddleagePrev; + // + // END Makret Middleage ... + // + // + // END Reading Buffers ... + // + + // + return result; +} + +XMAOverView GetXMAOverView( + // + // Market Specification Inpouts ... + const int bar_index, // Bar Index ... + const int marketLen, // Market Length + // + // XMA Inputs ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + XMAOverView result = {}; + + // + // Clear Arrays ... + ArrayFree(scTrendPowers); + ArrayFree(scTrendPowerTimes); + + // + ArrayFree(mcTrendPowers); + ArrayFree(mcTrendPowerTimes); + + // + ArrayFree(lcTrendPowers); + + // + scTrendPowerMin = 0; + scTrendPowerMax = 0; + + // + mcTrendPowerMin = 0; + mcTrendPowerMax = 0; + + // + lcTrendPowerMin = 0; + lcTrendPowerMax = 0; + + // + bool isSCFastCrossOverSlow = false; + bool isSCFastCrossUnderSlow = false; + + // + bool isMCFastCrossOverSlow = false; + bool isMCFastCrossUnderSlow = false; + + // + // Create a Loop for retrieveing info ... + int index = bar_index; + while ( + !(isSCFastCrossOverSlow + && isSCFastCrossUnderSlow + && isMCFastCrossOverSlow + && isMCFastCrossUnderSlow + ) + ) { + // + // Retrieve State of XMA ... + XMAState state = GetXMAState( + // + // Bar Index ... + index, // Bar Index ... + // + // Market Length ... + marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + // Filling Arrays ... + datetime time = iTime( + _Symbol, + _Period, + index + ); + + // + // START Short Cycle ... + // + // + int scTrendPowerSize = ArraySize(scTrendPowers); + if (bar_index > 0 && scTrendPowerSize == 0) { + // + int delta = bar_index; + ArrayResize( + scTrendPowers, + delta + ); + ArrayResize( + scTrendPowerTimes, + delta + ); + + // + // Fill Array by Zero ... + for (int i=0; i < bar_index; i++) { + scTrendPowers[i] = 0; + scTrendPowerTimes[i] = 0; + } + } else { + // + ArrayResize( + scTrendPowers, + scTrendPowerSize + 1 + ); + ArrayResize( + scTrendPowerTimes, + scTrendPowerSize + 1 + ); + } + + // + double scTPower = MathAbs(state.scFast - state.scSlow); + scTrendPowers[index] = scTPower; + scTrendPowerTimes[index] = time; + + // + // Calculate Min and Max ... + scTrendPowerMin = + scTrendPowerMin == 0 + || scTPower < scTrendPowerMin + ? + scTPower + : + scTrendPowerMin; + scTrendPowerMax = + scTPower > scTrendPowerMax ? + scTPower : + scTrendPowerMax; + + // + // Check Cross Over ... + if (!isSCFastCrossOverSlow) { + // + isSCFastCrossOverSlow = + state.scFast > state.scSlow + && !(state.scFastPrev > state.scSlowPrev); + } + + // + // Check Cross Under ... + if (!isSCFastCrossUnderSlow) { + // + isSCFastCrossUnderSlow = + state.scFast < state.scSlow + && !(state.scFastPrev < state.scSlowPrev); + } + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + int mcTrendPowerSize = ArraySize(mcTrendPowers); + if (bar_index > 0 && mcTrendPowerSize == 0) { + // + int delta = bar_index; + ArrayResize( + mcTrendPowers, + delta + ); + ArrayResize( + mcTrendPowerTimes, + delta + ); + + // + // Fill Array by Zero ... + for (int i=0; i < bar_index; i++) { + mcTrendPowers[i] = 0; + mcTrendPowerTimes[i] = 0; + } + } else { + // + ArrayResize( + mcTrendPowers, + mcTrendPowerSize + 1 + ); + ArrayResize( + mcTrendPowerTimes, + mcTrendPowerSize + 1 + ); + } + + // + double mcTPower = MathAbs(state.mcFast - state.mcSlow); + mcTrendPowers[index] = mcTPower; + mcTrendPowerTimes[index] = time; + + // + // Calculate Min and Max ... + mcTrendPowerMin = + mcTrendPowerMin == 0 + || mcTPower < mcTrendPowerMin + ? + mcTPower + : + mcTrendPowerMin; + mcTrendPowerMax = + mcTPower > mcTrendPowerMax ? + mcTPower : + mcTrendPowerMax; + + // + // Check Cross Over ... + if (!isMCFastCrossOverSlow) { + // + isMCFastCrossOverSlow = + state.mcFast > state.mcSlow + && !(state.mcFastPrev > state.mcSlowPrev); + } + + // + // Check Cross Under ... + if (!isMCFastCrossUnderSlow) { + // + isMCFastCrossUnderSlow = + state.mcFast < state.mcSlow + && !(state.mcFastPrev < state.mcSlowPrev); + } + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + int lcTrendPowerSize = ArraySize(lcTrendPowers); + if (bar_index > 0 && lcTrendPowerSize == 0) { + // + int delta = bar_index; + ArrayResize( + lcTrendPowers, + delta + ); + + // + // Fill Array by Zero ... + for (int i=0; i < bar_index; i++) { + lcTrendPowers[i] = 0; + } + } else { + // + ArrayResize( + lcTrendPowers, + lcTrendPowerSize + 1 + ); + } + + // + double lcTPower = MathAbs(state.lcFast - state.lcSlow); + lcTrendPowers[index] = lcTPower; + + // + // Calculate Min and Max ... + lcTrendPowerMin = + lcTrendPowerMin == 0 + || lcTPower < lcTrendPowerMin + ? + lcTPower + : + lcTrendPowerMin; + lcTrendPowerMax = + lcTPower > lcTrendPowerMax ? + lcTPower : + lcTrendPowerMax; + // + // END Long Cycle ... + // + + // + // Fill Calculations ... + + + // + index++; + } + + // + return result; +} + +// +// Retrieve XADX State ... +XADXState GetADXState( + // + const int bar_index, // Bar Index ... + // + const int marketLen // Market Length ... +) { + // + // Temp Result ... + XADXState result = {}; + + // + // Define Buffer Index ... + int adxBufferIndex = 0; + int positiveBufferIndex = 1; + int negativeBufferIndex = 2; + + // + ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; + + // + // START Recieve Buffers ... + // + // + // TRENDPOWER ... + double trendPower = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + adxBufferIndex, // ADX Trend Power Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.trendPower = trendPower; + + // + // TRENDPOWER Prev ... + double trendPowerPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + adxBufferIndex, // ADX Trend Power Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.trendPowerPrev = trendPowerPrev; + + // + // UP Dir ... + double upDirection = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + positiveBufferIndex, // Up Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.upDirection = upDirection; + + // + // UP Dir Prev ... + double upDirectionPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + positiveBufferIndex, // Up Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.upDirectionPrev = upDirectionPrev; + + // + // DOWN Dir ... + double downDirection = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + negativeBufferIndex, // Down Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.downDirection = downDirection; + + // + // DOWN Dir Prev ... + double downDirectionPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + negativeBufferIndex, // Down Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.downDirectionPrev = downDirectionPrev; + // + // END Recieve Buffers ... + // + + // + // Calculations ... + + // + bool isUpTrend = upDirection > downDirection + && upDirectionPrev > downDirectionPrev; + result.isUpTrend = isUpTrend; + + // + bool isDownTrend = upDirection < downDirection + && upDirectionPrev < downDirectionPrev; + result.isDownTrend = isDownTrend; + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + X_DIRECTION direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction == X_UP ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest CalculateSignal( + // + const int bar_index, // Bar Index ... + // + // MARKET Specifications ... + const int marketLen, // Market Length ... + const double r2r, // Risk To Reward Ratio ... + // + // XMA Inputs ... + // + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor, // Medium Cycle Slow Color ... + // + // OSC Inputs ... + const int fastOSCLen, // FastOSC Length ... + const double fastOSCMul, // FastOSC Multiplier ... + const int slowOSCLen, // SlowOSC Length ... + const double slowOSCMul, // SlowOSC Multiplier ... + const double minPowOSC, // Minimum Signal Power ... + const double minVarOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + const int zDev, // ZigZag Deviation ... + const int zBkStep // ZigZag Back Step ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + // Retrieve ZigZag State ... + + // + // START Capturing Signal ... + // + // + // START Retrieve Statets ... + // + // Reading Oscillator State ... + oscState = GetOSCState( + bar_index, + fastOSCLen, + fastOSCMul, + slowOSCLen, + slowOSCMul + ); + + // + // Retrieve ZigZag State ... + zigZagState = GetZigZagState( + bar_index, + marketLen, + zDev, + zBkStep + ); + + // + zigZagOverView = GetZigZagOverView(); + + // + // Retrieve Market Trend ... + xmaState = GetXMAState( + // + // Bar Index ... + bar_index, // Bar Index ... + // + // Market Length ... + marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + xmaOverview = GetXMAOverView( + // + // Bar Index ... + bar_index, // Bar Index ... + // + // Market Length ... + marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + // Retrieve ADX State ... + adxState = GetADXState( + // + bar_index, // Bar Index ... + // + marketLen // Market Length ... + ); + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + // + // START PRICE Calculations ... + // + RefreshRates(); + + // + double candleLow = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double candleHigh = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + // + // END PRICE Calculations ... + // + + // + // START LONG Signals ... + // + bool hasLongSignal = false; + + // + // XMA Based Signals ... + hasLongSignal = + // + // XMA ... + // + // SC Fast Cross Over Market Middleage ... + xmaState.scFast > xmaState.marketMiddleage + && !(xmaState.scFastPrev > xmaState.marketMiddleage) + // + // when Short Cycle is Trending Up ... + && xmaState.scFast > xmaState.scSlow + && xmaState.scFastPrev > xmaState.scSlowPrev + // + // When Medium Cycle is Trending Up ... + && xmaState.mcFast > xmaState.mcSlow + && xmaState.mcFastPrev > xmaState.mcSlowPrev + // + // and Medium Cycle TrendPower is Going Up ... + && MathAbs(xmaState.mcFast - xmaState.mcSlow) > + MathAbs(xmaState.mcFastPrev - xmaState.mcSlowPrev) + // + // When Long Cycle is Trending Up ... + && xmaState.lcFast > xmaState.lcSlow + && xmaState.lcFastPrev > xmaState.lcSlowPrev + // + // and Long Cycle TrendPower is Going Up ... + && MathAbs(xmaState.lcFast - xmaState.lcSlow) > + MathAbs(xmaState.lcFastPrev - xmaState.lcSlowPrev) + // + // Short Cycle Slow bigger thhan Medium Cycle Fast ... + && xmaState.scSlow > xmaState.mcFast + // + // OSC ... + // Check OSC Fast and Slow is Less than 0.5 ... + && oscState.fastOSC < 0.5 + && oscState.slowOSC < 0.5 + && oscState.fastOSCPrev < 0.5 + && oscState.slowOSCPrev < 0.5 + && oscState.fastOSC > oscState.fastOSCPrev + // + // Check OSC Minimum Signal Power ... + // this Helps for Detect Market exits from Ranging ... + && minPowOSC > 0 + ? + // + // Check Conditions only if value provided ... + oscState.powerOSCPrev < 0 + && MathAbs(oscState.powerOSCPrev) > minPowOSC + : + // + // ... other wise, ignore ... + true + // + // Check Previous Candle Signal Power must be Lower than + // Current Signal Power and the Direction Must be Up Trend ... + && oscState.powerOSCPrev < oscState.powerOSC + // + // Also we Have to Check Market not ranging ... + && !IsOSCMarketRanging( + bar_index + 1, + marketLen, + minPowOSC, + fastOSCLen, + fastOSCMul, + slowOSCLen, + slowOSCMul + ) + // + // ZIGZAG ... + && zigZagState.isWaitForTrendDown + && !zigZagState.isWaitForTrendUp + // + // XADX ... + // TODO: add XADX Base Conditions for Long Trades ... + // When ADX Trend Power bigger than 20 and less than 50 ... + && !adxState.trendPower < 23 + && !adxState.trendPowerPrev < 23 + // + // Check Trend Direction for Signals ... + && adxState.upDirection > adxState.downDirection + && adxState.upDirectionPrev > adxState.downDirectionPrev + // && adxState.trendPower < 50 + // && adxState.trendPower > adxState.trendPowerPrev + // + // PRICE Checking ... + // price must be less than Candle High at openning time ... + && longEntryPrice <= candleHigh + // + // also Candle High and Low must be above than lc Fast & lc Slow ... + && longEntryPrice > xmaState.lcFast + && longEntryPrice > xmaState.lcSlow + && ( + !IsSharpBullishHappens( + bar_index, + marketLen * 2 + ) + || IsSharpBearishHappens( + bar_index, + marketLen * 2 + ) + ) + ; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = false; + + // + // Recieve Signals Based on XOSC ... + // hasShortSignal = + // oscState.hasShortSignal + // ; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap; + double sl = 0; + double risk; + double reward; + double tp = 0; + double r2rRatio = r2r; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Fill Signal Related Variables ... + if (hasLongSignal) { + // + totalLongSignals++; + + // + price = longEntryPrice; + priceGap = longPriceGap; + + // // + // // Setting Up SL Based on Prev Candle ... + // sl = prevCandleLow; + + // + // Setting Up SL Based on Last Market Lowest ... + sl = GetMarketLowestLow( + bar_index, + marketLen + ); + + // // + // // Setting Up SL Based on Prev Candle Less Low Price ... + // sl = GetLowLessCandlePrice( + // bar_index, + // price + // ); + + // + // Check if ZigZag shows TrendUp increase r2rRatio ... + if ( + ( + xmaState.marketMiddleage < highs[0] + && xmaState.marketMiddleage > candleLow + ) + || ( + zigZagOverView.isTrendUp + && !zigZagOverView.isTrendDown + ) + ) { + // + r2rRatio = r2r + (r2r * 0.6); + } + + // + risk = price - sl; + reward = risk * r2rRatio; + tp = price + reward; + + // + // Check TP Based On ZigZag High .. + if ( + tp > zigZagState.high + && !zigZagOverView.isTrendUp + ) { + tp = zigZagState.high - (5 * _Point); + } + + // + // Check TP based on Spread ... + if (tp < price + priceGap) { + tp = tp + priceGap; + } + } else if (hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // // + // // Setting Up SL Based On Prev Candle ... + // sl = prevCandleHigh; + + // // + // // Setting Up SL Based on Last Market Highest ... + // sl = GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + // Setting Up SL Based on Prev Candle Great High Price ... + sl = GetHighGreatCandlePrice( + bar_index, + price + ); + + // + risk = sl - price; + reward = risk * r2r; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = 0; // sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + // + // END Capturing Signal ... + // + + // + // Fill Result ... + result.hasSignal = hasSignal; + result.signal = signal; + result.type = signal.type; + + // + return result; +} + +// +// START Signal Verification Functions ... +// +// +// END Signal Verification Functions ... +// + +// +// START Market State Functions ... +// +// +// END Market State Functions ... +// + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entryPrice, + signal.time, + signal.entryPrice, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entryPrice > signal.tp + ) || + ( + !hasLongSignal + && signal.entryPrice < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, "_", + label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit > 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// +// +// END Orders Functions ... +// diff --git a/Bkp/Used/OSC EA 14020414/Experts/x-saherelm.osc.ea.mq4 b/Bkp/Used/OSC EA 14020414/Experts/x-saherelm.osc.ea.mq4 new file mode 100644 index 0000000..36d1e89 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Experts/x-saherelm.osc.ea.mq4 @@ -0,0 +1,695 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST_OSC Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// +// ShortName: XST_OSC +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST_OSC Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_OSC"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 1.5; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.05; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 480; // Close All Open Trades After Passed Candles +input bool closeAllInProfitOpenTradesWhenMaxOpenTradesReached = true; // Close All In Profit Open Trades When Max Open Trades Reached and New Signal Income + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// Power OSC ... +input double minPowerOSC = 0.04; // Minimum Signal Power + +// +// Variance OSC ... +input double minVarianceOSC = 0; // Minimum Var Power + +// +// ZIGZAG Inputs ... +input int zDeviation = 5; // ZigZag Deviation +input int zBackStep = 3; // ZigZag Back Step + +// +// XMA Inputs ... +// +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showPSar = true; // Show Parabolic Sar +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.osc.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || minPowerOSC < 0 + || minVarianceOSC < 0 + || slowOSCLength <= fastOSCLength + // + // ZIGZAG ... + || zDeviation < 0 + || zBackStep < 0 + || zBackStep >= marketLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_OSC"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State in Big Picture ... + + // + // Prevent from Checking, if there is no states available ... + if (ArraySize(xmaStates) == 0) { + return; + } + + // + // TODO: Determines Where and How close Long Trades on Trend Reversal Points ... + closeLongTrades = + false + // + // Check When Parabolic SAR Reverse Direction Happens ... + // || ( + // isParabolicCrossOverMarketMiddle + // && !isMCTrendUp + // ) + ; + + // + waitForLongSignals = + true + // waitForLongSignals + // ? + // // + // // Usually Conditions ... + // // Chanege to False ... + // isMCTrendUp + // && isSCTrendUp + // : + // // + // // Reverse Come Back Conditions ... + // // Change to True ... + // isMCFastCrossOverSlow + // || isSCFastCrossUnderSlow + ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + // + countedBars++; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + } + } + + // + // Retrieve Signal Exists ... + request = CalculateSignal( + // + // Bar Index ... + 0, + // + // Market Specification Inpouts ... + marketLength, // Market Length ... + closeAllOpenTradesAfterCandle, // Reverse Lookup in Market ... + riskToRewardRatio, // Risk To Reward Ratio ... + step, // PSAR Step ... + maximum, // PSAR Maximum ... + // + // XMA Inputs ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSar, + showShortCycle, + showShortCycleCrossLines, + showMediumCycle, + showMediumCycleCrossLines, + showLongCycle, + showLongCycleCrossLines, + // + // Color Inputs ... + pSarColor, + shortCycleFastColor, + shortCycleSlowColor, + mediumCycleFastColor, + mediumCycleSlowColor, + longCycleFastColor, + longCycleSlowColor, + // + // OSC ... + fastOSCLength, // FastOSC Length ... + fastOSCMultiplier, // FastOSC Multiplier ... + slowOSCLength, // SlowOSC Length ... + slowOSCMultiplier, // SlowOSC Multiplier ... + minPowerOSC, // Minimum Signal Power ... + minVarianceOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + zDeviation, // ZigZag Deviation ... + zBackStep // ZigZag Back Step ... + ); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < marketLength; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (closeAllInProfitOpenTradesWhenMaxOpenTradesReached) { + // + // Close All In Profit Trades ... + bool hasClosedInProfitTrade = CloseAllInProfitTrades(); + if (hasClosedInProfitTrade) { + // + openTrades = CountOpenTrades(); + + // + allowDoTrade = !(openTrades >= maxOpenTrades); + } + } + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + waitForLongSignals = false; + } + } + + // + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + waitForShortSignals = false; + } + } + + // + // bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + // closeAllOpenTradesAfterCandle + // ); + + // // + // // Close Maximum DrawDown Passed Trades ... + // bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + // maxDrawdownPercentPerPTrade + // ); + + // // + // if ( + // hasClosedLongTimeTrade + // || hasClosedInDrawDownLongTrade + // ) { + // // + // waitForLongSignals = false; + // waitForShortSignals = false; + // } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/ParabolicSar.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/ParabolicSar.mq4 new file mode 100644 index 0000000..261808a --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/ParabolicSar.mq4 @@ -0,0 +1,333 @@ +//------------------------------------------------------------------ +#property copyright "www.forex-station.com" +#property link "www.forex-station.com" +//------------------------------------------------------------------ +#property indicator_chart_window +#property indicator_buffers 4 +#property indicator_color1 clrLimeGreen +#property indicator_color2 clrOrange +#property indicator_color3 clrLimeGreen +#property indicator_color4 clrOrange +#property indicator_width3 3 +#property indicator_width4 3 +#property strict + +// +// +// +// +// + +extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame to use +extern double AccStep = 0.02; // Accumulation step +extern double AccLimit = 0.2; // Accumulation limit +extern ENUM_APPLIED_PRICE PriceHigh = PRICE_CLOSE; // Psar high price +extern ENUM_APPLIED_PRICE PriceLow = PRICE_CLOSE; // Psar low price +extern int PriceSmoothing = 0; // Psar smoothing +extern ENUM_MA_METHOD PriceSmoothingMethod = MODE_SMA; // Psar ma smoothing method +extern bool alertsOn = true; // Alerts on? +extern bool alertsOnCurrent = false; // Alerts on current open bar? +extern bool alertsMessage = true; // Alerts message? +extern bool alertsSound = false; // Alerts sound? +extern bool alertsEmail = false; // Alerts email? +extern bool alertsNotify = false; // Alerts notification by phone? +extern bool DrawAsDots = true; // Draw as dots or solid line +extern int Shift = 0; // Shift + +double sarUp[]; +double sarDn[]; +double saraUp[]; +double saraDn[]; +int timeFrame; +string indicatorFileName; +bool returnBars; + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +int init() +{ + int type = DRAW_LINE; if (DrawAsDots) type = DRAW_ARROW; + SetIndexBuffer(0,sarUp); SetIndexStyle(0,type); SetIndexArrow(0,159); + SetIndexBuffer(1,sarDn); SetIndexStyle(1,type); SetIndexArrow(1,159); + SetIndexBuffer(2,saraUp); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); + SetIndexBuffer(3,saraDn); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,159); + + // + // + // + // + // + + indicatorFileName = WindowExpertName(); + returnBars = (TimeFrame==-99); + TimeFrame = MathMax(TimeFrame,_Period); + PriceSmoothing = MathMax(PriceSmoothing,1); + for (int i=0; i<4; i++) SetIndexShift(i,Shift*timeFrame/Period()); + + // + // + // + // + // + + return(0); +} +int deinit() { return(0); } + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +int start() +{ + int i,counted_bars=IndicatorCounted(); + if(counted_bars < 0) return(-1); + if(counted_bars>0) counted_bars--; + int limit = MathMin(Bars-counted_bars,Bars-1); + if (returnBars) { sarUp[0] = limit+1; return(0); } + + // + // + // + // + // + + if (TimeFrame == Period()) + { + for(i = limit; i >= 0; i--) + { + double sarClose; + double sarOpen; + double sarPosition; + double sarChange; + double pHigh = iMA(NULL,0,PriceSmoothing,0,PriceSmoothingMethod,PriceHigh,i); + double pLow = iMA(NULL,0,PriceSmoothing,0,PriceSmoothingMethod,PriceLow ,i); + iParabolic(fmax(pHigh,pLow),fmin(pHigh,pLow),AccStep,AccLimit,sarClose,sarOpen,sarPosition,sarChange,i); + sarUp[i] = EMPTY_VALUE; + sarDn[i] = EMPTY_VALUE; + saraUp[i] = EMPTY_VALUE; + saraDn[i] = EMPTY_VALUE; + if (sarPosition==1) + sarUp[i] = sarClose; + else sarDn[i] = sarClose; + if (sarChange!=0) + if (sarChange==1) + saraUp[i] = sarClose; + else saraDn[i] = sarClose; + } + manageAlerts(); + return(0); + } + + // + // + // + // + // + + limit = (int)fmax(limit,fmin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period())); + for(i=limit; i>=0; i--) + { + int y = iBarShift(NULL,TimeFrame,Time[i]); + int x = iBarShift(NULL,TimeFrame,Time[i+1]); + sarUp[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,0,y); + sarDn[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,1,y); + saraUp[i] = EMPTY_VALUE; + saraDn[i] = EMPTY_VALUE; + if (x!=y) + { + saraUp[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,2,y); + saraDn[i] = iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,AccStep,AccLimit,PriceHigh,PriceLow,PriceSmoothing,PriceSmoothingMethod,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsEmail,0,3,y); + } + } + return(0); + +} + +//------------------------------------------------------------------ +// +//------------------------------------------------------------------ +// +// +// +// +// + +double work[][7]; +#define _high 0 +#define _low 1 +#define _ohigh 2 +#define _olow 3 +#define _open 4 +#define _position 5 +#define _af 6 + + +void iParabolic(double high, double low, double step, double limit, double& pClose, double& pOpen, double& pPosition, double& pChange, int i) +{ + if (ArrayRange(work,0)!=Bars) ArrayResize(work,Bars); i = Bars-i-1; + + // + // + // + // + // + + pChange = 0; + work[i][_ohigh] = high; + work[i][_olow] = low; + if (i<1) + { + work[i][_high] = high; + work[i][_low] = low; + work[i][_open] = high; + work[i][_position] = -1; + return; + } + work[i][_open] = work[i-1][_open]; + work[i][_af] = work[i-1][_af]; + work[i][_position] = work[i-1][_position]; + work[i][_high] = fmax(work[i-1][_high],high); + work[i][_low] = fmin(work[i-1][_low] ,low ); + + // + // + // + // + // + + if (work[i][_position] == 1) + if (low<=work[i][_open]) + { + work[i][_position] = -1; + pChange = -1; + pClose = work[i][_high]; + work[i][_high] = high; + work[i][_low] = low; + work[i][_af] = step; + work[i][_open] = pClose + work[i][_af]*(work[i][_low]-pClose); + if (work[i][_open]work[i-1][_high] && work[i][_af]work[i ][_olow]) work[i][_open] = work[i ][_olow]; + if (work[i][_open]>work[i-1][_olow]) work[i][_open] = work[i-1][_olow]; + } + else + if (high>=work[i][_open]) + { + work[i][_position] = 1; + pChange = 1; + pClose = work[i][_low]; + work[i][_low] = low; + work[i][_high] = high; + work[i][_af] = step; + work[i][_open] = pClose + work[i][_af]*(work[i][_high]-pClose); + if (work[i][_open]>work[i ][_olow]) work[i][_open] = work[i ][_olow]; + if (work[i][_open]>work[i-1][_olow]) work[i][_open] = work[i-1][_olow]; + } + else + { + pClose = work[i][_open]; + if (work[i][_low]=0; i--) + if (tf==iTfTable[i]) return(sTfTable[i]); + return(""); +} \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.adx.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.adx.mq4 new file mode 100644 index 0000000..3271a4e --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.adx.mq4 @@ -0,0 +1,220 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +input ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; // Averaging Applied Price +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 3 + +// +#property indicator_level1 0.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_level4 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// ADX ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Positive Direction ... +#property indicator_width2 1 +#property indicator_color2 clrLime +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +// Negative Direction ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// Declare Buffers ... +#define adxBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double adxBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexLabel(positiveBufferIndex, "DI+"); + + // + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + SetIndexLabel(negativeBufferIndex, "DI-"); + + // + SetIndexBuffer(adxBufferIndex, adxBuffer); + SetIndexLabel(adxBufferIndex, "ADX"); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..220bd33 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,330 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 5 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 5 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// Power OSC ... +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASHDOTDOT + +// +// Var OSC ... +#property indicator_width4 1 +#property indicator_type4 DRAW_HISTOGRAM +#property indicator_color4 clrBlueViolet +#property indicator_style4 STYLE_SOLID + +// +// Tan Fast/Slow OSC ... +#property indicator_width5 0 +#property indicator_type5 DRAW_NONE +#property indicator_color5 clrNONE +#property indicator_style5 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 +#define powerOSCBufferIndex 2 +#define varOSCBufferIndex 3 +#define fastSlowOSCAngleBufferIndex 4 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; +double fastSlowOSCAngleBuffer[]; +double powerOSCBuffer[]; +double varOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + // Power OSC Buffer ... + SetIndexBuffer(powerOSCBufferIndex, powerOSCBuffer); + SetIndexLabel(powerOSCBufferIndex, "Power OSC"); + + // + // Var OSC Buffer ... + SetIndexBuffer(varOSCBufferIndex, varOSCBuffer); + SetIndexLabel(varOSCBufferIndex, "Var OSC"); + + // + // Tan Fast/Slow OSC Buffer ... + SetIndexBuffer(fastSlowOSCAngleBufferIndex, fastSlowOSCAngleBuffer); + SetIndexLabel(fastSlowOSCAngleBufferIndex, "F/L OSC Angle"); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; + + // + // Signal Power ... + // Difference Variant between FastOSC and Slow OSC ... + double powerOSC = fastOCS - slowOCS; + powerOSCBuffer[bar_index] = powerOSC; + + // + // Var OSC ... + double varOSC = fastOCS - 0.5; + varOSCBuffer[bar_index] = varOSC; + + // + // Calculate Tan Fast/Slow OSC ... + double fastOSCSlope = fastOSCBuffer[bar_index] - fastOSCBuffer[bar_index + 1]; + double slowOSCSlope = slowOSCBuffer[bar_index] - slowOSCBuffer[bar_index + 1]; + double tanFastSlowOSC = MathAbs( + (fastOSCSlope - slowOSCSlope) / (1 + (fastOSCSlope * slowOSCSlope)) + ); + + // + // here we pass Tan of angle ... + // fastSlowOSCAngleBuffer[bar_index] = tanFastSlowOSC; + + // + // here we pass degree of angle ... + fastSlowOSCAngleBuffer[bar_index] = MathArctan(tanFastSlowOSC); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.psar.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.psar.mq4 new file mode 100644 index 0000000..a263cdb --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.psar.mq4 @@ -0,0 +1,215 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center PSAR Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm PSAR Oscillator" +#property strict + +// +// START Inputs ... +// +input int shift = 0; // Shift +input double step = 0.02; // Step +input double maximum = 0.2; // Maximum +input bool drawAsDots = false; // Draw As Dots +// +input int priceSmoothing = 0; // Price Smoothing +input ENUM_APPLIED_PRICE priceLow = PRICE_CLOSE; // Psar low price +input ENUM_APPLIED_PRICE priceHigh = PRICE_OPEN; // Psar high price +input ENUM_MA_METHOD priceSmoothingMethod = MODE_SMA; // Price Smoothing Method +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_color1 clrLimeGreen +#property indicator_width1 1 +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_DOT + +// +#property indicator_color2 clrAqua +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +#property indicator_color3 clrFuchsia +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// +// Declare Buffers ... +// +#define sarBufferIndex 0 +#define upBufferIndex 1 +#define downBufferIndex 2 + +// +double sarBuffer[]; +double upBuffer[]; +double downBuffer[]; + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + SetIndexBuffer(sarBufferIndex, sarBuffer); + SetIndexLabel(sarBufferIndex, "SAR"); + + // + SetIndexBuffer(upBufferIndex, upBuffer); + SetIndexLabel(upBufferIndex, "Up"); + + // + SetIndexBuffer(downBufferIndex, downBuffer); + SetIndexLabel(downBufferIndex, "Down"); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_PSAR"; + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + // int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < 0) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate isarValue ... + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + double pHigh = iMA( + NULL, + _Period, + priceSmoothing, + 0, + priceSmoothingMethod, + priceHigh, + bar_index + ); + + // + double pLow = iMA( + _Symbol, + _Period, + priceSmoothing, + 0, + priceSmoothingMethod, + priceLow, + bar_index + ); + + // + upBuffer[bar_index] = pHigh; + sarBuffer[bar_index] = sarValue; + downBuffer[bar_index] = pLow; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..3512a17 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,688 @@ + /////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Market Specifications ... +input int marketLength = 7; // Market Length +input double step = 0.02; // SAR Step +input double maximum = 0.2; // SAR Maximum +// +// Cycle Definitions ... +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showPSar = true; // Show Parabolic Sar +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color pSarColor = clrCornflowerBlue; // Parabolic Sar Color +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 8 +#property indicator_plots 8 + +// +// Middle ... +#property indicator_label7 "Mid" +#property indicator_type7 DRAW_LINE +#property indicator_color7 clrBisque +#property indicator_style7 STYLE_DASHDOTDOT +#property indicator_width7 1 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 +#define pSarBufferIndex 7 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; +double pSarBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + SetIndexLabel(midBufferIndex, "Market Mid"); + + // + // Parabolic Sar ... + SetIndexBuffer(pSarBufferIndex, pSarBuffer); + SetIndexLabel(pSarBufferIndex, "P Sar"); + SetIndexStyle( + pSarBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showPSar ? + pSarColor : + clrNONE + ); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + + // + // Calculate Parabolic Sar ... + CalculateParabolicSar(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} + +void CalculateParabolicSar( + const int bar_index +) { + // + double sarValue = iSAR( + NULL, + _Period, + step, + maximum, + bar_index + ); + + // + pSarBuffer[bar_index] = sarValue; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..c1ccd2a --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1129 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + static datetime lastbar; + datetime curbar = (datetime)SeriesInfoInteger(_Symbol, _Period, SERIES_LASTBAR_DATE); + + // + if(lastbar != curbar) { + // + lastbar = curbar; + return true; + } + + // + return false; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishHappens( + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + bool result = false; + + // + double lowestHighInMarket = GetMarketLowestHigh( + bar_index + 1, + marketLen + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + result = high > lowestHighInMarket + && PriceToPips(high - lowestHighInMarket) >= 4 + ; + + // + return result; +} + +// +// Detect Market Has Sharp Bearish or not ... +bool IsSharpBearishHappens( + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + bool result = false; + + // + double highestLowInMarket = GetMarketHighestLow( + bar_index + 1, + marketLen + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + result = low < highestLowInMarket + && PriceToPips(highestLowInMarket - low) >= 4 + ; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +struct XMinMax { + double min; + double max; +}; + +// +// Find Min and Max Value of specific Buffer ... +XMinMax GetBufferMinMax(const double &buffer[]) { + // + XMinMax result = {}; + + // + int bufferSize = ArraySize(buffer); + if (bufferSize < 1) { + return result; + } + + // + double min = buffer[0]; + double max = buffer[0]; + + // + for (int i = 1; i < bufferSize; i++) { + // + if (buffer[i] < min) { + min = buffer[i]; + } else if (buffer[i] > max) { + max = buffer[i]; + } + } + + // + result.min = min; + result.max = max; + + // + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.models.lib.mq4 b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.models.lib.mq4 new file mode 100644 index 0000000..7165179 --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.models.lib.mq4 @@ -0,0 +1,127 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// +// +// Used Indicators List ... +const string xmaIndicatorName = "x-saherelm.xma"; +const string adxIndicatorName = "x-saherelm.adx"; +const string oscIndicatorName = "x-saherelm.osc"; +const string zigZagIndicatorName = "x-saherelm.zigzag"; + +// +// Direction ... +enum X_DIRECTION { + X_UP, + X_DOWN +}; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +// we model OSC Return Data ... +struct XOSCState { + // + double fastOSC; + double slowOSC; + + // + double powerOSC; + + // + double varOSC; + + // + double tanFSOSC; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XMAState { + // + // Short Cycle ... + // + // FAST ... + double scFast; + + // + // SLOW ... + double scSlow; + + // + bool isSCTrendUp; + + // + // Medium Cycle ... + // + // FAST ... + double mcFast; + + // + // SLOW ... + double mcSlow; + + // + // Long Cycle ... + // + // FAST ... + double lcFast; + + // + // SLOW ... + double lcSlow; + + // + // MIDDLEAGE ... + double marketMiddleage; + + // + // PARABOLIC-SAR ... + double parabolicSAR; +}; +// +// End Models ... +// diff --git a/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..34248bb --- /dev/null +++ b/Bkp/Used/OSC EA 14020414/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,3124 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.osc.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; + +// +static bool isSharpBullishHappens; +static bool isSharpBearishHappens; + +// +static XOSCState oscStates[]; + +// +static bool isOSCFastCrossOverSlow; +static datetime oscFastCrossOverSlowTime; +static datetime lastOSCFastCrossOverSlowTime; + +// +static bool isOSCFastCrossUnderSlow; +static datetime oscFastCrossUnderSlowTime; +static datetime lastOSCFastCrossUnderSlowTime; + +// +static bool isOSCTrendUp; +static double minOSCPower; +static double maxOSCPower; +static bool isOSCTrendDown; +static bool isOSCPowerTrendUp; +static bool isOSCMarketRanging; +static bool isOSCPowerTrendDown; + +// +static XMAState xmaStates[]; + +// +static bool isSCFastCrossOverSlow; +static datetime scFastCrossOverSlowTime; +static datetime lastSCFastCrossOverSlowTime; +static bool isSCFastCrossOverSlowValid; + +// +static bool isSCFastCrossUnderSlow; +static datetime scFastCrossUnderSlowTime; +static datetime lastSCFastCrossUnderSlowTime; +static bool isSCFastCrossUnderSlowValid; + +// +static bool isSCTrendUp; +static bool isSCTrendDown; + +// +static bool isMCFastCrossOverSlow; +static datetime mcFastCrossOverSlowTime; +static datetime lastMCFastCrossOverSlowTime; +static bool isMCFastCrossOverSlowValid; + +// +static bool isMCTrendUp; +static bool isMCTrendDown; + +// +static double mcTrendPowers[]; +static double marketMiddles[]; + +// +static bool isMCFastCrossUnderSlow; +static datetime mcFastCrossUnderSlowTime; +static datetime lastMCFastCrossUnderSlowTime; +static bool isMCFastCrossUnderSlowValid; + +// +static bool isMarketMiddleCrossOverMCFast; +static datetime marketMiddleCrossOverMCFastTime; +static datetime lastMarketMiddleCrossOverMCFastTime; +static bool isMarketMiddleCrossOverMCFastValid; + +// +static bool isMarketMiddleCrossOverMCSlow; +static datetime marketMiddleCrossOverMCSlowTime; +static datetime lastMarketMiddleCrossOverMCSlowTime; +static bool isMarketMiddleCrossOverMCSlowValid; + +// +static bool isMarketMiddleCrossUnderMCFast; +static datetime marketMiddleCrossUnderMCFastTime; +static datetime lastMarketMiddleCrossUnderMCFastTime; +static bool isMarketMiddleCrossUnderMCFastValid; + +// +static bool isMarketMiddleCrossUnderMCSlow; +static datetime marketMiddleCrossUnderMCSlowTime; +static datetime lastMarketMiddleCrossUnderMCSlowTime; +static bool isMarketMiddleCrossUnderMCSlowValid; + +// +static bool isParabolicCrossOverMarketMiddle; +static datetime parabolicCrossOverMarketMiddleTime; +static datetime lastParabolicCrossOverMarketMiddleTime; +static bool isParabolicCrossOverMarketMiddleValid; + +// +static bool isParabolicCrossUnderMarketMiddle; +static datetime parabolicCrossUnderMarketMiddleTime; +static datetime lastParabolicCrossUnderMarketMiddleTime; +static bool isParabolicCrossUnderMarketMiddleValid; + +// +static bool isParabolicTrendUp; +static bool isParabolicTrendDown; + +// +static bool isLCFastCrossOverSlow; +static datetime lcFastCrossOverSlowTime; +static datetime lastLCFastCrossOverSlowTime; + +// +static bool isLCFastCrossUnderSlow; +static datetime lcFastCrossUnderSlowTime; +static datetime lastLCFastCrossUnderSlowTime; + +// +static bool isMarketMiddleageTrendUp; +static bool isMarketMiddleageTrendDown; + +// +// Retrieve State ... +XOSCState GetOSCState( + const int bar_index, + const int foLen, + const double foMul, + const int slLen, + const double slMul +) { + // + // Define Trend Direction Related Values ... + // + XOSCState result = {}; + + // + // START Extract Data from Oscillator ... + // + // + // Fast OSC ... + double fastOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + ); + result.fastOSC = fastOSC; + + // + // Slow OSC ... + double slowOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + ); + result.slowOSC = slowOSC; + + // + // Power OSC ... + double powerOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + ); + result.powerOSC = powerOSC; + + // + // Var OSC ... + double varOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + ); + result.varOSC = varOSC; + + // + // Tan FS OSC ... + double tanFSOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 4, // Tan F/S OSC Buffer Index ... + bar_index + ); + result.tanFSOSC = tanFSOSC; + // + // END Extract Data from Oscillator ... + // + + // + return result; +} + +// +// Check Market Ranging or not based on OSC ... +bool IsOSCMarketRanging( + // + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double rangingThreshold, // Detect Ranging based On Power OSC ... + // + // OSC Specifications ... + const int foLen, // Fast OSC Length ... + const double foMul, // Fast OSC Multiplier ... + const int slLen, // Slow OSC Length ... + const double slMul // Slow OSC Multiplier ... +) { + // + bool result = false; + + // + // Detect Buffer Size ... + const int bufferSize = marketLen + bar_index; + double powerOSCBuffer[]; + ArraySetAsSeries( + powerOSCBuffer, + true + ); + ArrayResize( + powerOSCBuffer, + bufferSize + ); + + // + // Loop through Market for Extract PowerOSC from OSC Indicator ... + for (int i = bufferSize - 1; i >= 0; i--) { + // + // Retrieve OSC State at Specific Bar Index ... + XOSCState state = GetOSCState( + i, + foLen, + foMul, + slLen, + slMul + ); + + // + powerOSCBuffer[i] = state.powerOSC; + } + + // + // now we have to extract min and max value of Splitted Buffer ... + XMinMax minMax = GetBufferMinMax(powerOSCBuffer); + + // + // now Check Min and Max Direction and Compare them with Ranging Value ... + result = MathAbs(minMax.min) > rangingThreshold + || MathAbs(minMax.max) > rangingThreshold; + + // + return result; +} + +// +// Retrieve and Calculate XMA State ... +XMAState GetXMAState( + // + // Market Specification Inpouts ... + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + const double stp, // SAR Step ... + const double maxm, // SAR Maximum ... + // + // XMA Inputs ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showPSr, // Show Parabolic Sar + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color pSrColor, // Parabolic Sar Color + const color scFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // Temp Result ... + XMAState result = {}; + + // + // START Reading Buffers ... + // + // + // Define BufferIndexes ... + int scFastBufIndex = 0; + int scSlowBufIndex = 1; + int mcFastBufIndex = 2; + int mcSlowBufIndex = 3; + int lcFastBufIndex = 4; + int lcSlowBufIndex = 5; + int midBufIndex = 6; + int pSarBufIndex = 7; + + // + // START Short Cycle ... + // + // + // Short Cycle Fast ... + double scFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + ); + result.scFast = scFast; + + // + // Short Cycle Slow ... + double scSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + ); + result.scSlow = scSlow; + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + // Medium Cycle Fast ... + double mcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + ); + result.mcFast = mcFast; + + // + // Medium Cycle Slow ... + double mcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.mcSlow = mcSlow; + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + // Long Cycle Fast ... + double lcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + ); + result.lcFast = lcFast; + + // + // Long Cycle Slow ... + double lcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.lcSlow = lcSlow; + // + // END Long Cycle ... + // + + // + // START Makret Middleage ... + // + // + // Market Middleage ... + double marketMiddleage = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + ); + result.marketMiddleage = marketMiddleage; + // + // END Makret Middleage ... + // + + // + // START Parabolic SAR ... + // + // + // Parabolic ... + double parabolicSAR = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + stp, // PSAR Step ... + maxm, // PSAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showPSr, // Show Parabolic SAR ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + pSrColor, // Parabolic Sar Color ... + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + pSarBufIndex, // Buffer Index ... + bar_index + ); + result.parabolicSAR = parabolicSAR; + // + // END Makret Middleage ... + // + // + // END Reading Buffers ... + // + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + X_DIRECTION direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction == X_UP ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest CalculateSignal( + // + const int bar_index, // Bar Index ... + // + // MARKET Specifications ... + const int marketLen, // Market Length ... + const int reverseLookupInMarket,//Revrse Lookup In Marketfor TP, SL, ... + const double r2r, // Risk To Reward Ratio ... + // + // TODO: here we can add different Signalling Strategies + // usages variables to handle On/Off them in where we want ... + // + // XMA Inputs ... + // + const double stp, // SAR Step ... + const double maxm, // SAR Maximum ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showPSr, // Show Parabolic Sar + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color pSrColor, // Parabolic Sar Color ... + const color scFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor, // Medium Cycle Slow Color ... + // + // OSC Inputs ... + const int fastOSCLen, // FastOSC Length ... + const double fastOSCMul, // FastOSC Multiplier ... + const int slowOSCLen, // SlowOSC Length ... + const double slowOSCMul, // SlowOSC Multiplier ... + const double minPowOSC, // Minimum Signal Power ... + const double minVarOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + const int zDev, // ZigZag Deviation ... + const int zBkStep // ZigZag Back Step ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + XOSCState emptyOscState = {}; + ArrayFree(oscStates); + ArrayResize( + oscStates, + marketLen + ); + for (int i = 0; i < marketLen; i++) { + oscStates[i] = emptyOscState; + } + + // + XMAState emptyXmaState = {}; + ArrayFree(xmaStates); + ArrayResize( + xmaStates, + marketLen + ); + for (int i = 0; i < marketLen; i++) { + xmaStates[i] = emptyXmaState; + } + + // + // Retrieve Bar Index Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + minOSCPower = 0; + maxOSCPower = 0; + + // + // START Retrieve Statets ... + // + // + // Loop through Market Length ... + int index = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + // Retrieve Index OSC State ... + XOSCState oscState = GetOSCState( + index, // Bar Index ... + fastOSCLen, + fastOSCMul, + slowOSCLen, + slowOSCMul + ); + + // + // Retrieve XMA State ... + XMAState xmaState = GetXMAState( + index, // Bar Index ... + marketLen, // Market Length ... + stp, // SAR Step ... + maxm, // SAR Maximum ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + showPSr, // Show Parabolic Sar + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + pSrColor, // Parabolic Sar Color + scFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + // Set Retrieved Index States ... + oscStates[index] = oscState; + xmaStates[index] = xmaState; + + // + index++; + } + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + + // + // START OSC Calculations ... + // + // + // Check OSC Fast Cross Over Slow ... + isOSCFastCrossOverSlow = + oscStates[1].fastOSC > oscStates[1].fastOSC + && !(oscStates[2].fastOSC >= oscStates[2].fastOSC) + && !(oscStates[3].fastOSC >= oscStates[3].fastOSC) + ; + + // + // Setting Date Time ... + if (isOSCFastCrossOverSlow) { + // + lastOSCFastCrossOverSlowTime = oscFastCrossOverSlowTime; + oscFastCrossOverSlowTime = barTime; + } + + // + // Check OSC Fast Cross Under Slow ... + isOSCFastCrossUnderSlow = + oscStates[1].fastOSC < oscStates[1].fastOSC + && !(oscStates[2].fastOSC <= oscStates[2].fastOSC) + && !(oscStates[3].fastOSC <= oscStates[3].fastOSC) + ; + + // + // Setting Date Time ... + if (isOSCFastCrossUnderSlow) { + // + lastOSCFastCrossUnderSlowTime = oscFastCrossUnderSlowTime; + oscFastCrossUnderSlowTime = barTime; + } + + // + // Check OSC Trending Up ... + isOSCTrendUp = + oscStates[1].fastOSC > oscStates[2].fastOSC + && oscStates[1].fastOSC > oscStates[3].fastOSC + && ( + oscStates[1].fastOSC > oscStates[3].fastOSC + || oscStates[1].fastOSC > oscStates[4].fastOSC + ); + + // + // Check OSC Trending Down ... + isOSCTrendDown = + oscStates[1].fastOSC < oscStates[2].fastOSC + && oscStates[1].fastOSC < oscStates[3].fastOSC + && ( + oscStates[1].fastOSC < oscStates[3].fastOSC + || oscStates[1].fastOSC < oscStates[4].fastOSC + ); + + // + isOSCPowerTrendUp = + oscStates[1].powerOSC > oscStates[2].powerOSC + && oscStates[1].powerOSC > oscStates[3].powerOSC; + + // + isOSCPowerTrendDown = + oscStates[1].powerOSC < oscStates[2].powerOSC + && oscStates[1].powerOSC < oscStates[3].powerOSC; + + // + for (int i = 0; i < marketLen; i++) { + // + minOSCPower = + minOSCPower == 0 + || oscStates[i].powerOSC < minOSCPower + ? + oscStates[i].powerOSC + : + minOSCPower + ; + + // + maxOSCPower = + maxOSCPower == 0 + || oscStates[i].powerOSC > maxOSCPower + ? + oscStates[i].powerOSC + : + maxOSCPower + ; + } + + // + // now Check Min and Max Direction and Compare them with Ranging Value ... + isOSCMarketRanging = + MathAbs(minOSCPower) <= minPowOSC + || MathAbs(maxOSCPower) <= minOSCPower; + // + // END OSC Calculations ... + // + + // + // START XMA Calculations ... + // + // + // Check SC Fast Cross Over Slow ... + isSCFastCrossOverSlow = + xmaStates[1].scFast > xmaStates[1].scSlow + && !(xmaStates[2].scFast >= xmaStates[2].scSlow); + + // + // Setting Date Time ... + if (isSCFastCrossOverSlow) { + // + lastSCFastCrossOverSlowTime = scFastCrossOverSlowTime; + scFastCrossOverSlowTime = barTime; + } + int scFastCrossOverSlowBarIndex = iBarShift( + _Symbol, + _Period, + scFastCrossOverSlowTime, + false + ); + int lastSCFastCrossOverSlowTimeBarIndex = iBarShift( + _Symbol, + _Period, + lastSCFastCrossOverSlowTime, + false + ); + isSCFastCrossOverSlowValid = + lastSCFastCrossOverSlowTimeBarIndex - scFastCrossOverSlowBarIndex > (scFastMul * marketLen); + + // + // Check SC Fast Cross Under Slow ... + isSCFastCrossUnderSlow = + xmaStates[1].scFast < xmaStates[1].scSlow + && !(xmaStates[2].scFast <= xmaStates[2].scSlow); + + // + // Setting Date Time ... + if (isSCFastCrossUnderSlow) { + // + lastSCFastCrossUnderSlowTime = scFastCrossUnderSlowTime; + scFastCrossUnderSlowTime = barTime; + } + int scFastCrossUnderSlowBarIndex = iBarShift( + _Symbol, + _Period, + scFastCrossUnderSlowTime, + false + ); + int lastSCFastCrossUnderSlowBarIndex = iBarShift( + _Symbol, + _Period, + lastSCFastCrossUnderSlowTime, + false + ); + isSCFastCrossUnderSlowValid = + lastSCFastCrossUnderSlowBarIndex - scFastCrossUnderSlowBarIndex > (scFastMul * marketLen); + + // + isSCTrendUp = + xmaStates[1].scFast > xmaStates[1].scSlow + && xmaStates[2].scFast > xmaStates[2].scSlow + && xmaStates[3].scFast > xmaStates[3].scSlow; + + // + isSCTrendDown = + xmaStates[1].scFast < xmaStates[1].scSlow + && xmaStates[2].scFast < xmaStates[2].scSlow + && xmaStates[3].scFast < xmaStates[3].scSlow; + + // + // Check MC Fast Cross Over Slow ... + isMCFastCrossOverSlow = + xmaStates[1].mcFast > xmaStates[1].mcSlow + && !(xmaStates[2].mcFast >= xmaStates[2].mcSlow); + + // + // Setting Date Time ... + if (isMCFastCrossOverSlow) { + // + lastMCFastCrossOverSlowTime = mcFastCrossOverSlowTime; + mcFastCrossOverSlowTime = barTime; + } + int mcFastCrossOverSlowBarIndex = iBarShift( + _Symbol, + _Period, + mcFastCrossOverSlowTime, + false + ); + int lastMCFastCrossOverSlowBarIndex = iBarShift( + _Symbol, + _Period, + lastMCFastCrossOverSlowTime, + false + ); + isMCFastCrossOverSlowValid = + lastMCFastCrossOverSlowBarIndex - mcFastCrossOverSlowBarIndex > (mcFastMul * marketLen); + + // + // Check MC Fast Cross Under Slow ... + isMCFastCrossUnderSlow = + xmaStates[1].mcFast < xmaStates[1].mcSlow + && !(xmaStates[2].mcFast <= xmaStates[2].mcSlow); + + // + // Setting Date Time ... + if (isMCFastCrossUnderSlow) { + // + lastMCFastCrossUnderSlowTime = mcFastCrossUnderSlowTime; + mcFastCrossUnderSlowTime = barTime; + } + int mcFastCrossUnderSlowBarIndex = iBarShift( + _Symbol, + _Period, + mcFastCrossUnderSlowTime, + false + ); + int lastMCFastCrossUnderSlowBarIndex = iBarShift( + _Symbol, + _Period, + lastMCFastCrossUnderSlowTime, + false + ); + isMCFastCrossUnderSlowValid = + lastMCFastCrossUnderSlowBarIndex - mcFastCrossUnderSlowBarIndex > (mcFastMul * marketLen); + + // + // Reset Arrays if Cross Over Happens ... + if ( + isMCFastCrossOverSlow + // || isMCFastCrossUnderSlow + ) { + // + ArrayFree(mcTrendPowers); + ArrayFree(marketMiddles); + } + + // + double tempMCTrendPowers[]; + if ( + isNewBar + || ArraySize(mcTrendPowers) == 0 + ) { + // + ArrayResize( + tempMCTrendPowers, + ArraySize(mcTrendPowers) + ); + ArrayCopy( + tempMCTrendPowers, + mcTrendPowers, + 0, + 0 + ); + + // + ArrayResize( + mcTrendPowers, + ArraySize(mcTrendPowers) + 1 + ); + } + + // + double tempMarketMiddles[]; + if ( + isNewBar + || ArraySize(marketMiddles) == 0 + ) { + // + ArrayResize( + tempMarketMiddles, + ArraySize(marketMiddles) + ); + ArrayCopy( + tempMarketMiddles, + marketMiddles, + 0, + 0 + ); + + // + ArrayResize( + marketMiddles, + ArraySize(marketMiddles) + 1 + ); + } + + // + double mcPow = MathAbs( + xmaStates[1].mcFast - xmaStates[1].mcSlow + ); + mcTrendPowers[bar_index] = mcPow; + ArrayCopy( + mcTrendPowers, + tempMCTrendPowers, + bar_index + 1, + bar_index + ); + ArrayFree(tempMCTrendPowers); + + // + double marketMiddleage = xmaStates[0].marketMiddleage; + marketMiddles[bar_index] = marketMiddleage; + ArrayCopy( + marketMiddles, + tempMarketMiddles, + bar_index + 1, + bar_index + ); + ArrayFree(tempMCTrendPowers); + + // + XMinMax mcTrendMinMax = GetBufferMinMax(mcTrendPowers); + XMinMax marketMiddlesMinMax = GetBufferMinMax(marketMiddles); + + // + isMCTrendUp = + xmaStates[1].mcFast > xmaStates[1].mcSlow + && xmaStates[2].mcFast > xmaStates[2].mcSlow + && xmaStates[3].mcFast > xmaStates[3].mcSlow; + + // + isMCTrendDown = + xmaStates[1].mcFast < xmaStates[1].mcSlow + && xmaStates[2].mcFast < xmaStates[2].mcSlow + && xmaStates[3].mcFast < xmaStates[3].mcSlow; + + // + // Market Middleage Length ... + int marketMiddleageLength = (int)(marketLen * 1.5); + + // + // Check Market Middleage Cross Over MC Fast ... + isMarketMiddleCrossOverMCFast = + xmaStates[1].marketMiddleage > xmaStates[1].mcFast + && !(xmaStates[2].marketMiddleage >= xmaStates[2].mcFast) + && !(xmaStates[3].marketMiddleage >= xmaStates[3].mcFast) + ; + + // + // Setting Date Time ... + if (isMarketMiddleCrossOverMCFast) { + // + lastMarketMiddleCrossOverMCFastTime = marketMiddleCrossOverMCFastTime; + marketMiddleCrossOverMCFastTime = barTime; + } + int marketMiddleCrossOverMCFastBarIndex = iBarShift( + _Symbol, + _Period, + marketMiddleCrossOverMCFastTime, + false + ); + int lastMarketMiddleCrossOverMCFastBarIndex = iBarShift( + _Symbol, + _Period, + lastMarketMiddleCrossOverMCFastTime, + false + ); + isMarketMiddleCrossOverMCFastValid = + lastMarketMiddleCrossOverMCFastBarIndex - marketMiddleCrossOverMCFastBarIndex > (marketMiddleageLength); + + // + // Check Market Middleage Cross Over MC Slow ... + isMarketMiddleCrossOverMCSlow = + xmaStates[1].marketMiddleage > xmaStates[1].mcSlow + && !(xmaStates[2].marketMiddleage >= xmaStates[2].mcSlow) + && !(xmaStates[3].marketMiddleage >= xmaStates[3].mcSlow) + ; + + // + // Setting Date Time ... + if (isMarketMiddleCrossOverMCSlow) { + // + lastMarketMiddleCrossOverMCSlowTime = marketMiddleCrossOverMCSlowTime; + marketMiddleCrossOverMCSlowTime = barTime; + } + int marketMiddleCrossOverMCSlowBarIndex = iBarShift( + _Symbol, + _Period, + marketMiddleCrossOverMCSlowTime, + false + ); + int lastMarketMiddleCrossOverMCSlowBarIndex = iBarShift( + _Symbol, + _Period, + lastMarketMiddleCrossOverMCSlowTime, + false + ); + isMarketMiddleCrossOverMCSlowValid = + lastMarketMiddleCrossOverMCSlowBarIndex - marketMiddleCrossOverMCSlowBarIndex > (marketMiddleageLength); + + // + // Check Market Middleage Cross Under MC Fast ... + isMarketMiddleCrossUnderMCFast = + xmaStates[1].marketMiddleage < xmaStates[1].mcFast + && !(xmaStates[2].marketMiddleage <= xmaStates[2].mcFast) + && !(xmaStates[3].marketMiddleage <= xmaStates[3].mcFast) + ; + + // + // Setting Date Time ... + if (isMarketMiddleCrossUnderMCFast) { + // + lastMarketMiddleCrossUnderMCFastTime = marketMiddleCrossUnderMCFastTime; + marketMiddleCrossUnderMCFastTime = barTime; + } + int marketMiddleCrossUnderMCFastBarIndex = iBarShift( + _Symbol, + _Period, + marketMiddleCrossUnderMCFastTime, + false + ); + int lastMarketMiddleCrossUnderMCFastBarIndex = iBarShift( + _Symbol, + _Period, + lastMarketMiddleCrossUnderMCFastTime, + false + ); + isMarketMiddleCrossUnderMCFastValid = + lastMarketMiddleCrossUnderMCFastBarIndex - marketMiddleCrossUnderMCFastBarIndex > (marketMiddleageLength); + + // + // Check Market Middleage Cross Under MC Slow ... + isMarketMiddleCrossUnderMCSlow = + xmaStates[1].marketMiddleage < xmaStates[1].mcSlow + && !(xmaStates[2].marketMiddleage <= xmaStates[2].mcSlow) + && !(xmaStates[3].marketMiddleage <= xmaStates[3].mcSlow) + ; + + // + // Setting Date Time ... + if (isMarketMiddleCrossUnderMCSlow) { + // + lastMarketMiddleCrossUnderMCSlowTime = marketMiddleCrossUnderMCSlowTime; + marketMiddleCrossUnderMCSlowTime = barTime; + } + int marketMiddleCrossUnderMCSlowBarIndex = iBarShift( + _Symbol, + _Period, + marketMiddleCrossUnderMCSlowTime, + false + ); + int lastMarketMiddleCrossUnderMCSlowBarIndex = iBarShift( + _Symbol, + _Period, + lastMarketMiddleCrossUnderMCSlowTime, + false + ); + isMarketMiddleCrossUnderMCSlowValid = + lastMarketMiddleCrossUnderMCSlowBarIndex - marketMiddleCrossUnderMCSlowBarIndex > (marketMiddleageLength); + + // + isParabolicCrossOverMarketMiddle = + xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage + && !(xmaStates[2].parabolicSAR >= xmaStates[2].marketMiddleage); + + // + if (isParabolicCrossOverMarketMiddle) { + // + lastParabolicCrossOverMarketMiddleTime = parabolicCrossOverMarketMiddleTime; + parabolicCrossOverMarketMiddleTime = barTime; + } + + // + // Find Distance between two Parabolic Cross ... + int parabolicCrossOverMarketMiddleBarIndex = iBarShift( + _Symbol, + _Period, + parabolicCrossOverMarketMiddleTime, + false + ); + int lastParabolicCrossOverMarketMiddleBarIndex = iBarShift( + _Symbol, + _Period, + lastParabolicCrossOverMarketMiddleTime, + false + ); + isParabolicCrossOverMarketMiddleValid = + lastParabolicCrossOverMarketMiddleBarIndex - parabolicCrossOverMarketMiddleBarIndex > marketLen; + + // + isParabolicCrossUnderMarketMiddle = + xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + && !(xmaStates[2].parabolicSAR <= xmaStates[2].marketMiddleage); + + // + if (isParabolicCrossUnderMarketMiddle) { + // + lastParabolicCrossUnderMarketMiddleTime = parabolicCrossUnderMarketMiddleTime; + parabolicCrossUnderMarketMiddleTime = barTime; + } + + // + // Find Distance between two Parabolic Cross ... + int parabolicCrossUnderMarketMiddleBarIndex = iBarShift( + _Symbol, + _Period, + parabolicCrossUnderMarketMiddleTime, + false + ); + int lastParabolicCrossUnderMarketMiddleBarIndex = iBarShift( + _Symbol, + _Period, + lastParabolicCrossUnderMarketMiddleTime, + false + ); + isParabolicCrossUnderMarketMiddleValid = + lastParabolicCrossUnderMarketMiddleTime - parabolicCrossUnderMarketMiddleTime > marketLen; + + // + isParabolicTrendUp = + xmaStates[1].parabolicSAR > xmaStates[1].marketMiddleage + && xmaStates[2].parabolicSAR > xmaStates[2].marketMiddleage; + + // + isParabolicTrendDown = + xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + && xmaStates[2].parabolicSAR < xmaStates[2].marketMiddleage; + + // + // Check LC Fast Cross Over Slow ... + isLCFastCrossOverSlow = + xmaStates[1].lcFast > xmaStates[1].lcSlow + && !(xmaStates[2].lcFast >= xmaStates[2].lcSlow); + + // + // Setting Date Time ... + if (isLCFastCrossOverSlow) { + // + lastLCFastCrossOverSlowTime = lcFastCrossOverSlowTime; + lcFastCrossOverSlowTime = barTime; + } + + // + // Check LC Fast Cross Under Slow ... + isLCFastCrossUnderSlow = + xmaStates[1].lcFast < xmaStates[1].lcSlow + && !(xmaStates[2].lcFast <= xmaStates[2].lcSlow); + + // + // Setting Date Time ... + if (isLCFastCrossUnderSlow) { + // + lastLCFastCrossUnderSlowTime = lcFastCrossUnderSlowTime; + lcFastCrossUnderSlowTime = barTime; + } + + // + // Check Market Middleage Trends Up ... + isMarketMiddleageTrendUp = + xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage + && xmaStates[0].marketMiddleage > xmaStates[2].marketMiddleage + && xmaStates[0].marketMiddleage > xmaStates[3].marketMiddleage + && xmaStates[1].marketMiddleage > xmaStates[2].marketMiddleage + && xmaStates[1].marketMiddleage > xmaStates[3].marketMiddleage + && xmaStates[2].marketMiddleage > xmaStates[3].marketMiddleage; + + // + // Check Market Middleage Trends Down ... + isMarketMiddleageTrendDown = + xmaStates[0].marketMiddleage < xmaStates[1].marketMiddleage + && xmaStates[0].marketMiddleage < xmaStates[2].marketMiddleage + && xmaStates[0].marketMiddleage < xmaStates[3].marketMiddleage + && xmaStates[1].marketMiddleage < xmaStates[2].marketMiddleage + && xmaStates[1].marketMiddleage < xmaStates[3].marketMiddleage + && xmaStates[2].marketMiddleage < xmaStates[3].marketMiddleage; + // + // END XMA Calculations ... + // + + // + // START PRICE Calculations ... + // + RefreshRates(); + + // + // double candleOpen = iOpen( + // _Symbol, + // _Period, + // bar_index + // ); + + // + double marketLow[]; + double marketOpen[]; + double marketHigh[]; + double marketClose[]; + ArrayResize( + marketLow, + marketLen + ); + ArrayResize( + marketOpen, + marketLen + ); + ArrayResize( + marketHigh, + marketLen + ); + ArrayResize( + marketClose, + marketLen + ); + for (int i = bar_index; i < marketLen + bar_index - 1; i++) { + // + marketLow[i] = iLow( + _Symbol, + _Period, + i + ); + + // + marketOpen[i] = iOpen( + _Symbol, + _Period, + i + ); + + // + marketHigh[i] = iHigh( + _Symbol, + _Period, + i + ); + + // + marketClose[i] = iClose( + _Symbol, + _Period, + i + ); + } + + // + // Retrieve Market Price Actions Min/Max ... + XMinMax marketLowMinMax = GetBufferMinMax(marketLow); + XMinMax marketHighMinMax = GetBufferMinMax(marketHigh); + XMinMax marketOpenMinMax = GetBufferMinMax(marketOpen); + XMinMax marketCloseMinMax = GetBufferMinMax(marketClose); + + // + isSharpBullishHappens = IsSharpBullishHappens( + bar_index, + marketLen + ); + + // + isSharpBearishHappens = IsSharpBearishHappens( + bar_index, + marketLen + ); + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + // + // END PRICE Calculations ... + // + + // + // START Capturing Signal ... + // + + // + // START LONG Signals ... + // + // + // OSC ... + bool oscHasLongSignal = + // + // Check Power OSC Cross Over 0 ... + oscStates[1].powerOSC > 0 + && oscStates[2].powerOSC < 0 + && MathAbs(oscStates[1].powerOSC) > minPowOSC + && MathAbs(oscStates[2].powerOSC) > minPowOSC + // + // Check MC Market Trending Up ... + && xmaStates[1].mcFast > xmaStates[1].mcSlow + // + // Check Parabolic below market miidleage ... + && xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + && xmaStates[2].parabolicSAR < xmaStates[2].marketMiddleage + // + // Check Parabolic Value bigger than MC Slow ... + && xmaStates[1].parabolicSAR > xmaStates[1].mcSlow + // + // Check Distance between two Parabolic Cross Under + // Market Middleage or current barIndex and current Cross is Valid or not ... + && ( + isParabolicCrossUnderMarketMiddleValid + || parabolicCrossUnderMarketMiddleBarIndex - bar_index > marketLen + ) + // + // Check Market Middleage not Max ... + && xmaStates[1].marketMiddleage < marketMiddlesMinMax.max + // + // Check Entry Price Lower than Market Highest High ... + && longEntryPrice < marketHighMinMax.max + && MathAbs(longEntryPrice - marketHighMinMax.max) > (5 * _Point) + // + // We Have to prevent signaling when a Bullish Sharp occured ... + && !isSharpBullishHappens; + + // + bool hasLongSignal = + // + // OSC Signals ... + oscHasLongSignal + ; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = false; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap; + double sl = 0; + double risk; + double reward; + double tp = 0; + double r2rRatio = r2r; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Fill Signal Related Variables ... + if (hasLongSignal) { + // + totalLongSignals++; + + // + price = longEntryPrice; + priceGap = longPriceGap; + + // // + // // Setting Up SL Based on Prev Candle ... + // sl = prevCandleLow; + + // + // Setting Up SL Based on Last Market Lowest ... + sl = GetMarketLowestLow( + bar_index, + marketLen + ); + + // // + // // Setting Up SL Based on Prev Candle Less Low Price ... + // sl = GetLowLessCandlePrice( + // bar_index, + // price + // ); + + // + // if (isSharpBearishHappens) { + // sl = marketLow[1]; + // } + + // + risk = price - sl; + + // // + // // here we calculate risk based on candle open ... + risk = marketOpen[0] - sl; + + // + reward = risk * r2rRatio; + tp = price + reward; + + // + // Check TP Touches before add in Market length + // based on Passed Candles ... + double passCandleReverseHighestHigh = GetMarketHighestHigh(0, reverseLookupInMarket); + if (tp > passCandleReverseHighestHigh) { + tp = passCandleReverseHighestHigh + (5 * _Point); + } + + // + // if (oscHasLongSignal) { + // tp = price + PipsToPrice(1); + // } + + // + // Check TP based on Spread ... + if (tp < price + priceGap) { + tp = tp + priceGap; + } + } else if (hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // // + // // Setting Up SL Based On Prev Candle ... + // sl = prevCandleHigh; + + // // + // // Setting Up SL Based on Last Market Highest ... + // sl = GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + // Setting Up SL Based on Prev Candle Great High Price ... + // sl = GetHighGreatCandlePrice( + // bar_index, + // price + // ); + + // + // Settup SL based On Parabolic SAR ... + //sl = xmaStates[0].parabolicSAR; + + // + risk = sl - price; + reward = risk * r2r; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = 0; // sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + // + // END Capturing Signal ... + // + + // + // Fill Result ... + result.hasSignal = hasSignal; + result.signal = signal; + result.type = signal.type; + + // + // Return Result ... + return result; +} + +// +// START Signal Verification Functions ... +// +// +// END Signal Verification Functions ... +// + +// +// START Market State Functions ... +// +// +// END Market State Functions ... +// + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entryPrice, + signal.time, + signal.entryPrice, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entryPrice > signal.tp + ) || + ( + !hasLongSignal + && signal.entryPrice < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, "_", + label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // + if (CountOpenTrades() > 0) { + // + // Here we have to + // ModifyOpenTradesBasedOnCurrentTrade(signal); + } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit > 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if ( + openBarIndex - currentBarIndex >= passedCandles + || ( + profit > 0.5 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if ( + openTrades > 0 + && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + ) { + result = CloseAllInProfitTrades() + && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + result = CloseAllInProfitTrades() + && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + openPrice < signal.entryPrice + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// diff --git a/Bkp/Used/OSC EA/Experts/x-saherelm.osc.ea.mq4 b/Bkp/Used/OSC EA/Experts/x-saherelm.osc.ea.mq4 new file mode 100644 index 0000000..5e1f2ed --- /dev/null +++ b/Bkp/Used/OSC EA/Experts/x-saherelm.osc.ea.mq4 @@ -0,0 +1,784 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST_OSC Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// +// ShortName: XST_OSC +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST_OSC Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_OSC"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = false; // Allow Short Trades + +// +// Market Specification Inpouts ... +input int marketLength = 7; // Market Length +input double riskToRewardRatio = 2; // Risk to Reward Ratio + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity +input int closeAllOpenTradesAfterCandle = 864; // Close All Open Trades After Passed Candles + +// +// OSC Inputs ... +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 7; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 14; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier + +// +// Power OSC ... +input double minPowerOSC = 0.055; // Minimum Signal Power + +// +// Variance OSC ... +input double minVarianceOSC = 0; // Minimum Var Power + +// +// ZIGZAG Inputs ... +input int zDeviation = 5; // ZigZag Deviation +input int zBackStep = 3; // ZigZag Back Step + +// +// XMA Inputs ... +// +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show/Hide Inputs ... +input bool showShortCycle = false; // Show Short Cycle +input bool showShortCycleCrossLines = false; // Show Short Cycle Vertical Lines +input bool showMediumCycle = false; // Show Medium Cycle +input bool showMediumCycleCrossLines = false; // Show Medium Cycle Vertical Lines +input bool showLongCycle = false; // Show Long Cycle +input bool showLongCycleCrossLines = false; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +bool waitForLongSignals = true; +bool closeLongTrades = false; + +// +bool waitForShortSignals = true; +bool closeShortTrades = false; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.osc.signal.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // MARKET ... + marketLength < 0 + || riskToRewardRatio < 0 + // + // EA ... + || lotsPerTradePercent < 0 + || maxOpenTrades <= 0 + || maxDrawdownPercentPerPTrade < 0 + || minBalancePercent < 0 + || maxEquityPercent < 0 + || marketLength < 0 + // + // OSC ... + || fastOSCLength < 0 + || fastOSCMultiplier < 0 + || slowOSCLength < 0 + || slowOSCMultiplier < 0 + || minPowerOSC < 0 + || minVarianceOSC < 0 + || slowOSCLength <= fastOSCLength + // + // ZIGZAG ... + || zDeviation < 0 + || zBackStep < 0 + || zBackStep >= marketLength + // + // XMA ... + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ; + + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_OSC"; + + // // + // // Set Event Timer on One Seccond ... + // bool isEventSet = EventSetTimer(1); + // if (!isEventSet) { + // LogMessage("Error: " + GetLastError()); + // return INIT_FAILED; + // } + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // Killing Event Timer ... + EventKillTimer(); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} + +// +// Timer Event Handler ... +void OnTimer() { + // + CheckState(); + + // + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State in Big Picture ... + + // + bool isSCFastCrossUnderSlow = xmaState.scFast < xmaState.scSlow + && !(xmaState.scFastPrev < xmaState.scSlowPrev); + + // + bool isMCFastCrossUnderSlow = xmaState.mcFast < xmaState.mcSlow + && !(xmaState.mcFastPrev < xmaState.mcSlowPrev); + + // + bool isLCFastCrossUnderSlow = xmaState.lcFast < xmaState.lcSlow + && !(xmaState.lcFastPrev < xmaState.lcSlowPrev); + + // + closeLongTrades = + ( + isSCFastCrossUnderSlow + && isMCFastCrossUnderSlow + ) + || + ( + isSCFastCrossUnderSlow + && isLCFastCrossUnderSlow + ) + || + ( + isMCFastCrossUnderSlow + && isLCFastCrossUnderSlow + ) + ; + + // + waitForLongSignals = + waitForLongSignals + ? + true + : + ( + ( + xmaState.lcFast > xmaState.lcSlow + && !(xmaState.lcFastPrev > xmaState.lcSlowPrev) + ) + || + ( + xmaState.mcFast > xmaState.mcSlow + && !(xmaState.mcFastPrev > xmaState.mcSlowPrev) + ) + ) + ; +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + // + countedBars++; + + // // + // LogMessage( + // StringConcatenate( + // "Check Signals, Bars: ", + // countedBars + // ) + // ); + + // + // Retrieve Signal Exists ... + // request = CalculateSignal( + // // + // // Bar Index ... + // 0, + // // + // // Market Specification Inpouts ... + // marketLength, // Market Length ... + // // + // // Risk To Reward Ratio ... + // riskToRewardRatio, + // // + // // XMA Inputs ... + // shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + // shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + // mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + // mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + // longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + // longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // // + // // Show/Hide Inputs ... + // showShortCycle, + // showShortCycleCrossLines, + // showMediumCycle, + // showMediumCycleCrossLines, + // showLongCycle, + // showLongCycleCrossLines, + // // + // // Color Inputs ... + // shortCycleFastColor, + // shortCycleSlowColor, + // mediumCycleFastColor, + // mediumCycleSlowColor, + // longCycleFastColor, + // longCycleSlowColor, + // // + // // OSC ... + // fastOSCLength, // FastOSC Length ... + // fastOSCMultiplier, // FastOSC Multiplier ... + // slowOSCLength, // SlowOSC Length ... + // slowOSCMultiplier, // SlowOSC Multiplier ... + // minPowerOSC, // Minimum Signal Power ... + // minVarianceOSC, // Minimum Var Power ... + // // + // // ZIGZAG Inputs ... + // zDeviation, // ZigZag Deviation ... + // zBackStep // ZigZag Back Step ... + // ); + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + allowDoTrade = false; + + // // + // string message = StringConcatenate( + // "Trading Pause => ", + // "Balance: ", balance, + // ", Equity: ", equity, + // ", FreeMargin: ", freeMargin + // ); + + // // + // LogMessage(message); + // SendAlert(message); + + // + // Close In Profit Trades ... + // then Recheck Signal ... + // bool hasInProfitTradeClosed = CloseAllInProfitTrades(); + // if (hasInProfitTradeClosed) { + // ProcessSignals(); + // } + } + } + + // + // Retrieve Signal Exists ... + request = CalculateSignal( + // + // Bar Index ... + 0, + // + // Market Specification Inpouts ... + marketLength, // Market Length ... + // + // Risk To Reward Ratio ... + riskToRewardRatio, + // + // XMA Inputs ... + shortCycleFastMultiplier, // Short Cycle Fast Multiplier ... + shortCycleSlowMultiplier, // Short Cycle Slow Multiplier ... + mediumCycleFastMultiplier, // Medium Cycle Fast Multiplier ... + mediumCycleSlowMultiplier, // Medium Cycle Slow Multiplier ... + longCycleFastMultiplier, // Long Cycle Fast Multiplier ... + longCycleSlowMultiplier, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showShortCycle, + showShortCycleCrossLines, + showMediumCycle, + showMediumCycleCrossLines, + showLongCycle, + showLongCycleCrossLines, + // + // Color Inputs ... + shortCycleFastColor, + shortCycleSlowColor, + mediumCycleFastColor, + mediumCycleSlowColor, + longCycleFastColor, + longCycleSlowColor, + // + // OSC ... + fastOSCLength, // FastOSC Length ... + fastOSCMultiplier, // FastOSC Multiplier ... + slowOSCLength, // SlowOSC Length ... + slowOSCMultiplier, // SlowOSC Multiplier ... + minPowerOSC, // Minimum Signal Power ... + minVarianceOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + zDeviation, // ZigZag Deviation ... + zBackStep // ZigZag Back Step ... + ); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_LONG; + + // + // Check For Bot State ... + if ( + (hasLongSignal && !waitForLongSignals) + || (!hasLongSignal && !waitForShortSignals) + ) { + return; + } + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + if (lastSignalledBar == countedBars) { + // + totalSignals--; + if (hasLongSignal) { + totalLongSignals--; + } else { + totalShortSignals--; + } + return; + } + + // + // Prevent Signals if openTrades on last Market ... + // this means for each trades at least we have to wait market length passed from last signal ... + // if (lastSignalledBar + (marketLength) > countedBars) { + // return; + // } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // // + // string message = StringConcatenate( + // "Trading Not Allowed ..." + // ); + + // // + // LogMessage(message); + // SendAlert(message); + return; + } + + // + bool isPositionOpened = TradeSignal( + request.signal, + signalPrefix, + lotsPerTradePercent, + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", Entry: ", request.signal.entryPrice, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // TODO: + // - Order 5 Long Time; + // - Order 8 Long Time; + // - Order 13 Long Time; + // - lcTrendDown; + // - mcTrendUp; + // - scTrendDown; + // - marketMiddleage < mcSlow; + // - longEntryPrice > lcSlow; + // - scTrendPowerUp; + // - Order 14 All Long Trades; + // - lcMarket TrendUp; + // - mcMarket TrendUp; + // - + // - Order 16 Long Time; + // - Ordrr 17 Long Time; + // - Ordrr 22 Long Time; + // - Ordrr 26 Long Time; + // - Ordrr 32 All Long Trades; + // - Ordrr 40 Long Time; + // - Ordrr 41 Long Time; + // - Ordrr 52 Long Time; + // - Ordrr 66 Long Time; + // - Ordrr 73 Long Time; + // - Ordrr 74 All Long Trades; + // - Ordrr 78 Long Time; + // - Ordrr 78 Long Time; + // - Ordrr 87 All Long Trades; + // - Ordrr 95 Long Time; + // - Ordrr 97 Long Time; + // - Ordrr 106 Long Time; + // - Ordrr 107 All Long Trades; + // - Ordrr 109 Long Time; + // - Ordrr 111 Long Time; + + // + if (closeLongTrades) { + // + closeLongTrades = false; + + // + bool isAllLongTradesClosed = CloseAllLongTrades(); + if (isAllLongTradesClosed) { + waitForLongSignals = false; + } + } + + // + if (closeShortTrades) { + // + closeShortTrades = false; + + // + bool isAllShortTradesClosed = CloseAllShortTrades(); + if (isAllShortTradesClosed) { + waitForShortSignals = false; + } + } + + // + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + closeAllOpenTradesAfterCandle + ); + + // + // Close Maximum DrawDown Passed Trades ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawdownPercentPerPTrade + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedInDrawDownLongTrade + ) { + // + waitForLongSignals = false; + waitForShortSignals = false; + } +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // // + // if (!alertEvents) { + // return; + // } + + // // + // // Terminal Alert ... + // if (terminalAlert) { + // Alert(message); + // } + + // // + // // Push Alert ... + // if (pushAlert) { + // SendNotification(message); + // } +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.adx.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.adx.mq4 new file mode 100644 index 0000000..3271a4e --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.adx.mq4 @@ -0,0 +1,220 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center ADX Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ADX Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Averaging Length +input ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; // Averaging Applied Price +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 3 + +// +#property indicator_level1 0.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_level4 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// ADX ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Positive Direction ... +#property indicator_width2 1 +#property indicator_color2 clrLime +#property indicator_type2 DRAW_LINE +#property indicator_style2 STYLE_DOT + +// +// Negative Direction ... +#property indicator_width3 1 +#property indicator_color3 clrRed +#property indicator_type3 DRAW_LINE +#property indicator_style3 STYLE_DOT + +// +// Declare Buffers ... +#define adxBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double adxBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexLabel(positiveBufferIndex, "DI+"); + + // + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + SetIndexLabel(negativeBufferIndex, "DI-"); + + // + SetIndexBuffer(adxBufferIndex, adxBuffer); + SetIndexLabel(adxBufferIndex, "ADX"); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index +) { + // + // Calculate Buffers ... + + // + // Retrieves the current ADX value ... + double adx = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MAIN, + bar_index + ); + adxBuffer[bar_index] = adx; + + // + // Retrieves the current DI+ value ... + double plusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_PLUSDI, + bar_index + ); + positiveBuffer[bar_index] = plusDi; + + // + // Retrieves the current DI- value ... + double minusDi = iADX( + _Symbol, + _Period, + length, + appliedPrice, + MODE_MINUSDI, + bar_index + ); + negativeBuffer[bar_index] = minusDi; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.ma.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.momentum.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.momentum.mq4 new file mode 100644 index 0000000..ea6e419 --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.momentum.mq4 @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Momentum Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Momentum Oscillator" +#property strict + +// +// START Inputs ... +// +input int length = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_buffers 1 + +// +#property indicator_level1 0.0 +#property indicator_level2 100.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// MOMENTUM ... +#property indicator_width1 1 +#property indicator_color1 clrLightBlue +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Declare Buffers ... +#define momentumBufferIndex 0 + +double momentumBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if (length < 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + IndicatorBuffers(1); + + // + SetIndexBuffer(momentumBufferIndex, momentumBuffer); + SetIndexLabel(momentumBufferIndex, "Momentum"); + SetIndexDrawBegin(momentumBufferIndex, length); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, length); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Long TP ... + CalculateBuffers( + i, + close + ); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +void CalculateBuffers( + const int bar_index, + const double &close[] +) { + // + // Calculate Buffers ... + double momentum = close[bar_index] * 100 / close[bar_index + length]; + + // + momentumBuffer[bar_index] = momentum; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.osc.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.osc.mq4 new file mode 100644 index 0000000..220bd33 --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.osc.mq4 @@ -0,0 +1,330 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center OSC Indicator +// ------------------------------------------------------------- +// this indicator provides OSC ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm OSC Indicator" +#property strict + +// +// START Inputs ... +// +// +// FastOSC ... +// Short Cycle (Fast OSC) ... +input int fastOSCLength = 10; // FastOSC Length +input double fastOSCMultiplier = 1.0; // FastOSC Multiplier + +// +// SlowOSC ... +// Medium Cycle (Slow OSC) ... +input int slowOSCLength = 30; // SlowOSC Length +input double slowOSCMultiplier = 3.0; // SlowOSC Multiplier +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +#property indicator_separate_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 5 + +// +// also we have 2 line for draw on this indicator ... +#property indicator_plots 5 + +// +// Fast OSC ... +#property indicator_width1 1 +#property indicator_color1 clrAqua +#property indicator_type1 DRAW_LINE +#property indicator_style1 STYLE_SOLID + +// +// Slow OSC ... +#property indicator_width2 1 +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrFuchsia +#property indicator_style2 STYLE_SOLID + +// +// Power OSC ... +#property indicator_width3 1 +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASHDOTDOT + +// +// Var OSC ... +#property indicator_width4 1 +#property indicator_type4 DRAW_HISTOGRAM +#property indicator_color4 clrBlueViolet +#property indicator_style4 STYLE_SOLID + +// +// Tan Fast/Slow OSC ... +#property indicator_width5 0 +#property indicator_type5 DRAW_NONE +#property indicator_color5 clrNONE +#property indicator_style5 STYLE_SOLID + +// +//#property indicator_minimum 0 +//#property indicator_maximum 1 + +// +// set color of horizontal levels ... +#property indicator_levelcolor clrGray + +// +// set style of horizontal levels ... +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define fastOSCBufferIndex 0 +#define slowOSCBufferIndex 1 +#define powerOSCBufferIndex 2 +#define varOSCBufferIndex 3 +#define fastSlowOSCAngleBufferIndex 4 + +// +double fastOSCBuffer[]; +double slowOSCBuffer[]; +double fastSlowOSCAngleBuffer[]; +double powerOSCBuffer[]; +double varOSCBuffer[]; + +// +// Used Indicators List ... +string rmaIndicatorName = "x-saherelm.rma"; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + fastOSCLength < 0 || + slowOSCLength < 0 || + slowOSCLength <= fastOSCLength + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XS_OSC"; + + // + // set descriptions of horizontal levels ... + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(1, 0.5); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + // set descriptions of horizontal levels ... + SetLevelValue(2, 1); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + // Fast OSC Buffer ... + SetIndexBuffer(fastOSCBufferIndex, fastOSCBuffer); + SetIndexLabel(fastOSCBufferIndex, "Fast OSC"); + SetIndexDrawBegin(fastOSCBufferIndex, fastOSCLength - 1); + + // + // Slow OSC Buffer ... + SetIndexBuffer(slowOSCBufferIndex, slowOSCBuffer); + SetIndexLabel(slowOSCBufferIndex, "Slow OSC"); + SetIndexDrawBegin(slowOSCBufferIndex, slowOSCLength - 1); + + // + // Power OSC Buffer ... + SetIndexBuffer(powerOSCBufferIndex, powerOSCBuffer); + SetIndexLabel(powerOSCBufferIndex, "Power OSC"); + + // + // Var OSC Buffer ... + SetIndexBuffer(varOSCBufferIndex, varOSCBuffer); + SetIndexLabel(varOSCBufferIndex, "Var OSC"); + + // + // Tan Fast/Slow OSC Buffer ... + SetIndexBuffer(fastSlowOSCAngleBufferIndex, fastSlowOSCAngleBuffer); + SetIndexLabel(fastSlowOSCAngleBufferIndex, "F/L OSC Angle"); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(fastOSCLength, slowOSCLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + CalculateOscillators(close, i); + } + + // + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +void CalculateOscillators( + const double &close[], + const int &bar_index +) { + // + // FastOSC ... + // Short Cycle Calculations ... + int scl = fastOSCLength / 2; + int scl2 = scl / 2; + double maScl = iCustom(_Symbol, _Period, rmaIndicatorName, scl, 0, bar_index); + double scmAtr = iATR(_Symbol, _Period, scl, bar_index); + double scmOff = fastOSCMultiplier * scmAtr; + double maScl2 = iCustom(_Symbol, _Period, rmaIndicatorName, scl2, 0, bar_index); + double sctParam = maScl2 != 0 ? maScl2 : close[bar_index + 1]; + double sct = sctParam + scmOff; + double scb = sctParam - scmOff; + + // + // SlowOSC ... + // Medium Cycle Calculations ... + int mcl = slowOSCLength / 2; + int mcl2 = mcl / 2; + double maMcl = iCustom(_Symbol, _Period, rmaIndicatorName, mcl, 0, bar_index); + double mcmAtr = iATR(_Symbol, _Period, mcl, bar_index); + double mcmOff = slowOSCMultiplier * mcmAtr; + double maMcl2 = iCustom(_Symbol, _Period, rmaIndicatorName, mcl2, 0, bar_index); + double mctParam = maMcl2 != 0 ? maMcl2 : close[bar_index + 1]; + double mct = mctParam + mcmOff; + double mcb = mctParam - mcmOff; + + // + double scMM = (sct + scb) / 2; + + // + double fastOCS = (close[bar_index] - mcb) / (mct - mcb); + fastOSCBuffer[bar_index] = fastOCS; + + // + double slowOCS = (scMM - mcb) / (mct - mcb); + slowOSCBuffer[bar_index] = slowOCS; + + // + // Signal Power ... + // Difference Variant between FastOSC and Slow OSC ... + double powerOSC = fastOCS - slowOCS; + powerOSCBuffer[bar_index] = powerOSC; + + // + // Var OSC ... + double varOSC = fastOCS - 0.5; + varOSCBuffer[bar_index] = varOSC; + + // + // Calculate Tan Fast/Slow OSC ... + double fastOSCSlope = fastOSCBuffer[bar_index] - fastOSCBuffer[bar_index + 1]; + double slowOSCSlope = slowOSCBuffer[bar_index] - slowOSCBuffer[bar_index + 1]; + double tanFastSlowOSC = MathAbs( + (fastOSCSlope - slowOSCSlope) / (1 + (fastOSCSlope * slowOSCSlope)) + ); + + // + // here we pass Tan of angle ... + // fastSlowOSCAngleBuffer[bar_index] = tanFastSlowOSC; + + // + // here we pass degree of angle ... + fastSlowOSCAngleBuffer[bar_index] = MathArctan(tanFastSlowOSC); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.rma.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.rma.mq4 new file mode 100644 index 0000000..0fc70fd --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.rma.mq4 @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RMA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Set the RMA Length ... +input int RMALength = 10; // Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// we have 2 buffer in this indicator ... +#property indicator_buffers 1 + +// +// also we have 1 line for draw on this indicator ... +#property indicator_plots 1 + +// +// here we declare plot SlowOCS to system ... +#property indicator_label1 "RMA" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrFuchsia +#property indicator_style1 STYLE_SOLID +#property indicator_width1 1 + +// +// Declare Buffers ... +#define RMABufferIndex 0 + +// +double RMABuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + SetIndexBuffer(RMABufferIndex, RMABuffer); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int maxLength = MathMax(0, RMALength); + + // + // wait to pass bars until we have rights ... + if (rates_total <= maxLength) { + // + // return not calculated ... + return 0; + } + + // + // find loop count for bars manipulation ... + int count = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // Print("Count: ", count, ", Bars: ", Bars); + + // + // this is the main loop of calculations, for each bar index ... + for (int i = count - 1; i >= 0; i--) { + // + // Start Calculation with Formula 1 ... + // + double shortSMA = iMA(_Symbol, _Period, RMALength, 0, MODE_SMA, PRICE_CLOSE, i); + double mediumSMA = iMA(_Symbol, _Period, RMALength * 2, 0, MODE_SMA, PRICE_CLOSE, i); + double longSMA = iMA(_Symbol, _Period, RMALength * 3, 0, MODE_SMA, PRICE_CLOSE, i); + + // + double rma1 = longSMA - mediumSMA + shortSMA; + rma1 = NormalizeDouble(rma1, _Digits); + // + // End Calculation with Formula 1 ... + // + + // + RMABuffer[i] = rma1; + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.rsi.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.rsi.mq4 new file mode 100644 index 0000000..448f732 --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.rsi.mq4 @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center RSI Oscillator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm RSI Oscillator" +#property strict + +// +// START Inputs ... +// +input int rsiPeriod=14; // RSI Period +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +#property indicator_separate_window + +// +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_buffers 1 +#property indicator_color1 DodgerBlue + +// +#property indicator_level1 30.0 +#property indicator_level2 50.0 +#property indicator_level3 70.0 +#property indicator_levelcolor clrSilver +#property indicator_levelstyle STYLE_DOT + +// +// Declare Buffers ... +#define rsiBufferIndex 0 +#define positiveBufferIndex 1 +#define negativeBufferIndex 2 + +double rsiBuffer[]; +double positiveBuffer[]; +double negativeBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + string short_name; + + // + IndicatorBuffers(3); + + // + SetIndexBuffer(positiveBufferIndex, positiveBuffer); + SetIndexBuffer(negativeBufferIndex, negativeBuffer); + + // + SetIndexStyle(rsiBufferIndex, DRAW_LINE); + SetIndexBuffer(rsiBufferIndex, rsiBuffer); + + // + // name for DataWindow and indicator subwindow label + short_name="RSI("+string(rsiPeriod)+")"; + IndicatorShortName(short_name); + SetIndexLabel(rsiBufferIndex, short_name); + + // + // check for input + if (rsiPeriod < 2) { + // + Print("Incorrect value for input variable InpRSIPeriod = ", rsiPeriod); + + // + // Failed Initialization ... + return INIT_PARAMETERS_INCORRECT; + } + + // + // set where to start draw ... + SetIndexDrawBegin(0, rsiPeriod); + + // + // initialization done ... + return INIT_SUCCEEDED; +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + int i,pos; + double diff; + + // + // Prevent from run calculations if there is no fulfilled conditions ... + if (Bars <= rsiPeriod || rsiPeriod < 2) { + // + // return nothing calculated result ... + return 0; + } + + // + // counting from 0 to rates_total, this is most important ... + ArraySetAsSeries(rsiBuffer, false); + ArraySetAsSeries(positiveBuffer, false); + ArraySetAsSeries(negativeBuffer, false); + + // + ArraySetAsSeries(close, false); + + // + // preliminary calculations ... + pos = prev_calculated - 1; + if (pos <= rsiPeriod) { + // + // first RSIPeriod values of the indicator are not calculated + rsiBuffer[0] = 0.0; + positiveBuffer[0] = 0.0; + negativeBuffer[0] = 0.0; + + // + double sump=0.0; + double sumn=0.0; + for (i = 1; i <= rsiPeriod; i++) { + // + rsiBuffer[i]=0.0; + positiveBuffer[i]=0.0; + negativeBuffer[i]=0.0; + + // + diff = close[i] - close[i - 1]; + if(diff > 0) { + sump += diff; + } else { + sumn -= diff; + } + } + + // + // calculate first visible value ... + positiveBuffer[rsiPeriod] = sump / rsiPeriod; + negativeBuffer[rsiPeriod] = sumn / rsiPeriod; + if (negativeBuffer[rsiPeriod] != 0.0) { + // + rsiBuffer[rsiPeriod] = 100.0 - ( + 100.0 / ( + 1.0 + positiveBuffer[rsiPeriod] / negativeBuffer[rsiPeriod] + ) + ); + } else { + // + if (positiveBuffer[rsiPeriod] != 0.0) { + rsiBuffer[rsiPeriod] = 100.0; + } else { + rsiBuffer[rsiPeriod] = 50.0; + } + } + + // + // prepare the position value for main calculation ... + pos = rsiPeriod + 1; + } + + // + // the main loop of calculations ... + for (i = pos; i < rates_total && !IsStopped(); i++) { + // + diff = close[i] - close[i-1]; + + // + positiveBuffer[i] = (positiveBuffer[i-1] * (rsiPeriod - 1) + (diff > 0.0 ? diff : 0.0)) / rsiPeriod; + negativeBuffer[i] = (negativeBuffer[i-1] * (rsiPeriod - 1) + (diff < 0.0 ? -diff : 0.0)) / rsiPeriod; + + // + if (negativeBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0 - 100.0 / (1 + positiveBuffer[i] / negativeBuffer[i]); + } else { + // + if (positiveBuffer[i] != 0.0) { + rsiBuffer[i] = 100.0; + } else { + rsiBuffer[i] = 50.0; + } + } + } + + // + return(rates_total); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.xma.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.xma.mq4 new file mode 100644 index 0000000..20206ac --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.xma.mq4 @@ -0,0 +1,643 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XMA Indicator +// --------------------------------------------- +// saherelm implementation of above oscillator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XMA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +input int shortCycleFastMultiplier = 1; // Short Cycle Fast Multiplier +input int shortCycleSlowMultiplier = 4; // Short Cycle Slow Multiplier +input int mediumCycleFastMultiplier = 7; // Medium Cycle Fast Multiplier +input int mediumCycleSlowMultiplier = 14; // Medium Cycle Slow Multiplier +input int longCycleFastMultiplier = 70; // Long Cycle Fast Multiplier +input int longCycleSlowMultiplier = 140; // Long Cycle Slow Multiplier +// +// Show Inputs ... +input bool showShortCycle = true; // Show Short Cycle +input bool showShortCycleCrossLines = true; // Show Short Cycle Vertical Lines +input bool showMediumCycle = true; // Show Medium Cycle +input bool showMediumCycleCrossLines = true; // Show Medium Cycle Vertical Lines +input bool showLongCycle = true; // Show Long Cycle +input bool showLongCycleCrossLines = true; // Show Long Cycle Vertical Lines +// +// Color Inputs ... +input color shortCycleFastColor = clrGreen; // Short Cycle Fast Color ... +input color shortCycleSlowColor = clrRed; // Short Cycle Slow Color ... +input color mediumCycleFastColor = clrAqua; // Medium Cycle Fast Color ... +input color mediumCycleSlowColor = clrFuchsia; // Medium Cycle Slow Color ... +input color longCycleFastColor = clrGoldenrod; // Medium Cycle Fast Color ... +input color longCycleSlowColor = clrBrown; // Medium Cycle Slow Color ... +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +// define indicator buffers ... +#property indicator_buffers 7 +#property indicator_plots 7 + +// +// Middle ... +#property indicator_label7 "Mid" +#property indicator_type7 DRAW_LINE +#property indicator_color7 clrBisque +#property indicator_style7 STYLE_DASHDOTDOT +#property indicator_width7 1 + +// +// Declare Buffers ... +#define scFastBufferIndex 0 +#define scSlowBufferIndex 1 +#define mcFastBufferIndex 2 +#define mcSlowBufferIndex 3 +#define lcFastBufferIndex 4 +#define lcSlowBufferIndex 5 +#define midBufferIndex 6 + +// +double scFastBuffer[]; +double scSlowBuffer[]; +double mcFastBuffer[]; +double mcSlowBuffer[]; +double lcFastBuffer[]; +double lcSlowBuffer[]; +double midBuffer[]; + +// +int shortCycleFastLength; +int shortCycleSlowLength; +int mediumCycleFastLength; +int mediumCycleSlowLength; +int longCycleFastLength; +int longCycleSlowLength; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + // + // Validate Market Length ... + marketLength <= 0 + // + // Validate Short Cycle ... + || shortCycleFastMultiplier <= 0 + || shortCycleSlowMultiplier <= 0 + || shortCycleFastMultiplier >= shortCycleSlowMultiplier + // + // Validate Medium Cycle ... + || mediumCycleFastMultiplier <= 0 + || mediumCycleSlowMultiplier <= 0 + || mediumCycleFastMultiplier >= mediumCycleSlowMultiplier + // + // Validate Long Cycle ... + || longCycleFastMultiplier <= 0 + || longCycleSlowMultiplier <= 0 + || longCycleFastMultiplier >= longCycleSlowMultiplier + // + // Validate Series of Multipliers ... + || shortCycleFastMultiplier >= mediumCycleFastMultiplier + || mediumCycleFastMultiplier >= longCycleFastMultiplier + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST_XMA"; + + // + // Calculate Cycle Length based on given Multipliers ... + shortCycleFastLength = marketLength * shortCycleFastMultiplier; + shortCycleSlowLength = marketLength * shortCycleSlowMultiplier; + mediumCycleFastLength = marketLength * mediumCycleFastMultiplier; + mediumCycleSlowLength = marketLength * mediumCycleSlowMultiplier; + longCycleFastLength = marketLength * longCycleFastMultiplier; + longCycleSlowLength = marketLength * longCycleSlowMultiplier; + + // + // Short Cycle Fast ... + SetIndexLabel(scFastBufferIndex, "SCFast"); + SetIndexBuffer(scFastBufferIndex, scFastBuffer); + SetIndexDrawBegin(scFastBufferIndex, shortCycleFastLength); + SetIndexStyle( + scFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleFastColor : + clrNONE + ); + + // + // Short Cycle Slow ... + SetIndexLabel(scSlowBufferIndex, "SCSLow"); + SetIndexBuffer(scSlowBufferIndex, scSlowBuffer); + SetIndexDrawBegin(scSlowBufferIndex, shortCycleSlowLength); + SetIndexStyle( + scSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showShortCycle ? + shortCycleSlowColor : + clrNONE + ); + + // + // Medium Cycle Fast ... + SetIndexLabel(mcFastBufferIndex, "MCFast"); + SetIndexBuffer(mcFastBufferIndex, mcFastBuffer); + SetIndexDrawBegin(mcFastBufferIndex, mediumCycleFastLength); + SetIndexStyle( + mcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleFastColor : + clrNONE + ); + + // + // Medium Cycle Slow ... + SetIndexLabel(mcSlowBufferIndex, "MCSlow"); + SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer); + SetIndexDrawBegin(mcSlowBufferIndex, mediumCycleSlowLength); + SetIndexStyle( + mcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showMediumCycle ? + mediumCycleSlowColor : + clrNONE + ); + + // + // Long Cycle Fast ... + SetIndexLabel(lcFastBufferIndex, "LCFast"); + SetIndexBuffer(lcFastBufferIndex, lcFastBuffer); + SetIndexDrawBegin(lcFastBufferIndex, longCycleFastLength); + SetIndexStyle( + lcFastBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleFastColor : + clrNONE + ); + + // + // Long Cycle Slow ... + SetIndexLabel(lcSlowBufferIndex, "LCSlow"); + SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer); + SetIndexDrawBegin(lcSlowBufferIndex, longCycleSlowLength); + SetIndexStyle( + lcSlowBufferIndex, + DRAW_LINE, + STYLE_DOT, + 1, + showLongCycle ? + longCycleSlowColor : + clrNONE + ); + + // + // Market Middleage ... + SetIndexBuffer(midBufferIndex, midBuffer); + SetIndexDrawBegin(midBufferIndex, marketLength); + + // + // initialization done ... + return(INIT_SUCCEEDED); +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + RemoveDraws(logTag); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(marketLength, longCycleSlowLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Short Cycle ... + CalculateShortCycle(i); + + // + // Calculate Medium Cycle ... + CalculateMediumCycle(i); + + // + // Calculate Long Cycle ... + CalculateLongCycle(i); + + // + // Calculate Market Middleage ... + CalculateMarketMiddleage(i); + + // + // Calculate Cross Points ... + CalculateCrossPoints(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculate Short Cycle ... +void CalculateShortCycle( + const int bar_index +) { + // + // Fast ... + double shortCycleFast = iMA( + _Symbol, + _Period, + shortCycleFastLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scFastBuffer[bar_index] = shortCycleFast; + + // + // Slow ... + double shortCycleSlow = iMA( + _Symbol, + _Period, + shortCycleSlowLength, + 0, + MODE_SMA, + PRICE_WEIGHTED, + bar_index + ); + scSlowBuffer[bar_index] = shortCycleSlow; +} + +// +// Calculate Medium Cycle ... +void CalculateMediumCycle( + const int bar_index +) { + // + // Fast ... + double mediumCycleFast = iMA( + _Symbol, + _Period, + mediumCycleFastLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcFastBuffer[bar_index] = mediumCycleFast; + + // + // Slow ... + double mediumCycleSlow = iMA( + _Symbol, + _Period, + mediumCycleSlowLength, + 0, + MODE_SMA, + PRICE_MEDIAN, + bar_index + ); + mcSlowBuffer[bar_index] = mediumCycleSlow; +} + +// +// Calculate Long Cycle ... +void CalculateLongCycle( + const int bar_index +) { + // + // Fast ... + double longCycleFast = iMA( + _Symbol, + _Period, + longCycleFastLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcFastBuffer[bar_index] = longCycleFast; + + // + // Slow ... + double longCycleSlow = iMA( + _Symbol, + _Period, + longCycleSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE, + bar_index + ); + lcSlowBuffer[bar_index] = longCycleSlow; +} + +// +// Calculate Market Middleage ... +void CalculateMarketMiddleage( + const int bar_index +) { + // + // Mid ... + double marketMiddleage = iMA( + _Symbol, + _Period, + (int)(marketLength * 1.5), + 0, + MODE_EMA, + PRICE_MEDIAN, + bar_index + ); + midBuffer[bar_index] = marketMiddleage; +} + +// +// Calculate Cross Points and Draw Section Line on theme ... +void CalculateCrossPoints( + const int bar_index +) { + // + // START Draw Cross Lines ... + // + // + // Short Cycle ... + bool isSCFastCrossOverSlow = scFastBuffer[bar_index] > scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] > scSlowBuffer[bar_index + 1]); + + // + bool isSCFastCrossUnderSlow = scFastBuffer[bar_index] < scSlowBuffer[bar_index] + && !(scFastBuffer[bar_index + 1] < scSlowBuffer[bar_index + 1]); + + // + // Medium Cycle ... + bool isMCFastCrossOverSlow = mcFastBuffer[bar_index] > mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] > mcSlowBuffer[bar_index + 1]); + + // + bool isMCFastCrossUnderSlow = mcFastBuffer[bar_index] < mcSlowBuffer[bar_index] + && !(mcFastBuffer[bar_index + 1] < mcSlowBuffer[bar_index + 1]); + + // + // Long Cycle ... + bool isLCFastCrossOverSlow = lcFastBuffer[bar_index] > lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] > lcSlowBuffer[bar_index + 1]); + + // + bool isLCFastCrossUnderSlow = lcFastBuffer[bar_index] < lcSlowBuffer[bar_index] + && !(lcFastBuffer[bar_index + 1] < lcSlowBuffer[bar_index + 1]); + + // + // START Drawing CrossPoints ... + // + // + datetime currentTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (showShortCycleCrossLines) { + // + // Draw Line ... + if (isSCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isSCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_SC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showShortCycleCrossLines ? + shortCycleSlowColor : + clrNONE + ); + } + } + + // + if (showMediumCycleCrossLines) { + // + // Draw Line ... + if (isMCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isMCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_MC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showMediumCycleCrossLines ? + mediumCycleSlowColor : + clrNONE + ); + } + } + + // + if (showLongCycleCrossLines) { + // + // Draw Line ... + if (isLCFastCrossOverSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_OV_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleFastColor : + clrNONE + ); + } + + // + // Draw Line ... + if (isLCFastCrossUnderSlow) { + // + string lbl = StringConcatenate( + logTag, + "_LC_F_UN_S_", + currentTime + ); + + // + DrawVerticalLine( + 0, + lbl, + 0, + currentTime, + showLongCycleCrossLines ? + longCycleSlowColor : + clrNONE + ); + } + } + // + // END Drawing CrossPoints ... + // +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Indicators/x-saherelm.zigzag.mq4 b/Bkp/Used/OSC EA/Indicators/x-saherelm.zigzag.mq4 new file mode 100644 index 0000000..fbb073c --- /dev/null +++ b/Bkp/Used/OSC EA/Indicators/x-saherelm.zigzag.mq4 @@ -0,0 +1,476 @@ +///////////////////////////////////////////////////////////////// +// +// SaherElm IT Center ZigZag Indicator +// ------------------------------------------------------------- +// this indicator provides signals for Main strategy ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +//////////////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm ZigZag Indicator" +#property strict + +// +// START Inputs ... +// +input int depth = 12; // Depth +input int deviation = 5; // Deviation +input int backStep = 3; // BackStep +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// here we specify logging enabled or not ... +bool enableLogging = true; + +// +// this is a Tag which attached to our Logger ... +string logTag = "XS_ZG"; + +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_width1 1 +#property indicator_color1 clrAqua +// #property indicator_type1 DRAW_SECTION +// #property indicator_style1 STYLE_SOLID + +// // +// #property indicator_width2 1 +// #property indicator_color2 clrNONE +// #property indicator_type2 DRAW_NONE +// #property indicator_style2 STYLE_SOLID + +// // +// #property indicator_width3 1 +// #property indicator_color3 clrNONE +// #property indicator_type3 DRAW_NONE +// #property indicator_style3 STYLE_SOLID + +// +// Buffers ... +// +#define zigzagBufferIndex 0 +#define highBufferIndex 1 +#define lowBufferIndex 2 +// #define ziggyBufferIndex 3 + +// +double zigzagBuffer[]; +double highBuffer[]; +double lowBuffer[]; +// double ziggyBuffer[]; + +// +// recounting's depth of extremums ... +int level=3; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + + // + // Validating Input Parameters ... + if ( + depth <= 0 || + backStep < 0 || + deviation < 0 || + backStep >= depth + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Set Index Buffers of ZigZag ... + IndicatorBuffers(3); + + // + // ZigZag Buffer ... + SetIndexBuffer(zigzagBufferIndex, zigzagBuffer); + SetIndexStyle(zigzagBufferIndex, DRAW_SECTION); + SetIndexLabel(zigzagBufferIndex, "ZigZag"); + + // + // High Buffer ... + SetIndexBuffer(highBufferIndex, highBuffer); + SetIndexLabel(highBufferIndex, ""); + + // + // Low Buffer ... + SetIndexBuffer(lowBufferIndex, lowBuffer); + SetIndexLabel(lowBufferIndex, ""); + + // + // Ziggy Buffer ... + // SetIndexBuffer(ziggyBufferIndex, ziggyBuffer); + // SetIndexLabel(ziggyBufferIndex, ""); + + // + return(INIT_SUCCEEDED); +} + +// +// Do Calculation ... +int OnCalculate( + const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + int maxLength = MathMax(depth, backStep); + + int i; + int counterZ; + int back; + int pos; + + // + int lastlowpos = 0; + int lasthighpos = 0; + int whatlookfor = 0; + + // + double extremum; + + // + double curlow = 0.0; + double curhigh = 0.0; + double lasthigh = 0.0; + double lastlow = 0.0; + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // first calculations ... + if (prev_calculated == 0) { + limit = InitializeBuffers(); + } else { + // + // find first extremum in the depth ExtLevel or 100 last bars ... + i = counterZ = 0; + while(counterZ < level && i < 100) { + // + if(zigzagBuffer[i] != 0.0) { + counterZ++; + } + + // + i++; + } + + // + // no extremum found - recounting all from begin ... + if(counterZ == 0) { + limit = InitializeBuffers(); + } else { + // + // set start position to found extremum position ... + limit = i-1; + + // + //--- what kind of extremum? + if(lowBuffer[i] != 0.0) { + // + // low extremum ... + curlow = lowBuffer[i]; + + // + // will look for the next high extremum ... + whatlookfor=1; + } else { + // + // high extremum ... + curhigh = highBuffer[i]; + + // + // will look for the next low extremum ... + whatlookfor=-1; + } + + // + // clear the rest data ... + for(i = limit - 1; i >= 0; i--) { + // + lowBuffer[i]=0.0; + highBuffer[i]=0.0; + zigzagBuffer[i]=0.0; + } + } + } + + // + // Main Calculation Loop ... + for (i = limit; i >= 0; i--) { + // + // find lowest low in depth of bars ... + extremum = low[ + iLowest( + _Symbol, + _Period, + MODE_LOW, + depth, + i + ) + ]; + + // + // this lowest has been found previously ... + if (extremum == lastlow) { + extremum = 0.0; + } else { + // + // new last low ... + lastlow=extremum; + + // + // discard extremum if current low is too high ... + if(low[i] - extremum > deviation * _Point) { + extremum=0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if(lowBuffer[pos] != 0 && lowBuffer[pos] > extremum) { + lowBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current low ... + if (low[i] == extremum) { + lowBuffer[i] = extremum; + } else { + lowBuffer[i] = 0.0; + } + + // + // find highest high in depth of bars ... + extremum = high[ + iHighest( + _Symbol, + _Period, + MODE_HIGH, + depth, + i + ) + ]; + + // + // this highest has been found previously ... + if (extremum == lasthigh) { + extremum = 0.0; + } else { + // + // new last high ... + lasthigh=extremum; + + // + // discard extremum if current high is too low ... + if (extremum - high[i] > deviation * Point) { + extremum = 0.0; + } else { + // + // clear previous extremums in backstep bars ... + for(back = 1; back <= backStep; back++) { + // + pos = i + back; + + // + if (highBuffer[pos] != 0 && highBuffer[pos] < extremum) { + highBuffer[pos] = 0.0; + } + } + } + } + + // + // found extremum is current high ... + if (high[i] == extremum) { + highBuffer[i] = extremum; + } else { + highBuffer[i] = 0.0; + } + } + + // + // final cutting ... + if( whatlookfor == 0) { + // + lastlow = 0.0; + lasthigh = 0.0; + } else { + // + lastlow = curlow; + lasthigh = curhigh; + } + + // + for(i = limit; i >= 0; i--) { + switch(whatlookfor) { + // + // look for peak or lawn ... + case 0: + // + if (lastlow == 0.0 && lasthigh == 0.0) { + if(highBuffer[i]!=0.0) { + // + lasthigh = High[i]; + lasthighpos = i; + whatlookfor = -1; + + // + zigzagBuffer[i] = lasthigh; + } + + // + if(lowBuffer[i] != 0.0) { + // + lastlow = Low[i]; + lastlowpos = i; + whatlookfor = 1; + + // + zigzagBuffer[i] = lastlow; + } + } + break; + + // + // look for peak ... + case 1: + // + if ( + lowBuffer[i] != 0.0 && + lowBuffer[i] < lastlow && + highBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lastlowpos] = 0.0; + lastlowpos = i; + lastlow = lowBuffer[i]; + zigzagBuffer[i] = lastlow; + } + + // + if(highBuffer[i] != 0.0 && lowBuffer[i] == 0.0) { + // + lasthigh = highBuffer[i]; + lasthighpos = i; + zigzagBuffer[i] = lasthigh; + + // + whatlookfor=-1; + } + break; + + // + // look for lawn ... + case -1: + // + if( + highBuffer[i] != 0.0 && + highBuffer[i] > lasthigh && + lowBuffer[i] == 0.0 + ) { + // + zigzagBuffer[lasthighpos] = 0.0; + lasthighpos = i; + lasthigh = highBuffer[i]; + zigzagBuffer[i] = lasthigh; + } + + // + if( + lowBuffer[i] !=0.0 && + highBuffer[i] == 0.0 + ) { + // + lastlow = lowBuffer[i]; + lastlowpos = i; + zigzagBuffer[i] = lastlow; + whatlookfor=1; + } + break; + } + } + + // + // Done ... + return rates_total; +} + +// +// De Initialization ... +void OnDeinit(const int reason) { + // + // RemoveDraws(signalPrefix); + ChartRedraw(0); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +int InitializeBuffers() { + // + ArrayInitialize(lowBuffer,0.0); + ArrayInitialize(highBuffer, 0.0); + ArrayInitialize(zigzagBuffer, 0.0); + + // + //--- first counting position + return(Bars - depth); +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/Used/OSC EA/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..08fefa7 --- /dev/null +++ b/Bkp/Used/OSC EA/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,1670 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Libraries/x-saherelm.lib.mq4 b/Bkp/Used/OSC EA/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..ed1bbc6 --- /dev/null +++ b/Bkp/Used/OSC EA/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,968 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + static datetime lastbar; + datetime curbar = (datetime)SeriesInfoInteger(_Symbol, _Period, SERIES_LASTBAR_DATE); + + // + if(lastbar != curbar) { + // + lastbar = curbar; + return true; + } + + // + return false; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool isBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = isBullishCandle( + open, + close + ); + + // + return result; +} + +bool isBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool isBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = isBearishCandle( + open, + close + ); + + // + return result; +} + +bool isBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +struct XMinMax { + double min; + double max; +}; + +// +// Find Min and Max Value of specific Buffer ... +XMinMax GetBufferMinMax(const double &buffer[]) { + // + XMinMax result = {}; + + // + int bufferSize = ArraySize(buffer); + if (bufferSize < 1) { + return result; + } + + // + double min = buffer[0]; + double max = buffer[0]; + + // + for (int i = 1; i < bufferSize; i++) { + // + if (buffer[i] < min) { + min = buffer[i]; + } else if (buffer[i] > max) { + max = buffer[i]; + } + } + + // + result.min = min; + result.max = max; + + // + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/Used/OSC EA/Libraries/x-saherelm.log.lib.mq4 b/Bkp/Used/OSC EA/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..eb5ea36 --- /dev/null +++ b/Bkp/Used/OSC EA/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// End Log Messages ... +// + diff --git a/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.models.lib.mq4 b/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.models.lib.mq4 new file mode 100644 index 0000000..a22cf6d --- /dev/null +++ b/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.models.lib.mq4 @@ -0,0 +1,194 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Start Models ... +// + +// +// Used Indicators List ... +const string xmaIndicatorName = "x-saherelm.xma"; +const string adxIndicatorName = "x-saherelm.adx"; +const string oscIndicatorName = "x-saherelm.osc"; +const string zigZagIndicatorName = "x-saherelm.zigzag"; + +// +// Direction ... +enum X_DIRECTION { + X_UP, + X_DOWN +}; + +// +// these are different signal types ... +enum X_SIGNAL_TYPE { + X_NONE, + X_LONG, + X_SHORT, +}; + +// +// we Model each signals as this type ... +struct XSignal { + int id; + X_SIGNAL_TYPE type; + double tp; + double sl; + string symbol; + datetime time; + double entryPrice; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + X_SIGNAL_TYPE type; + XSignal signal; +}; + +// +// we model OSC Return Data ... +struct XOSCState { + // + double fastOSC; + double fastOSCPrev; + + // + double slowOSC; + double slowOSCPrev; + + // + double powerOSC; + double powerOSCPrev; + + // + double varOSC; + double varOSCPrev; + + // + double tanFSOSC; + + // + bool isOSCCrossOver; + bool isOSCCrossUnder; +}; + +// +// Define a Model to Represent Snapshot of XMA Indicator ... +struct XMAState { + // + // Short Cycle ... + // + // FAST ... + double scFast; + double scFastPrev; + + // + // SLOW ... + double scSlow; + double scSlowPrev; + + // + bool isSCTrendUp; + + // + // Medium Cycle ... + // + // FAST ... + double mcFast; + double mcFastPrev; + + // + // SLOW ... + double mcSlow; + double mcSlowPrev; + + // + // Long Cycle ... + // + // FAST ... + double lcFast; + double lcFastPrev; + + // + // SLOW ... + double lcSlow; + double lcSlowPrev; + + // + // MIDDLEAGE ... + double marketMiddleage; + double marketMiddleagePrev; +}; + +// +// Represent ADX State ... +struct XADXState { + // + double trendPower; + double trendPowerPrev; + + // + double upDirection; + double upDirectionPrev; + + // + double downDirection; + double downDirectionPrev; + + // + bool isUpTrend; + bool isDownTrend; +}; + +// +// ZigZag State ... +struct XZigZagState { + // + double zigZag; + datetime zigZagTime; + + // + double zigZagPrev; + datetime zigZagPrevTime; + + // + double low; + int lowBarIndex; + datetime lowTime; + + // + double high; + int highBarIndex; + datetime highTime; + + // + double delta; + + // + bool isWaitForTrendUp; + bool isWaitForTrendDown; + + // + bool isLowIsLastLow; + bool isHighIsLastHigh; +}; +// +// End Models ... +// diff --git a/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.signal.lib.mq4 b/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.signal.lib.mq4 new file mode 100644 index 0000000..94e8959 --- /dev/null +++ b/Bkp/Used/OSC EA/Libraries/x-saherelm.osc.signal.lib.mq4 @@ -0,0 +1,2641 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.osc.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; + +// +static XMAState xmaState; +static XOSCState oscState; +static XADXState adxState; +static XZigZagState zigZagState; + +// +// Retrieve ZigZag State ... +XZigZagState GetZigZagState( + const int bar_index, + int zDpt = 7, + int zDev = 5, + int zBkStp = 3 +) { + // + XZigZagState result = {}; + + // + int counter = bar_index; + + // + double lastValue = 0.0; + datetime lastValueTime = 0; + + // + double lastPrevValue = 0.0; + datetime lastPrevValueTime = 0; + + // + // START Retrieve ZigZag ... + // + while ( + lastValue == 0.0 || + lastPrevValue == 0.0 + ) { + // + // ZigZag ... + double zigZag = iCustom( + _Symbol, + _Period, + zigZagIndicatorName, + zDpt, // Depth ... + zDev, // Deviation ... + zBkStp, // BackStep ... + 0, // Buffer Index ... + counter + ); + + // + if (zigZag != 0.0) { + // + if (lastValue == 0.0) { + // + lastValue = zigZag; + lastValueTime = iTime( + _Symbol, + _Period, + counter + ); + } else if (lastPrevValue == 0.0) { + // + lastPrevValue = zigZag; + lastPrevValueTime = iTime( + _Symbol, + _Period, + counter + ); + } + } + + // + counter++; + } + // + // END Retrieve ZigZag ... + // + + // + result.zigZag = lastValue; + result.zigZagTime = lastValueTime; + + // + result.zigZagPrev = lastPrevValue; + result.zigZagPrevTime = lastPrevValueTime; + + // + double delta = lastPrevValue - lastValue; + result.delta = delta; + + // + bool isWaitForTrendUp = delta > 0; + result.isWaitForTrendUp = isWaitForTrendUp; + + // + bool isWaitForTrendDown = delta < 0; + result.isWaitForTrendDown = isWaitForTrendDown; + + // + double low = isWaitForTrendUp ? + lastValue : + lastPrevValue; + datetime lowTime = isWaitForTrendUp ? + lastValueTime : + lastPrevValueTime; + int lowBarIndex = iBarShift( + _Symbol, + _Period, + lowTime + ); + // + result.low = low; + result.lowTime = lowTime; + result.lowBarIndex = lowBarIndex; + + // + double high = isWaitForTrendUp ? + lastPrevValue : + lastValue; + datetime highTime = isWaitForTrendUp ? + lastPrevValueTime : + lastValueTime; + int highBarIndex = iBarShift( + _Symbol, + _Period, + highTime + ); + + // + result.high = high; + result.highTime = highTime; + result.highBarIndex = highBarIndex; + + // + // Check Signals Occured exactly after high or low ... + bool isLowIsLastLow = false; + bool isHighIsLastHigh = false; + for (int i = zBkStp - 1; i <= 0; i--) { + // + double lLow = iLow( + _Symbol, + _Period, + i + ); + + // + isLowIsLastLow = isLowIsLastLow + || lLow == low + || MathAbs(lLow - low) < 0.05; + + // + double lHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + isHighIsLastHigh = high + || lHigh == high + || MathAbs(lHigh - high) < 0.05; + } + + // + result.isLowIsLastLow = isLowIsLastLow; + result.isHighIsLastHigh = isHighIsLastHigh; + + // + return result; +} + +// +// Retrieve State ... +XOSCState GetOSCState( + const int bar_index, + const int foLen, + const double foMul, + const int slLen, + const double slMul +) { + // + // Define Trend Direction Related Values ... + // + XOSCState result = {}; + + // + // START Extract Data from Oscillator ... + // + // + // Fast OSC ... + double fastOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + ); + result.fastOSC = fastOSC; + + // + // Prev FastOSC ... + double fastOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 0, // Fast OSC Buffer Index ... + bar_index + 1 + ); + result.fastOSCPrev = fastOSCPrev; + + // + // Slow OSC ... + double slowOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + ); + result.slowOSC = slowOSC; + + // + // Prev Slow OSC ... + double slowOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 1, // Slow OSC Buffer Index ... + bar_index + 1 + ); + result.slowOSCPrev = slowOSCPrev; + + // + // Power OSC ... + double powerOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + ); + result.powerOSC = powerOSC; + + // + double powerOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 2, // Power OSC Buffer Index ... + bar_index + 1 + ); + result.powerOSCPrev = powerOSCPrev; + + // + // Var OSC ... + double varOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + ); + result.varOSC = varOSC; + + // + double varOSCPrev = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 3, // Var OSC Buffer Index ... + bar_index + 1 + ); + result.varOSCPrev = varOSCPrev; + + // + // Tan FS OSC ... + double tanFSOSC = iCustom( + _Symbol, + _Period, + oscIndicatorName, + foLen, + foMul, + slLen, + slMul, + 4, // Tan F/S OSC Buffer Index ... + bar_index + ); + result.tanFSOSC = tanFSOSC; + // + // END Extract Data from Oscillator ... + // + + // + // Calculations ... + // + bool isOSCCrossOver = fastOSC > slowOSC && + !(fastOSCPrev > slowOSCPrev); + result.isOSCCrossOver = isOSCCrossOver; + + // + bool isOSCCrossUnder = fastOSC < slowOSC && + !(fastOSCPrev < slowOSCPrev); + result.isOSCCrossUnder = isOSCCrossUnder; + + // + return result; +} + +// +// Check Market Ranging or not based on OSC ... +bool IsOSCMarketRanging( + // + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double rangingThreshold, // Detect Ranging based On Power OSC ... + // + // OSC Specifications ... + const int foLen, // Fast OSC Length ... + const double foMul, // Fast OSC Multiplier ... + const int slLen, // Slow OSC Length ... + const double slMul // Slow OSC Multiplier ... +) { + // + bool result = false; + + // + // Detect Buffer Size ... + const int bufferSize = marketLen + bar_index; + double powerOSCBuffer[]; + ArraySetAsSeries( + powerOSCBuffer, + true + ); + ArrayResize( + powerOSCBuffer, + bufferSize + ); + + // + // Loop through Market for Extract PowerOSC from OSC Indicator ... + for (int i = bufferSize - 1; i >= 0; i--) { + // + // Retrieve OSC State at Specific Bar Index ... + XOSCState state = GetOSCState( + i, + foLen, + foMul, + slLen, + slMul + ); + + // + powerOSCBuffer[i] = state.powerOSC; + } + + // + // now we have to extract min and max value of Splitted Buffer ... + XMinMax minMax = GetBufferMinMax(powerOSCBuffer); + + // + // now Check Min and Max Direction and Compare them with Ranging Value ... + result = MathAbs(minMax.min) > rangingThreshold + || MathAbs(minMax.max) > rangingThreshold; + + // + return result; +} + +// +// Retrieve and Calculate XMA State ... +XMAState GetXMAState( + const int bar_index, // Bar Index ... + // + // Market Length ... + const int marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor // Medium Cycle Slow Color ... +) { + // + // Temp Result ... + XMAState result = {}; + + // + // START Reading Buffers ... + // + // + // Define BufferIndexes ... + int scFastBufIndex = 0; + int scSlowBufIndex = 1; + int mcFastBufIndex = 2; + int mcSlowBufIndex = 3; + int lcFastBufIndex = 4; + int lcSlowBufIndex = 5; + int midBufIndex = 6; + + // + // START Short Cycle ... + // + // + // Short Cycle Fast ... + double scFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + ); + result.scFast = scFast; + + // + // Short Cycle Previous Fast ... + double scFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scFastPrev = scFastPrev; + + // + // Short Cycle Slow ... + double scSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + ); + result.scSlow = scSlow; + + // + // Short Cycle Previous Slow ... + double scSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + scSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.scSlowPrev = scSlowPrev; + // + // END Short Cycle ... + // + + // + // START Medium Cycle ... + // + // + // Medium Cycle Fast ... + double mcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + ); + result.mcFast = mcFast; + + // + // Medium Cycle Previous Fast ... + double mcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcFastPrev = mcFastPrev; + + // + // Medium Cycle Slow ... + double mcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.mcSlow = mcSlow; + + // + // Medium Cycle Previous Slow ... + double mcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + mcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.mcSlowPrev = mcSlowPrev; + // + // END Medium Cycle ... + // + + // + // START Long Cycle ... + // + // + // Long Cycle Fast ... + double lcFast = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + ); + result.lcFast = lcFast; + + // + // Long Cycle Previous Fast ... + double lcFastPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcFastBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcFastPrev = lcFastPrev; + + // + // Long Cycle Slow ... + double lcSlow = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + ); + result.lcSlow = lcSlow; + + // + // Long Cycle Previous Slow ... + double lcSlowPrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + lcSlowBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.lcSlowPrev = lcSlowPrev; + // + // END Long Cycle ... + // + + // + // START Makret Middleage ... + // + // + // Market Middleage ... + double marketMiddleage = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + ); + result.marketMiddleage = marketMiddleage; + + // + // Previous Market Middleage ... + double marketMiddleagePrev = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + marketLen, // Market Length ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor, // Medium Cycle Slow Color ... + // + midBufIndex, // Buffer Index ... + bar_index + 1 + ); + result.marketMiddleagePrev = marketMiddleagePrev; + // + // END Makret Middleage ... + // + // + // END Reading Buffers ... + // + + // + return result; +} + +// +// Retrieve XADX State ... +XADXState GetADXState( + // + const int bar_index, // Bar Index ... + // + const int marketLen // Market Length ... +) { + // + // Temp Result ... + XADXState result = {}; + + // + // Define Buffer Index ... + int adxBufferIndex = 0; + int positiveBufferIndex = 1; + int negativeBufferIndex = 2; + + // + ENUM_APPLIED_PRICE appliedPrice = PRICE_WEIGHTED; + + // + // START Recieve Buffers ... + // + // + // TRENDPOWER ... + double trendPower = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + adxBufferIndex, // ADX Trend Power Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.trendPower = trendPower; + + // + // TRENDPOWER Prev ... + double trendPowerPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + adxBufferIndex, // ADX Trend Power Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.trendPowerPrev = trendPowerPrev; + + // + // UP Dir ... + double upDirection = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + positiveBufferIndex, // Up Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.upDirection = upDirection; + + // + // UP Dir Prev ... + double upDirectionPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + positiveBufferIndex, // Up Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.upDirectionPrev = upDirectionPrev; + + // + // DOWN Dir ... + double downDirection = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + negativeBufferIndex, // Down Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + ); + result.downDirection = downDirection; + + // + // DOWN Dir Prev ... + double downDirectionPrev = iCustom( + // + // Global Data ... + _Symbol, + _Period, + // + // Indicator Name ... + adxIndicatorName, + // + // Indicator Inputs ... + marketLen, // Averaging Period ... + appliedPrice, // Averaging Applied Price ... + // + // Buffer Index + negativeBufferIndex, // Down Direction Buffer Index ... + // + // Shift or Bar Index ... + bar_index + 1 + ); + result.downDirectionPrev = downDirectionPrev; + // + // END Recieve Buffers ... + // + + // + // Calculations ... + + // + bool isUpTrend = upDirection > downDirection + && upDirectionPrev > downDirectionPrev; + result.isUpTrend = isUpTrend; + + // + bool isDownTrend = upDirection < downDirection + && upDirectionPrev < downDirectionPrev; + result.isDownTrend = isDownTrend; + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + X_DIRECTION direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction == X_UP ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest CalculateSignal( + // + const int bar_index, // Bar Index ... + // + // MARKET Specifications ... + const int marketLen, // Market Length ... + const double r2r, // Risk To Reward Ratio ... + // + // XMA Inputs ... + // + const int scFastMul, // Short Cycle Fast Multiplier ... + const int scSlowMul, // Short Cycle Slow Multiplier ... + const int mcFastMul, // Medium Cycle Fast Multiplier ... + const int mcSlowMul, // Medium Cycle Slow Multiplier ... + const int lcFastMul, // Long Cycle Fast Multiplier ... + const int lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + const bool showSC, // Show Short Cycle + const bool showSCCrossLines, // Show Short Cycle Vertical Lines + const bool showMC, // Show Medium Cycle + const bool showMCCrossLines, // Show Medium Cycle Vertical Lines + const bool showLC, // Show Long Cycle + const bool showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + const color sxFastColor, // Short Cycle Fast Color ... + const color scSlowColor, // Short Cycle Slow Color ... + const color mcFastColor, // Medium Cycle Fast Color ... + const color mcSlowColor, // Medium Cycle Slow Color ... + const color lcFastColor, // Medium Cycle Fast Color ... + const color lcSlowColor, // Medium Cycle Slow Color ... + // + // OSC Inputs ... + const int fastOSCLen, // FastOSC Length ... + const double fastOSCMul, // FastOSC Multiplier ... + const int slowOSCLen, // SlowOSC Length ... + const double slowOSCMul, // SlowOSC Multiplier ... + const double minPowOSC, // Minimum Signal Power ... + const double minVarOSC, // Minimum Var Power ... + // + // ZIGZAG Inputs ... + const int zDev, // ZigZag Deviation ... + const int zBkStep // ZigZag Back Step ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_NONE; + + // + XSignal signal = {}; + + // + // Retrieve ZigZag State ... + + // + // START Capturing Signal ... + // + // + // START Retrieve Statets ... + // + // Reading Oscillator State ... + oscState = GetOSCState( + bar_index, + fastOSCLen, + fastOSCMul, + slowOSCLen, + slowOSCMul + ); + + // + // Retrieve ZigZag State ... + zigZagState = GetZigZagState( + bar_index, + marketLen, + zDev, + zBkStep + ); + + // + // Retrieve Market Trend ... + xmaState = GetXMAState( + // + // Bar Index ... + bar_index, // Bar Index ... + // + // Market Length ... + marketLen, // Market Length ... + // + // XMA Inputs ... + // + // Market Specification Inpouts ... + scFastMul, // Short Cycle Fast Multiplier ... + scSlowMul, // Short Cycle Slow Multiplier ... + mcFastMul, // Medium Cycle Fast Multiplier ... + mcSlowMul, // Medium Cycle Slow Multiplier ... + lcFastMul, // Long Cycle Fast Multiplier ... + lcSlowMul, // Long Cycle Slow Multiplier ... + // + // Show/Hide Inputs ... + showSC, // Show Short Cycle + showSCCrossLines, // Show Short Cycle Vertical Lines + showMC, // Show Medium Cycle + showMCCrossLines, // Show Medium Cycle Vertical Lines + showLC, // Show Long Cycle + showLCCrossLines, // Show Long Cycle Vertical Lines + // + // Color Inputs ... + sxFastColor, // Short Cycle Fast Color ... + scSlowColor, // Short Cycle Slow Color ... + mcFastColor, // Medium Cycle Fast Color ... + mcSlowColor, // Medium Cycle Slow Color ... + lcFastColor, // Medium Cycle Fast Color ... + lcSlowColor // Medium Cycle Slow Color ... + ); + + // + // Retrieve ADX State ... + adxState = GetADXState( + // + bar_index, // Bar Index ... + // + marketLen // Market Length ... + ); + // + // END Retrieve Statets ... + // + + // + // START States Calculations ... + // + // + // START PRICE Calculations ... + // + RefreshRates(); + + // + double candleLow = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double candleHigh = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + // LONG Prices ... + double longEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double longClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double longPriceGap = longClosePrice - longEntryPrice; + + // + // SHORT Prices ... + double shortEntryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); + double shortClosePrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK); + double shortPriceGap = shortEntryPrice - shortClosePrice; + // + // END PRICE Calculations ... + // + + // + // START LONG Signals ... + // + bool hasLongSignal = false; + + // + // XMA Based Signals ... + bool xmaHasLongSignal = + // + // XMA ... + // + // SC Fast Cross Over Market Middleage ... + xmaState.scFast > xmaState.marketMiddleage + && !(xmaState.scFastPrev > xmaState.marketMiddleage) + // + // when Short Cycle is Trending Up ... + && xmaState.scFast > xmaState.scSlow + && xmaState.scFastPrev > xmaState.scSlowPrev + // + // When Medium Cycle is Trending Up ... + && xmaState.mcFast > xmaState.mcSlow + && xmaState.mcFastPrev > xmaState.mcSlowPrev + // + // and Medium Cycle TrendPower is Going Up ... + && MathAbs(xmaState.mcFast - xmaState.mcSlow) > + MathAbs(xmaState.mcFastPrev - xmaState.mcSlowPrev) + // + // When Long Cycle is Trending Up ... + && xmaState.lcFast > xmaState.lcSlow + && xmaState.lcFastPrev > xmaState.lcSlowPrev + // + // and Long Cycle TrendPower is Going Up ... + && MathAbs(xmaState.lcFast - xmaState.lcSlow) > + MathAbs(xmaState.lcFastPrev - xmaState.lcSlowPrev) + // + // Short Cycle Slow bigger thhan Medium Cycle Fast ... + && xmaState.scSlow > xmaState.mcFast + // + // OSC ... + // Check OSC Fast and Slow is Less than 0.5 ... + && oscState.fastOSC < 0.5 + && oscState.slowOSC < 0.5 + // + // Check OSC Minimum Signal Power ... + // this Helps for Detect Market exits from Ranging ... + && minPowOSC > 0 + ? + // + // Check Conditions only if value provided ... + oscState.powerOSCPrev < 0 + && MathAbs(oscState.powerOSCPrev) > minPowOSC + : + // + // ... other wise, ignore ... + true + // + // Check Previous Candle Signal Power must be Lower than + // Current Signal Power and the Direction Must be Up Trend ... + && oscState.powerOSCPrev < oscState.powerOSC + // + // Also we Have to Check Market not ranging ... + && !IsOSCMarketRanging( + bar_index + 1, + marketLen, + minPowOSC, + fastOSCLen, + fastOSCMul, + slowOSCLen, + slowOSCMul + ) + // + // XADX ... + // TODO: add XADX Base Conditions for Long Trades ... + // + // PRICE Checking ... + // price must be less than Candle High at openning time ... + && longEntryPrice <= candleHigh + // + // also Candle High and Low must be above than lc Fast & lc Slow ... + && longEntryPrice > xmaState.lcFast + && longEntryPrice > xmaState.lcSlow + ; + + // + // Has Some Good Points ... + // double oscTreshold = 0.5; + bool oscHasLongSignal = + false + // // + // // OSC ... + // oscState.isOSCCrossOver + // // + // // XMA ... + // // + // // + // // PRICE ... + // && longEntryPrice <= candleHigh + ; + + // + hasLongSignal = + xmaHasLongSignal || oscHasLongSignal; + // + // END LONG Signals ... + // + + // + // START SHORT Signals ... + // + bool hasShortSignal = false; + + // + // Recieve Signals Based on XOSC ... + // hasShortSignal = + // oscState.hasShortSignal + // ; + // + // END SHORT Signals ... + // + + // + // Check Signal Exists regardless of Long or Short ... + bool hasSignal = hasLongSignal || hasShortSignal; + + // + // Prevent from Going forward if there is not a Signal ... + if (!hasSignal) { + // + result.signal = signal; + return result; + } + + // + totalSignals++; + + // + // Define Price Related Variables ... + // + double price = 0; + double priceGap; + double sl = 0; + double risk; + double reward; + double tp = 0; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Fill Signal Related Variables ... + if (hasLongSignal) { + // + totalLongSignals++; + + // + price = longEntryPrice; + priceGap = longPriceGap; + + // // + // // Setting Up SL Based on Prev Candle ... + // sl = prevCandleLow; + + // + // Setting Up SL Based on Last Market Lowest ... + sl = GetMarketLowestLow( + bar_index, + marketLen + ); + + // // + // // Setting Up SL Based on Prev Candle Less Low Price ... + // sl = GetLowLessCandlePrice( + // bar_index, + // price + // ); + + // + risk = price - sl; + reward = risk * r2r; + tp = price + reward; + + // + // Check TP for prevent from 5 Pips ... + // double pipsPrice = PipsToPrice(2); + // if (tp > price + pipsPrice) { + // tp = price + pipsPrice; + // } + + // + // Check TP based on Spread ... + if (tp < price + priceGap) { + tp = tp + priceGap; + } + } else if (hasShortSignal) { + // + totalShortSignals++; + + // + price = shortEntryPrice; + priceGap = shortPriceGap; + + // // + // // Setting Up SL Based On Prev Candle ... + // sl = prevCandleHigh; + + // // + // // Setting Up SL Based on Last Market Highest ... + // sl = GetMarketHighestHigh( + // bar_index, + // marketLen + // ); + + // + // Setting Up SL Based on Prev Candle Great High Price ... + sl = GetHighGreatCandlePrice( + bar_index, + price + ); + + // + risk = sl - price; + reward = risk * r2r; + tp = price - reward; + } + + // + // Normalize Prices ... + price = NormalizeDouble(price, _Digits); + sl = NormalizeDouble(sl, _Digits); + tp = NormalizeDouble(tp, _Digits); + + // + // Generate Signal Structure ... + signal.type = hasLongSignal ? + X_LONG : + X_SHORT; + signal.tp = tp; + signal.sl = 0; // sl; + signal.time = time; + signal.symbol = _Symbol; + signal.entryPrice = price; + signal.id = totalLongSignals; + // + // END Capturing Signal ... + // + + // + // Fill Result ... + result.hasSignal = hasSignal; + result.signal = signal; + result.type = signal.type; + + // + return result; +} + +// +// START Signal Verification Functions ... +// +// +// END Signal Verification Functions ... +// + +// +// START Market State Functions ... +// +// +// END Market State Functions ... +// + +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +// Generate a Unique ID for Signal ... +string GenerateSignalTAG( + const XSignal &signal, + const string tag, + const string longSignalLabel, + const string shortSignalLabel +) { + // + // Generate Propper Label for Signal ... + string label = signal.type == X_LONG ? longSignalLabel : signal.type == X_SHORT ? shortSignalLabel : "UN_KNOWN"; + + // + // Generate Unique String Identifier for Signal ... + string result = tag + + "_[ID:" + IntegerToString(signal.id) + "]" + + "_[" + label + "]" + + "_[" + signal.symbol + "]" + + "_[Time:" + TimeToStr(signal.time) + "]" + + "_[TP:" + DoubleToString(signal.tp) + "]" + + "_[SL:" + DoubleToString(signal.sl) + "]"; + + // + return result; +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string signalTag = "X-Signal", + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signalTag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor, + STYLE_SOLID, + 3, + false, + false, + false, + 0 + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signalTag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signalTag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signalTag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entryPrice, + signal.time, + signal.entryPrice, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signalTag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 10, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + string prefix, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_LONG && + signal.type != X_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entryPrice > signal.tp + ) || + ( + !hasLongSignal + && signal.entryPrice < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + prefix, + "_", signal.id, "_", + label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entryPrice, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + // Here i must to Draw Signal Shapes ... + DrawSignal( + signal, + 0, + 0, + 50, + prefix, // Signal Tag ... + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.entryPrice = openPrice; + result.type = isLongOrder ? X_LONG : X_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit > 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex - currentBarIndex >= passedCandles) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + if ( + profit < 0 + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// +// +// END Orders Functions ... +// diff --git a/Bkp/Used/Parabolic SAR EA/parabolic.sar.ea.mq4 b/Bkp/Used/Parabolic SAR EA/parabolic.sar.ea.mq4 new file mode 100644 index 0000000..d83efa2 --- /dev/null +++ b/Bkp/Used/Parabolic SAR EA/parabolic.sar.ea.mq4 @@ -0,0 +1,117 @@ +void OnTick() +{ + + string signal = ""; + double Sar = iSAR(_Symbol, _Period, 0.02, 0.2, 0); + + if (Sar < Low[1] && Open[1] < Close[1]) + { + signal = "buy"; + } + + if (Sar > High[1] && Open[1] > Close[1]) + { + signal = "sell"; + } + + if (signal == "buy" && OrdersTotal() == 0) + + OrderSend(_Symbol, OP_BUY, 0.01, Ask, 3, 20, 100, NULL, 0, 0, Green); + + if (signal == "sell" && OrdersTotal() == 0) + + OrderSend(_Symbol, OP_SELL, 0.01, Bid, 3, 20, 100, NULL, 0, 0, Red); + + Comment("The Signal is :", signal); + + if (Open[1] > Close[1] && OrdersTotal() > 0) + + CloseBuyPosition(); + + if (Open[1] < Close[1] && OrdersTotal() > 0) + + CloseSellPosition(); +} + + +void OnTick() +{ + /* string signal = ""; + double Sar = iSAR( _Symbol, _Period, 0.02, 0.2, 0 ); + + if ( Sar < Low[1] && Open[1] < Close[1] ) signal = "buy"; + if ( Sar > High[1] && Open[1] > Close[1] ) signal = "sell"; + + if ( signal == "buy" && OrdersTotal() == 0 ) OrderSend( _Symbol, OP_BUY, 0.01, Ask, 3, 20, 100, NULL, 0, 0, Green ); + if ( signal == "sell" && OrdersTotal() == 0 ) OrderSend( _Symbol, OP_SELL, 0.01, Bid, 3, 20, 100, NULL, 0, 0, Red ); + + Comment( "The Signal is :", signal ); + + if ( Open[1] > Close[1] && OrdersTotal() > 0 ) CloseBuyPosition(); + if ( Open[1] < Close[1] && OrdersTotal() > 0 ) CloseSellPosition(); + */ + + static int count_of_NOPs = 0; + if ( OrdersTotal() == 0 ) + { if ( Open[1] < Close[1] + && Low[1] > iSAR( _Symbol, _Period, 0.02, 0.2, 0 ) + ) { + int rc = OrderSend( _Symbol, OP_BUY, 0.01, Ask, 3, 20, 100, NULL, 0, 0, Green ); + Print( StringFormat( "HAVING NO ORDERS ACTIVE... DID TRY OrderSend( OP_BUY ) -> RESULTING RetCode ( tkt# ) == %d [yield GetLastError() == %d]", + rc, + GetLastError() + ) + ); + count_of_NOPs = 0; //------------------------------ .RESET + return; //------------------------------------------^ J.I.T./RET + } + if ( Open[1] > Close[1] + && High[1] < iSAR( _Symbol, _Period, 0.02, 0.2, 0 ) + ) { + int rc = OrderSend( _Symbol, OP_SELL, 0.01, Bid, 3, 20, 100, NULL, 0, 0, Red ); + Print( StringFormat( "HAVING NO ORDERS ACTIVE... DID TRY OrderSend( OP_SELL ) -> RESULTING RetCode ( tkt# ) == %d [yield GetLastError() == %d]", + rc, + GetLastError() + ) + ); + if ( ) + count_of_NOPs = 0; //------------------------------ .RESET + return; //------------------------------------------^ J.I.T./RET + } + + /* OTHERWISE: */ + Print( StringFormat( "HAVING NO ORDERS ACTIVE... DID NOP... (for %d time)", + ++count_of_NOPs + ) + ); + // */ + } + else + { if ( Open[1] > Close[1] ) { Print( StringFormat( "HAVING %d ORDERS ACTIVE... WILL TRY CloseBuyPosition()...", + OrdersTotal() + ) + ); + CloseBuyPosition(); + count_of_NOPs = 0; //---------- .RESET + return; //----------------------^ J.I.T./RET + } + if ( Open[1] < Close[1] ) { Print( StringFormat( "HAVING %d ORDERS ACTIVE... WILL TRY CloseSellPosition()...", + OrdersTotal() + ) + ); + CloseSellPosition(); + count_of_NOPs = 0; //---------- .RESET + return; //----------------------^ J.I.T./RET + } + + /* OTHERWISE: */ + Print( StringFormat( "HAVING %d ORDERS ACTIVE... DID NOP... (for %d time)", + OrdersTotal(), + ++count_of_NOPs + ) + ); + // */ + } + + + \ No newline at end of file diff --git a/Bkp/Used/x-saherelm.xTEMP.signal.lib.mq4 b/Bkp/Used/x-saherelm.xTEMP.signal.lib.mq4 new file mode 100644 index 0000000..96cbb5b --- /dev/null +++ b/Bkp/Used/x-saherelm.xTEMP.signal.lib.mq4 @@ -0,0 +1,720 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XTPW Signal Global Library +// --------------------------------------------------- +// XSaherElm EA Signal Provider based on +// XTPow Indicator... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xTPWStarter = "- XTPW Signal Provider -"; // ---> XTPW Signal Provider <--- + +// +input bool enableXTPWSignalling = true; // XTPW Signalling Enable + +// +input double xTPWR2R = 2.5; // XTPW Risk To Reward Ratio +input int xTPWMaximumCandlesPerTrade = 206; // XTPW Maximum Candles which a Trade can open + +// +input double xTPWPSarStep = 0.02; // XTPW Parabolic Sar Step +input double xTPWPSarMaximum = 0.2; // XTPW Parabolic Sar Maximum + +// +input int xTPWSwingLength = 7; // XTPW Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// XTPW Based Signal Conditions ... +struct XTPWSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XTPWMarketState { + double psar; + double fast; + double slow; + double verifier; +}; + +// +static XTPWSignalConditions xTPWLongConds; +static bool xTPWCloseLongTrades = false; +static bool xTPWWaitForLongSignals = true; + +// +static XTPWSignalConditions xTPWShortConds; +static bool xTPWCloseShortTrades = false; +static bool xTPWWaitForShortSignals = true; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXTPWSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if (!enableXTPWSignalling) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXTPWLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWSignalling + || !xTPWWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool startCondition = false; + bool signalCondition = false; + + // + if ( + startCondition + && xTPWLongConds.startTime == 0 + ) { + // + xTPWLongConds.startTime = barTime; + return; + } + + // + if ( + signalCondition + && xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime == 0 + ) { + // + xTPWLongConds.signalTime = barTime; + xTPWLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool startCondition = false; + bool signalCondition = false; + + // + if ( + startCondition + && xTPWShortConds.startTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + return; + } + + // + if ( + signalCondition + && xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime == 0 + ) { + // + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXTPWSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if (!enableXTPWSignalling) { + return result; + } + + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXTPWLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXTPWShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xTPWSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xTPWSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice); + + // + double reward = risk * xTPWR2R; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWLongConditions() { + // + if (!enableXTPWSignalling) { + return false; + } + + // + bool isConditionsFilled = + xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime > 0 + && xTPWLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xTPWLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xTPWLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xTPWLongConds.entryTime + ); + + // + isBLFilled = + // + xTPWLongConds.signalTime > xTPWLongConds.startTime + && xTPWLongConds.entryTime >= xTPWLongConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWShortConditions() { + // + if (!enableXTPWSignalling) { + return false; + } + + // + bool isConditionsFilled = + xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime > 0 + && xTPWShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xTPWShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xTPWShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xTPWShortConds.entryTime + ); + + // + isBLFilled = + // + xTPWShortConds.signalTime > xTPWShortConds.startTime + && xTPWShortConds.entryTime >= xTPWShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXTPWLongSignalConditions() { + // + xTPWLongConds.startTime = 0; + xTPWLongConds.entryTime = 0; + xTPWLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXTPWShortSignalConditions() { + // + xTPWShortConds.startTime = 0; + xTPWShortConds.entryTime = 0; + xTPWShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXTPWSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if (!enableXTPWSignalling) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrive XMarket States ... + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xTPWSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xTPWSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (600 * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + ; + + // + isPSarVerified = + // + // Starter ... + true + ; + + // + isStateVerified = + // + // Start ... + true + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + // + // Starter ... + true + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + ; + + // + isStateVerified = + // + // Start ... + true + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XTPWMarketState GetXMTPWarketState( + const int bar_index +) { + // + XTPWMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xTPWSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double slow = GetMA( + bar_index, + xTPWSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xTPWPSarStep, + xTPWPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.slow = slow; + result.verifier = verifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/XAUUSD-15M/Experts/x-saherelm.ea.mq4 b/Bkp/XAUUSD-15M/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..d8a63ca --- /dev/null +++ b/Bkp/XAUUSD-15M/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,1038 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_EA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 7; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Alerts ... +input bool alertEvents = true; // Alert Events +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + maxOpenTrades <= 0 + || maxEquityPercent < 0 + || minBalancePercent < 0 + || lotsPerTradePercent < 0 + || maxDrawdownPercentPerPTrade < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if (isNewDay) { + // + LogMessage( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + static bool tradingPauseAlerted; + + // + allowDoTrade = false; + + // + if (!tradingPauseAlerted) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + + // + tradingPauseAlerted = true; + } + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + // Retrieve Signal Lots Per Trade ... + double lPTradePercent = GetSignalLottage( + request.signal, + lotsPerTradePercent + ); + + // + bool isPositionOpened = TradeSignal( + request.signal, + lPTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", ProvidedBy: ", GetSignalProviderIdentifier(request.signal.provider), + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // XSignalling ... + if (enableXSignalling) { + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + if (xCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XXX_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XXX_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xMaximumCandlesPerTrade, + X_XXX_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xFailedSignals++; + } + } + + // + // XR Signalling ... + if (enableXRSignalling) { + // + if (xRCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xRCloseLongTrades = false; + } + + // + if (xRCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XR_PROVIDER); + + // + xRCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XR_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XR_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xRMaximumCandlesPerTrade, + X_XR_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xRFailedSignals++; + } + } + + // + // XTPW Signalling ... + if (enableXTPWSignalling) { + // + if (xTPWCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XTPW_PROVIDER); + + // + xTPWCloseLongTrades = false; + } + + // + if (xTPWCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xTPWCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XTPW_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XTPW_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xTPWMaximumCandlesPerTrade, + X_XTPW_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xTPWFailedSignals++; + } + } + + // + // Close Maximum DrawDown Passed Trades ... + // this is the Maximum Controller ... + // + double maxOfXPercent = enableXSignalling ? + MathMax( + xLongMaxDrawdownPerTradePercent, + xShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXRPercent = enableXRSignalling ? + MathMax( + xRLongMaxDrawdownPerTradePercent, + xRShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXTPWPercent = enableXTPWSignalling ? + MathMax( + xTPWLongMaxDrawdownPerTradePercent, + xTPWShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxDrawDownPercent = MathMax( + maxOfXPercent, + maxOfXRPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxOfXTPWPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxDrawdownPercentPerPTrade + ); + + // + // we Calculate Max DrawDown Percent Per Trade ... + // then try to Close based on them ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawDownPercent + ); +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if (!alertEvents) { + return; + } + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Define Template Signal Requests for Managing Multiple Signals ... + // + // X ... + XSignalRequest xLongSignalRequest = {}; + XSignalRequest xShortSignalRequest = {}; + // + // XR ... + XSignalRequest xrLongSignalRequest = {}; + XSignalRequest xrShortSignalRequest = {}; + // + // XTPW ... + XSignalRequest xTPWLongSignalRequest = {}; + XSignalRequest xTPWShortSignalRequest = {}; + + // + // START XR Signal Handler ... + // + // + if (enableXRSignalling) { + // + CheckXRSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xRWaitForLongSignals) { + // + CheckXRLongSignalConditions( + bar_index + ); + + // + xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xRWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + } else { + ClearXRLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xRWaitForShortSignals) { + // + CheckXRShortSignalConditions( + bar_index + ); + + // + xrShortSignalRequest = GenerateXRSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xrShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrShortSignalRequest.signal + ); + + // + if (isReady && xRWaitForShortSignals) { + // + hasShortSignal = true; + signal = xrShortSignalRequest.signal; + } else { + ClearXRShortSignalConditions(); + } + } + } else { + ClearXRShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + // START XTPW Signal Handler ... + // + if (enableXTPWSignalling) { + // + CheckXTPWSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xTPWWaitForLongSignals) { + // + CheckXTPWLongSignalConditions( + bar_index + ); + + // + xTPWLongSignalRequest = GenerateXTPWSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xTPWLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWLongSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForLongSignals) { + // + hasLongSignal = true; + signal = xTPWLongSignalRequest.signal; + } else { + ClearXTPWLongSignalConditions(); + } + } + } else { + ClearXTPWLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xTPWWaitForShortSignals) { + // + CheckXTPWShortSignalConditions( + bar_index + ); + + // + xTPWShortSignalRequest = GenerateXTPWSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xTPWShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWShortSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForShortSignals) { + // + hasShortSignal = true; + signal = xTPWShortSignalRequest.signal; + } else { + ClearXTPWShortSignalConditions(); + } + } + } else { + ClearXTPWShortSignalConditions(); + } + } + } + // + // END XTPW Signal Handler ... + // + + // + // START X Signal Handler ... + // + // + if (enableXSignalling) { + // + CheckXSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xWaitForLongSignals) { + // + CheckXLongSignalConditions( + bar_index + ); + + // + xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } + } else { + ClearXLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xWaitForShortSignals) { + // + CheckXShortSignalConditions( + bar_index + ); + + // + xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal + ); + + // + if (isReady && xWaitForShortSignals) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + } else { + ClearXShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Bkp/XAUUSD-15M/Indicators/x-saherelm.ma.mq4 b/Bkp/XAUUSD-15M/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Bkp/XAUUSD-15M/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Indicators/x-saherelm.xrange.mq4 b/Bkp/XAUUSD-15M/Indicators/x-saherelm.xrange.mq4 new file mode 100644 index 0000000..1359f57 --- /dev/null +++ b/Bkp/XAUUSD-15M/Indicators/x-saherelm.xrange.mq4 @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XRange Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XRange Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 14; +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_plots 3 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Middle Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +#define highestHighBufferIndex 0 +#define lowestLowBufferIndex 1 +#define middleBufferIndex 2 + +// +double highestHighBuffer[]; +double lowestLowBuffer[]; +double middleBuffer[]; + +// +datetime startTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + string hhLbl = StringConcatenate( + "XR HH(", marketLength, ")" + ); + SetIndexBuffer(highestHighBufferIndex, highestHighBuffer); + SetIndexLabel(highestHighBufferIndex, hhLbl); + + // + string llLbl = StringConcatenate( + "XR LL(", marketLength, ")" + ); + SetIndexBuffer(lowestLowBufferIndex, lowestLowBuffer); + SetIndexLabel(lowestLowBufferIndex, llLbl); + + // + string midLbl = StringConcatenate( + "XR Mid(", marketLength, ")" + ); + SetIndexBuffer(middleBufferIndex, middleBuffer); + SetIndexLabel(middleBufferIndex, midLbl); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculations ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculations ... +void CalculateBuffers( + const int &bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + SetIndicatorBuffersNone(bar_index); + return; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + int startDistance = startBarIndex - bar_index; + if (startDistance < marketLength) { + // + SetIndicatorBuffersNone(bar_index); + return; + } + + // + // Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + bar_index + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + highestHighBuffer[bar_index] = hh; + + // + // Lowest Low ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + bar_index + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + lowestLowBuffer[bar_index] = ll; + + // + // Middle Buffer ... + double mid = (hh + ll) / 2; + middleBuffer[bar_index] = mid; + + // + // Reset Start Time ... + startTime = 0; +} + +// +void SetIndicatorBuffersNone( + const int bar_index +) { + // + int lastBarIndex = bar_index + 1; + + // + double lastHighestHigh; + double lastLowestLow; + + // + // Highest High ... + if (ArraySize(highestHighBuffer) > lastBarIndex) { + lastHighestHigh = highestHighBuffer[lastBarIndex]; + } else { + lastHighestHigh = 0; + } + + // + // Lowest Low ... + if (ArraySize(lowestLowBuffer) > lastBarIndex) { + lastLowestLow = lowestLowBuffer[lastBarIndex]; + } else { + lastLowestLow = 0; + } + + // + highestHighBuffer[bar_index] = lastHighestHigh; + lowestLowBuffer[bar_index] = lastLowestLow; + + // + double mid = (lastHighestHigh + lastLowestLow) / 2; + middleBuffer[bar_index] = mid; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Indicators/x-saherelm.xtpow.mq4 b/Bkp/XAUUSD-15M/Indicators/x-saherelm.xtpow.mq4 new file mode 100644 index 0000000..46ff59e --- /dev/null +++ b/Bkp/XAUUSD-15M/Indicators/x-saherelm.xtpow.mq4 @@ -0,0 +1,275 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 20.0); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + SetLevelValue(3, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,3,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + int doubleMarketLength = (marketLength * 2); + double ema = GetMA( + bar_index, + doubleMarketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double emaRate = GetMarketHighestHigh(bar_index, doubleMarketLength) - GetMarketLowestLow(bar_index, doubleMarketLength) / 100; + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.draw.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..776cde4 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,2010 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Draw Highest High ... +bool DrawHighestHigh( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrAqua, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_HH(", marketLen ,")_", + hh, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + hhTime, + hh, + drawUntilTime, + hh, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Lowest Low ... +bool DrawLowestLow( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrFuchsia, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_LL(", marketLen ,")_", + ll, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + llTime, + ll, + drawUntilTime, + ll, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Market Middle ... +bool DrawMarketMiddle( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrYellow, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + double middle = ll + ((hh - ll) / 2); + datetime middleTime = hhIdx < llIdx + ? hhTime + : llTime + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_MID(", marketLen ,")_", + middle, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + middleTime, + middle, + drawUntilTime, + middle, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..0e4b162 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,450 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Reading specified Buffer From ADX Indicator ... +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading specified Buffer from XHL Indicator ... +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading ADX Values ... +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +// Reading Pivot States ... +XPvtState GetPVTState( + const int bar_index, + const int marketLen +) { + // + XPvtState result = {}; + + // + double hh = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double ho = GetMarketHighestOpen( + bar_index, + marketLen + ); + + // + double hc = GetMarketHighestClose( + bar_index, + marketLen + ); + + // + double hl = GetMarketHighestLow( + bar_index, + marketLen + ); + + // + double ll = GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double lo = GetMarketLowestOpen( + bar_index, + marketLen + ); + + // + double lc = GetMarketLowestClose( + bar_index, + marketLen + ); + + // + double lh = GetMarketLowestHigh( + bar_index, + marketLen + ); + + // + // Filling Result ... + // + result.hh = hh; + result.ho = ho; + result.hc = hc; + result.hl = hl; + + // + result.ll = ll; + result.lo = lo; + result.lc = lc; + result.lh = lh; + + // + return result; +} + +// +// Calculate XRange from Market ... +static XRState lastXRState; +XRState GetXRange( + const int bar_index, + const int rangeMarketLength +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + rangeMarketLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= rangeMarketLength) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +// Reading XTPowState from Indicatoe ... +XTPOWState GetXTPowState( + const int bar_index, + const int marketLen +) { + // + XTPOWState result = {}; + + // + // + double powerUp = 0; + double powerDown = 0; + double signal = 0; + + // + string indicatorName = "x-saherelm.xtpow"; + + // + int pUpIndex = 0; + int pDownIndex = 1; + int signalIndex = 2; + + // + powerUp = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pUpIndex, + bar_index + ); + + // + powerDown = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pDownIndex, + bar_index + ); + + // + signal = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + signalIndex, + bar_index + ); + + // + result.signal = signal; + result.powerUp = powerUp; + result.powerDown = powerDown; + + // + return result; +} + +// +// Reading XRState From Indicator ... +XRState ReadXRange( + const int bar_index, + const int marketLen +) { + // + XRState result = {}; + + // + // Define Buffer Indexes ... + int hhBufferIndex = 0; + int llBufferIndex = 1; + int midBufferIndex = 2; + + // + string indicatorName = "x-saherelm.xrange"; + + // + // Read Values From XRange Indicator ... + + // + double hh = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + hhBufferIndex, // Buffer Index ... + bar_index + ); + + // + double ll = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + llBufferIndex, // Buffer Index ... + bar_index + ); + + // + double mid = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + midBufferIndex, // Buffer Index ... + bar_index + ); + + // + // Filling Result ... + result.hh = hh; + result.ll = ll; + result.mid = mid; + + // + return result; +} +// +// END Indicator Reading Data ... +// diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..cc0e23e --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1662 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +static datetime lastBarTime; + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +struct XPrice { + // + double askPrice; + double bidPrice; + double priceGap; + + // + double longEntry; + double longExit; + + // + double shortEntry; + double shortExit; +}; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// Retrieve Moving Average ... +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Retrieve Market Current Prices for Signals ... +XPrice GetPrice() { + // + XPrice result = {}; + + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(bidPrice - askPrice); + + // + result.askPrice = askPrice; + result.bidPrice = bidPrice; + result.priceGap = priceGap; + + // + result.longEntry = askPrice; + result.longExit = bidPrice; + + // + result.shortEntry = bidPrice; + result.shortExit = askPrice; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.log.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.models.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..fa9903f --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,154 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER, + X_XTPW_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// Model Market Highs and Lows ... +struct XPvtState { + // + double hh; + double ho; + double hc; + double hl; + + // + double ll; + double lo; + double lc; + double lh; +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +struct XTPOWState { + // + double powerUp; + double powerDown; + + // + double signal; +}; +// +// End Models ... +// diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.signal.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..097ce74 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1756 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" +#include "../Libraries/x-saherelm.xtpw.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetSignalProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + case X_XTPW_PROVIDER: + result = "XTPW"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetSignalProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XTPW_PROVIDER) + ) > -1 + ) { + result = X_XTPW_PROVIDER; + } + + // + return result; +} + +// +// Retrieve Signal Lots Per Trade ... +double GetSignalLottage( + const XSignal &signal, + const double defLotsPerTrade +) { + // + double result = defLotsPerTrade; + + // + bool isLong = signal.type == X_SIGNAL_LONG; + + // + switch (signal.provider) { + // + case X_XR_PROVIDER: + // + result = isLong ? + xRLongLotsPerTradePercent : + xRShortLotsPerTradePercent + ; + break; + + // + case X_XXX_PROVIDER: + // + result = isLong ? + xLongLotsPerTradePercent : + xShortLotsPerTradePercent + ; + break; + + // + case X_XTPW_PROVIDER: + // + result = isLong ? + xTPWLongLotsPerTradePercent : + xTPWShortLotsPerTradePercent + ; + break; + } + + // + return result; +} + +// +// Draw Specific Range On Chart ... +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetSignalProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetSignalProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetSignalProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetSignalProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_LONG + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderShortTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_SHORT + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isProviderVerified + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade, + const ENUM_X_SIGNAL_TYPE type = X_SIGNAL_NONE, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + string comment = OrderComment(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + bool isTypeVerified = + type == X_SIGNAL_NONE ? + true : + ( isLongOrder + && type == X_SIGNAL_LONG + ) || ( + !isLongOrder + && type == X_SIGNAL_SHORT + ) + ; + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isTypeVerified + && isProviderVerified + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + ( + openPrice < signal.entry + || MathAbs(openPrice - signal.entry) < 300 * _Point + ) + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); + ClearXTPWLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { + // + ClearXShortSignalConditions(); + ClearXRShortSignalConditions(); + ClearXTPWShortSignalConditions(); +} +// +// END Signal Conditions ... +// diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..834ddb1 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,1063 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xStarter = "- X Signal Provider -"; // ---> X Signal Provider <--- + +// +input bool enableXSignalling = true; // X Signalling Enable + +// +input bool enableXLong = true; // X Signalling Enable Long +input bool enableXShort = true; // X Signalling Enable Short + +// +input double xShortR2R = 3; // X Short Risk To Reward Ratio +input double xShortLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xShortMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Short Trade + +// +input double xLongR2R = 3; // X Long Risk To Reward Ratio +input double xLongLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xLongMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Long Trade + +// +input double xSharpDetectorFactor = 700; // X Sharp Detection Factor + +// +input int xMaximumCandlesPerTrade = 206; // X Maximum Candles which a Trade can open + +// +input int xOscillatorLength = 7; // X Oscillator Length + +// +input double xPSarStep = 0.02; // X Parabolic Sar Step +input double xPSarMaximum = 0.2; // X Parabolic Sar Maximum + +// +input int xRangeMarketLength = 5; // X Range Detector Length + +// +input int xSwingLength = 7; // X Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XMarketState { + double psar; + double fast; + double slow; + double open; + double verifier; + double oscillator; + double oscillatorVerifier; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; + +// +static XSignalConditions xShortConds; +static bool xCloseShortTrades = false; +static bool xWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xFailedSignals = 0; + +// +datetime lastVerifierTouched; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); + XTPOWState tPowState = GetXTPowState( + bar_index + 1, + xSwingLength + ); + + // + XMarketState state = GetXMarketState( + bar_index + 1 + ); + + // + // Check Verifier Last Touched ... + bool isVerifierTouched = pCandle.high > state.verifier + && pCandle.low < state.verifier; + + // + // Disable Signals if a signal Failed ... + if (xFailedSignals) { + // + // TODO: Complete this ... + } + + // + // Enable Or Disable Signalling ... + if (isVerifierTouched) { + // + lastVerifierTouched = barTime; + + // + if (xWaitForLongSignals) { + xWaitForLongSignals = false; + } + + // + if (xWaitForShortSignals) { + xWaitForShortSignals = false; + } + } else { + // + int lastVerifierTouchedBarIndex = iBarShift( + _Symbol, + _Period, + lastVerifierTouched + ); + + // + int distance = MathAbs(lastVerifierTouchedBarIndex - bar_index); + + // + if ( + !xWaitForLongSignals + && distance > (xSwingLength * 2) + ) { + xWaitForLongSignals = true; + } + + // + if ( + !xWaitForShortSignals + && ( + distance > (xSwingLength * 2) + || ( + tPowState.powerDown > tPowState.powerUp + && tPowState.powerDown < 49 + ) + ) + ) { + xWaitForShortSignals = true; + } + } + + // + // Close All Long Open Trades ... + if ( + tPowState.powerDown > 55 + && tPowState.powerDown > tPowState.powerUp + ) { + // xCloseLongTrades = true; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXLong + || !enableXSignalling + || !xWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXShort + || !enableXSignalling + || !xWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + xShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double reward = + requestLong ? + risk * xLongR2R : + risk * xShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + XRState range = GetXRange( + bar_index, + xRangeMarketLength + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + if ( + !enableXLong + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.entryTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + // && MathAbs(signalBarIndex - startBarIndex) >= 1 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXShortConditions() { + // + if ( + !enableXShort + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.entryTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.entryTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.entryTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve Range ... + XRState range = GetXRange( + signalBarIndex, + xRangeMarketLength + ); + + // + // Retrive XMarket States ... + XMarketState xState0 = GetXMarketState(signalBarIndex); + XMarketState xState1 = GetXMarketState(signalBarIndex + 1); + XMarketState xState2 = GetXMarketState(signalBarIndex + 2); + XMarketState xStateLast = GetXMarketState(signalBarIndex + xSwingLength); + + // + // Retrieve Trend Powers ... + XTPOWState xTPow0 = GetXTPowState( + signalBarIndex, + xSwingLength + ); + XTPOWState xTPow1 = GetXTPowState( + signalBarIndex + 1, + xSwingLength + ); + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (xSharpDetectorFactor * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry < hh + // + // && signal.entry < range.hh + // && signal.entry > range.mid + // // + // && candle.high > xState0.verifier + // && signal.entry > xState0.verifier + // + // && pCandle.low != ll + && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp < iTPowState.powerDown + || iTPowState.signal > MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers > 1 + && tPowUnverifyConditions == 0 + ; + + // + isPSarVerified = + xState0.psar < signal.entry + && xState0.psar < candle.low; + + // + isStateVerified = + // + // Start ... + true + // + // && xState0.open < xState0.slow + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + xState0.psar > signal.entry + && xState0.psar > candle.high + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry > ll + && pCandle.low != ll + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp > iTPowState.powerDown + || iTPowState.signal < MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers < 1 + && tPowUnverifyConditions == 0 + && MathAbs(xTPow0.powerUp - xTPow0.powerDown) > 50 * _Point + ; + + // + isStateVerified = + // + // Start ... + true + // + // && (xStateLast.verifier - xState0.verifier) >= 0 + // + && xState0.verifier > signal.entry + // + && MathAbs(signal.entry - xState0.verifier) < (xSharpDetectorFactor * _Point) + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XMarketState GetXMarketState( + const int bar_index +) { + // + XMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double slow = GetMA( + bar_index, + xSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double oscillator = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + double oscillatorVerifier = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xPSarStep, + xPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.open = open; + result.slow = slow; + result.verifier = verifier; + result.oscillator = oscillator; + result.oscillatorVerifier = oscillatorVerifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..d4ae238 --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,1142 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = true; // XR Signalling Enable + +// +input bool enableXRLong = true; // XR Signalling Enable Long +input bool enableXRShort = true; // XR Signalling Enable Short + +// +input double xRShortR2R = 1.5; // XR Short Risk To Reward Ratio +input double xRShortLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRShortMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Short Trade + +// +input double xRLongR2R = 1.5; // XR Long Risk To Reward Ratio +input double xRLongLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRLongMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Long Trade + +// +input int xRMaximumCandlesPerTrade = 96; // XR Maximum Candles which a Trade can open + +// +input int xRSwingLength = 48; // XR Swing Length +// +// END Inputs ... +// + +// +input double xRSharpDetectionFactor = 1350; // XR Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + double open; + + // + double range; + double rangeFast; + double rangeSlow; + double rangeOpen; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +static XRSignalConditions xRLongConds; +static bool xRCloseLongTrades = false; +static bool xRWaitForLongSignals = true; + +// +static XRSignalConditions xRShortConds; +static bool xRCloseShortTrades = false; +static bool xRWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xRFailedSignals = 0; + +// +double xRMaximumDrawDown = 0; + +// +int fastLength = 0; +int slowLength = 0; + +// +int verifierLength = 0; + +// +int rangeFastLength = 0; +int rangeSlowLength = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool longCondition1 = + // + // Starter ... + true + // + && isMarketBullish + // + && + ( + candle2.high < range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.low > range1.mid + ; + + // + if ( + // + ( + longCondition1 + ) + // + && xRLongConds.startTime == 0 + && xRLongConds.entryTime == 0 + && xRLongConds.signalTime == 0 + ) { + // + xRLongConds.startTime = barTime; + xRLongConds.entryTime = barTime; + xRLongConds.signalTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXRShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool shortCondition1 = + // + // Starter ... + true + // + && isMarketBearish + // + && + ( + candle2.low > range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.high < range1.mid + ; + + // + if ( + // + ( + shortCondition1 + ) + // + && xRShortConds.startTime == 0 + && xRShortConds.entryTime == 0 + && xRShortConds.signalTime == 0 + ) { + // + xRShortConds.startTime = barTime; + xRShortConds.entryTime = barTime; + xRShortConds.signalTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXRShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + XPvtState pvts = GetPVTState( + bar_index, + xRSwingLength + ); + XPrice prices = GetPrice(); + + // + double entryPrice = requestLong ? + prices.longEntry : + prices.shortEntry + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - pvts.ll : + pvts.hh - MathMax(openPrice, closePrice); + if (risk <= 0) { + // + risk = requestLong ? + MathAbs(pvts.hh - entryPrice) : + MathAbs(pvts.ll - entryPrice) + ; + } + + // + double reward = + requestLong ? + risk * xRLongR2R : + risk * xRShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + + // + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Long Signal Conditions ... +bool ValidateXRLongConditions() { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRLongConds.startTime > 0 + && xRLongConds.signalTime > 0 + && xRLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRLongConds.signalTime >= xRLongConds.startTime + && xRLongConds.entryTime >= xRLongConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Short Signal Conditions ... +bool ValidateXRShortConditions() { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRShortConds.startTime > 0 + && xRShortConds.signalTime > 0 + && xRShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRShortConds.signalTime >= xRShortConds.startTime + && xRShortConds.entryTime >= xRShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xRLongConds.startTime = 0; + xRLongConds.signalTime = 0; + xRLongConds.entryTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXRShortSignalConditions() { + // + xRShortConds.startTime = 0; + xRShortConds.signalTime = 0; + xRShortConds.entryTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + // Find Signal Bar Index ... + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + signalBarIndex, + xRSwingLength + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + XOHCL candle2 = GetCandleModel(signalBarIndex + 2); + XOHCL candle3 = GetCandleModel(signalBarIndex + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(signalBarIndex); + XRMarketState state1 = GetXRMarketState(signalBarIndex + 1); + XRMarketState state2 = GetXRMarketState(signalBarIndex + 2); + XRMarketState state3 = GetXRMarketState(signalBarIndex + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + signalBarIndex + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + signalBarIndex + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + signalBarIndex + xRSwingLength + 2, + xRSwingLength + ); + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + signalBarIndex + 2, + xRSwingLength + ); + + // + double hhllDiff = MathAbs(pvt0.hh - pvt0.ll); + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + bool isSharpOccured = hhllDiff > sharpDetectionValue; + + // + // Calculate State Min Max Diff ... + // + double state0Min = MathMin(state0.fast, state0.slow); + state0Min = MathMin(state0Min, state0.open); + state0Min = MathMin(state0Min, state0.rangeFast); + state0Min = MathMin(state0Min, state0.rangeSlow); + state0Min = MathMin(state0Min, state0.rangeOpen); + state0Min = MathMin(state0Min, state0.verifier); + + // + double state0Max = MathMax(state0.fast, state0.slow); + state0Max = MathMax(state0Max, state0.open); + state0Max = MathMax(state0Max, state0.rangeFast); + state0Max = MathMax(state0Max, state0.rangeSlow); + state0Max = MathMax(state0Max, state0.rangeOpen); + state0Max = MathMax(state0Max, state0.verifier); + + // + double state0MinMaxDiff = (state0Max - state0Min); + + // + bool isTPowValid = false; + bool isStateValid = false; + bool isRangeValid = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + // + // && !(state0MinMaxDiff > sharpDetectionValue) + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Calculate Market Lengths ... + + // + if (fastLength == 0) { + fastLength = xRSwingLength; + } + + // + if (slowLength == 0) { + slowLength = xRSwingLength * 2; + } + + // + if (verifierLength == 0) { + verifierLength = (GetDailyCandleCount() * 2); + } + + // + if (rangeFastLength == 0) { + rangeFastLength = (int)(verifierLength / 2); + } + + // + if (rangeSlowLength == 0) { + rangeSlowLength = verifierLength; + } + + // + // Reading Values ... + + // + double fast = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double slow = GetMA( + bar_index, + slowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double rangeFast = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeSlow = GetMA( + bar_index, + rangeSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeOpen = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double verifier = GetMA( + bar_index, + verifierLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + // Filling Result ... + result.fast = fast; + result.slow = slow; + result.open = open; + result.verifier = verifier; + result.rangeFast = rangeFast; + result.rangeSlow = rangeSlow; + result.rangeOpen = rangeOpen; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Bkp/XAUUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 b/Bkp/XAUUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 new file mode 100644 index 0000000..4bf02ce --- /dev/null +++ b/Bkp/XAUUSD-15M/Libraries/x-saherelm.xtpw.signal.lib.mq4 @@ -0,0 +1,1332 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XTPW Signal Global Library +// --------------------------------------------------- +// XSaherElm EA Signal Provider based on +// XTPow Indicator... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xTPWStarter = "- XTPW Signal Provider -"; // ---> XTPW Signal Provider <--- + +// +input bool enableXTPWSignalling = true; // XTPW Signalling Enable + +// +input bool enableXTPWLong = true; // XTPW Signalling Enable Long +input bool enableXTPWShort = true; // XTPW Signalling Enable Short + +// +input double xTPWShortR2R = 2; // XTPW Short Risk To Reward Ratio +input double xTPWShortLotsPerTradePercent = 0.0002; // XTPW Lots Percent per Short Trades +input double xTPWShortMaxDrawdownPerTradePercent = 0.3; // XTPW Max Allowed DrawDown Percent per Short Trade + +// +input double xTPWLongR2R = 2; // XTPW Long Risk To Reward Ratio +input double xTPWLongLotsPerTradePercent = 0.0002; // XTPW Lots Percent per Short Trades +input double xTPWLongMaxDrawdownPerTradePercent = 0.3; // XTPW Max Allowed DrawDown Percent per Long Trade + +// +input int xTPWMaximumCandlesPerTrade = 206; // XTPW Maximum Candles which a Trade can open + +// +input double xTPWPSarStep = 0.02; // XTPW Parabolic Sar Step +input double xTPWPSarMaximum = 0.2; // XTPW Parabolic Sar Maximum + +// +input int xTPWSwingLength = 7; // XTPW Signal Swing Length +// +// END Inputs ... +// + +// +input double xTPWSharpDetectionFactor = 650; // XTPW Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XTPW Based Signal Conditions ... +struct XTPWSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XTPWMarketState { + // + double psar; + + // + double scFast; + double scSlow; + double scWeight; + + // + double mcFast; + double mcSlow; + double mcWeight; + + // + double lcFast; + double lcSlow; + double lcWeight; +}; + +// +struct XLHS { + // + double scHH; + double scLL; + + // + double mcHH; + double mcLL; + + // + double lcHH; + double lcLL; +}; + +// +static XTPWSignalConditions xTPWLongConds; +static bool xTPWCloseLongTrades = false; +static bool xTPWWaitForLongSignals = true; + +// +static XTPWSignalConditions xTPWShortConds; +static bool xTPWCloseShortTrades = false; +static bool xTPWWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xTPWFailedSignals = 0; + +// +double tPowerVerifier = 20; +double tPowerMaxVerifier = 55; + +// +int scFastLength = 0; +int scSlowLength = 0; + +// +int mcFastLength = 0; +int mcSlowLength = 0; + +// +int lcFastLength = 0; +int lcSlowLength = 0; + +// +datetime lastTurnOffLongTradesTime; +datetime lastTurnOffShortTradesTime; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXTPWSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 1); + + // + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // // + // // Disable Long Conditions ... + // if ( + // xTPWWaitForLongSignals + // && + // ( + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperAboveMaxVerifier + // ) + // ) { + // // + // xTPWWaitForLongSignals = false; + // lastTurnOffLongTradesTime = barTime; + // } + + // // + // // Enable Long Conditions ... + // if ( + // !xTPWWaitForLongSignals + // && lastTurnOffLongTradesTime > 0 + // && ( + // // isFastCrossOverSlow + // // || + // // isFastCrossUnderSlow + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperBelowMaxVerifier + // ) + // ) { + // // + // // Find Last Turn Off Bar Index ... + // int lastTurnOffLongTradesBarIndex = iBarShift( + // _Symbol, + // _Period, + // lastTurnOffLongTradesTime + // ); + + // // + // // the Distance must be bigger than market length ... + // if (MathAbs(lastTurnOffLongTradesBarIndex - bar_index) > xTPWSwingLength) { + // // + // xTPWWaitForLongSignals = true; + // lastTurnOffLongTradesTime = 0; + // } + // } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXTPWLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + || !xTPWWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPow States ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPowMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve XPrice Model ... + XPrice prices = GetPrice(); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XLHS lhs = GetXTPWLHS(bar_index); + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool longCondition1 = + // + true + // + && !isHHSame + // + && !( + lhs.scLL == lhs.mcLL + ) + // + && !( + lhs.scHH == lhs.mcHH + ) + // + && !( + prices.longEntry + && candle0.high < state0.scFast + && candle0.high < state0.scSlow + && candle0.high < state0.mcFast + && candle0.high < state0.mcSlow + && candle0.high < state0.lcFast + && candle0.high < state0.lcSlow + ) + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + // Start Conditions ... + startCondition = ( + longCondition1 + ) + ; + + // + if ( + startCondition + && xTPWLongConds.startTime == 0 + && xTPWLongConds.signalTime == 0 + && xTPWLongConds.entryTime == 0 + ) { + // + xTPWLongConds.startTime = barTime; + xTPWLongConds.signalTime = barTime; + xTPWLongConds.entryTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXTPWShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPower State ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPWMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XPrice prices = GetPrice(); + XLHS lhs = GetXTPWLHS(bar_index); + + // + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool shortCondition1 = + // + true + // + && tPow1.powerDown > tPowerMaxVerifier + && tPow2.powerDown < tPowerMaxVerifier + ; + + // + startCondition = ( + shortCondition1 + ) + ; + + // + if ( + startCondition + && xTPWShortConds.startTime == 0 + && xTPWShortConds.signalTime == 0 + && xTPWShortConds.entryTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXTPWSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + // Check Condition Validations ... + if (requestLong) { + // + // Check Long Condtion is Valid, if Long Requested ... + if ( + !ValidateXTPWLongConditions() + ) { + return result; + } + } else { + // + // Check Short Condtion is Valid, if Short Requested ... + if ( + !ValidateXTPWShortConditions() + ) { + return result; + } + } + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xTPWSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xTPWSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + // Price Calculations ... + XPrice prices = GetPrice(); + + // + // Read State ... + XTPWMarketState state0 = GetXTPWMarketState(bar_index); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 2); + + // + double risk = requestLong ? + // + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double longR2R = xTPWLongR2R; + double shortR2R = xTPWShortR2R; + + // + double sharpDetectorValue = xTPWSharpDetectionFactor * _Point; + + // + if ( + risk > 0 + && requestLong + ) { + return result; + } + + // + // Define Entry Price ... + double entryPrice = requestLong + ? + prices.longEntry + : + prices.shortEntry + ; + + // + // Fix TP Detects for Short Signals ... + if (!requestLong) { + risk = 0; + } + + // + double reward = requestLong ? + risk * longR2R : + risk * shortR2R + ; + + // + if (risk == 0) { + // + // Calculate Reward ... + reward = requestLong + ? + MathAbs(hh - entryPrice) + : + MathAbs(hh - entryPrice) + ; + + // + // Detect Sharp Change Occured or not ... + bool isSharpOccured = reward > sharpDetectorValue + || MathAbs(reward - sharpDetectorValue) < (50 * _Point); + + // + // Change Rewards on Special Conditions ... + if ( + ( + requestLong + && isSharpOccured + && ( + state0.lcFast < state0.lcSlow + || ( + state0.mcFast > state0.mcSlow + && state0.mcWeight < state0.mcSlow + ) + ) + ) + ) { + reward = reward / 2; + } + + // + if (reward < 50 * _Point) { + reward = (50 * _Point) + prices.priceGap; + } + + // // + // if (!requestLong) { + // reward = reward * shortR2R; + // } + } + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XTPW_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XTPW_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWLongConditions() { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime > 0 + && xTPWLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.entryTime + // ); + + // // + // int startSignalDiff = (signalBarIndex - startBarIndex); + // int entrySignalDiff = (entryBarIndex - signalBarIndex); + // int maxDiff = MathMax(startSignalDiff, entrySignalDiff); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWLongConds.signalTime >= xTPWLongConds.startTime + && xTPWLongConds.entryTime >= xTPWLongConds.signalTime + // + // && maxDiff < (xTPWSwingLength * 2) + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWShortConditions() { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime > 0 + && xTPWShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.entryTime + // ); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWShortConds.signalTime >= xTPWShortConds.startTime + && xTPWShortConds.entryTime >= xTPWShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXTPWLongSignalConditions() { + // + xTPWLongConds.startTime = 0; + xTPWLongConds.entryTime = 0; + xTPWLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXTPWShortSignalConditions() { + // + xTPWShortConds.startTime = 0; + xTPWShortConds.entryTime = 0; + xTPWShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXTPWSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve TPow State ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xTPWSwingLength + ); + + // + // Retrive XMarket States ... + XTPWMarketState state0 = GetXTPWMarketState(signalBarIndex); + XTPWMarketState state1 = GetXTPWMarketState(signalBarIndex + 1); + XTPWMarketState state2 = GetXTPWMarketState(signalBarIndex + 2); + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Calculate Sharp Detection Value ... + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + // Find State0 Min ... + double state0Min = MathMin(state0.scFast, state0.scSlow); + state0Min = MathMin(state0Min, state0.mcFast); + state0Min = MathMin(state0Min, state0.mcSlow); + state0Min = MathMin(state0Min, state0.lcFast); + state0Min = MathMin(state0Min, state0.lcSlow); + + // + // Find State0 Min ... + double state0Max = MathMax(state0.scFast, state0.scSlow); + state0Max = MathMax(state0Max, state0.mcFast); + state0Max = MathMax(state0Max, state0.mcSlow); + state0Max = MathMax(state0Max, state0.lcFast); + state0Max = MathMax(state0Max, state0.lcSlow); + + // + // Find Distance Between State0 Min and Max ... + double state0MinMaxDistance = MathAbs(state0Max - state0Min); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + isPSarVerified = + // + // Starter ... + true + // + ; + + // + isStateVerified = + // + // Start ... + true + // + && state0.mcFast > state0.mcSlow + && state1.mcFast > state1.mcSlow + // + && !( + state0.lcFast > state0.mcSlow + && state0.lcFast < state0.mcFast + ) + // + && MathAbs(state1.mcFast - state1.mcSlow) > (50 * _Point) + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + // + // Starter ... + true + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.signal > MathMax(tPow0.powerUp, tPow0.powerDown) + ; + + // + isStateVerified = + // + // Start ... + true + // + && ( + // + state0.scFast < state0.scSlow + && state0.mcFast < state0.mcSlow + && state0.lcFast < state0.lcSlow + ? + signal.entry > state0.scFast + : + // + // Find Minimum and Maximum Distance of State ... + state0MinMaxDistance > sharpDetectionValue + ? + signal.entry > state0Min + : + true + ) + // + && MathAbs(state0.mcFast - state0.mcSlow) > 50 * _Point + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +// +// Retrieve Market State ... +XTPWMarketState GetXTPWMarketState( + const int bar_index +) { + // + XTPWMarketState result = {}; + + // + int dayCount = GetDailyCandleCount(); + int halfDayCount = (int)(dayCount / 2); + + // + if (scFastLength == 0) { + scFastLength = xTPWSwingLength; + } + + // + if (scSlowLength == 0) { + scSlowLength = xTPWSwingLength * 2; + } + + // + if (mcFastLength == 0) { + mcFastLength = halfDayCount; + } + + // + if (mcSlowLength == 0) { + mcSlowLength = dayCount; + } + + // + if (lcFastLength == 0) { + lcFastLength = halfDayCount * 3; + } + + // + if (lcSlowLength == 0) { + lcSlowLength = dayCount * 3; + } + + // + double scFast = GetMA( + bar_index, + scFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scSlow = GetMA( + bar_index, + scSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scWeight = GetMA( + bar_index, + scSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double mcFast = GetMA( + bar_index, + mcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcSlow = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcWeight = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double lcFast = GetMA( + bar_index, + lcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcSlow = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcWeight = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xTPWPSarStep, + xTPWPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.scFast = scFast; + result.scSlow = scSlow; + result.mcFast = mcFast; + result.mcSlow = mcSlow; + result.lcFast = lcFast; + result.lcSlow = lcSlow; + result.scWeight = scWeight; + result.mcWeight = mcWeight; + result.lcWeight = lcWeight; + + // + return result; +} + +// +// Retrieve Highest Highs and Lowest Lows in Cycles ... +XLHS GetXTPWLHS( + const int bar_index +) { + // + XLHS result = {}; + + // + // Retrieve LL and HH (s) ... + + // + // SC HH ... + double scHH = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // SC LL ... + double scLL = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // MC HH ... + double mcHH = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // MC LL ... + double mcLL = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // LC HH ... + double lcHH = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + // LC LL ... + double lcLL = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + result.scHH = scHH; + result.scLL = scLL; + result.mcHH = mcHH; + result.mcLL = mcLL; + result.lcHH = lcHH; + result.lcLL = lcLL; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif b/Docs/Reports/14020412/OSC XMA 15Min Long/Only OSC/StrategyTester_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..64e458ff9b58ec1eca085f424da719deca90d9ee GIT binary patch literal 10178 zcmc(^_g9lo*F7AHkc1+FbWw`*DoP7gQ2_x({U}WY0fEpvflxwCLICN69y)~HLhsV6 zbOH)UFVYmGNxt0A`$xRjnrqfs`|PvNo|)ffG_;<}D|~uH(Fa%u07xVf000;o8X^$} zA<;(!D=We^M6iNH&jYT15@|jfat#rzu9?>%fHXe~0aO642W0mD3|_OY z`$S)puGjQG6W96wA%yw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@-+VqJM7p)pLVo4zu z20XMQn8`EG7j{}Gy@{@NfY`}4flUm7#YE5}^_o80V&$dkIq&KRT?JH%xo?{QFAr*# z6pH*)YSk_*<_5~~P(C9R(O!2Xn|mHsb?{OQ6L?M$oGfmM;13&X61f@ zSM?I}0~BjNz9i+~=hn}FAi7`J#$XBK1XthE{kMJhZn_9dbXzQ%Qz z3Qdt?&7ZfTHHa;O@XV=j!0>z%4$x#%)cTePIo_#%*^$OQph#9x)j3gWy`4r9Es}bX z|Kp_0OQfA@tSyhbZoROULs2yFcRNd?!<<6f)x2UGMY{titA(#)r@n)Ywq0L6zm&Zb zP}0uV+}Zj&Q68csxsZr%Xp1oG3KOow!eh9IU9v-6H9xzy3)>%m5arwLpk4qfEVMsM zt5I%Fn}U8lH11IKZ1`f_&aTvvAl0d64_O-kncPX@zWll^B-o?Zln5>9u^Z}f*zIwm f?R63Bb<^qfu + + + Strategy Tester: x-saherelm.osc.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.osc.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2023.01.03 01:00 - 2023.06.28 23:45 (2023.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
Bars in test12551Ticks modelled15360882Modelling qualityn/a
Mismatched charts errors1395
Initial deposit1000.00SpreadCurrent (50)
Total net profit223.50Gross profit1480.53Gross loss-1257.03
Profit factor1.18Expected payoff0.63
Absolute drawdown66.94Maximal drawdown434.20 (31.15%)Relative drawdown31.15% (434.20)
Total trades353Short positions (won %)0 (0.00%)Long positions (won %)353 (89.80%)
Profit trades (% of total)317 (89.80%)Loss trades (% of total)36 (10.20%)
Largestprofit trade33.12loss trade-82.64
Averageprofit trade4.67loss trade-34.92
Maximumconsecutive wins (profit in money)80 (449.04)consecutive losses (loss in money)5 (-149.41)
Maximalconsecutive profit (count of wins)449.04 (80)consecutive loss (count of losses)-225.40 (4)
Averageconsecutive wins26consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12023.01.03 01:15buy10.011827.450.001843.83
22023.01.03 04:15buy20.011829.930.001835.55
32023.01.03 04:40t/p20.011835.550.001835.555.621005.62
42023.01.03 08:18t/p10.011843.830.001843.8316.381022.00
52023.01.03 11:30buy30.011841.650.001855.25
62023.01.03 12:00buy40.011839.080.001847.54
72023.01.03 14:30buy50.011835.760.001845.00
82023.01.03 16:33t/p50.011845.000.001845.009.241031.24
92023.01.03 16:40t/p40.011847.540.001847.548.461039.70
102023.01.03 18:45buy60.011831.470.001838.67
112023.01.03 19:43t/p60.011838.670.001838.677.201046.90
122023.01.04 02:45buy70.011838.470.001842.41
132023.01.04 03:42t/p70.011842.410.001842.413.941050.84
142023.01.04 09:32t/p30.011855.250.001855.2513.601064.44
152023.01.04 15:30buy80.011859.480.001872.26
162023.01.04 17:43buy90.011858.070.001872.79
172023.01.04 18:15buy100.011859.520.001879.82
182023.01.04 22:13buy110.011852.910.001863.57
192023.01.04 23:00close110.011855.120.001863.572.211066.65
202023.01.04 23:00buy120.011855.620.001866.04
212023.01.05 04:48close120.011855.910.001866.040.291066.94
222023.01.05 04:48buy130.011856.410.001859.81
232023.01.06 17:07t/p130.011859.810.001859.813.401070.34
242023.01.09 03:38t/p80.011872.260.001872.2612.781083.12
252023.01.09 03:42t/p90.011872.790.001872.7914.721097.84
262023.01.09 09:17t/p100.011879.820.001879.8220.301118.14
272023.01.09 14:08buy140.011873.920.001879.06
282023.01.09 16:00buy150.011878.500.001889.38
292023.01.09 16:03t/p140.011879.060.001879.065.141123.28
302023.01.09 18:45buy160.011876.880.001885.72
312023.01.09 20:30buy170.011873.710.001882.41
322023.01.09 21:08buy180.011873.080.001877.60
332023.01.09 21:45close180.011873.900.001877.600.821124.10
342023.01.09 21:45close170.011873.900.001882.410.191124.29
352023.01.09 21:45buy190.011874.400.001882.66
362023.01.09 23:42buy200.011871.550.001875.43
372023.01.10 03:30close200.011873.400.001875.431.851126.14
382023.01.10 03:30buy210.011873.900.001885.50
392023.01.10 19:45close210.011875.230.001885.501.331127.47
402023.01.10 19:45close190.011875.230.001882.660.831128.30
412023.01.10 19:45buy220.011875.730.001884.15
422023.01.10 20:48buy230.011875.450.001880.99
432023.01.10 23:00close230.011877.930.001880.992.481130.78
442023.01.10 23:00close220.011877.930.001884.152.201132.98
452023.01.10 23:00close160.011877.930.001885.721.051134.03
462023.01.10 23:00buy240.011878.430.001883.37
472023.01.10 23:30buy250.011877.800.001880.92
482023.01.11 02:00buy260.011877.490.001878.97
492023.01.11 07:11t/p260.011878.970.001878.971.481135.51
502023.01.11 07:33t/p250.011880.920.001880.923.121138.63
512023.01.11 07:37t/p240.011883.370.001883.374.941143.57
522023.01.11 15:45buy270.011880.230.001888.51
532023.01.11 18:46buy280.011873.780.001885.52
542023.01.12 01:15buy290.011877.590.001880.31
552023.01.12 03:57t/p290.011880.310.001880.312.721146.29
562023.01.12 13:13t/p280.011885.520.001885.5211.741158.03
572023.01.12 14:22t/p270.011888.510.001888.518.281166.31
582023.01.12 14:23t/p150.011889.380.001889.3810.881177.19
592023.01.12 15:45buy300.011892.180.001925.30
602023.01.12 18:00buy310.011889.130.001907.11
612023.01.13 08:30buy320.011895.510.001901.27
622023.01.13 09:45buy330.011897.320.001903.56
632023.01.13 10:08t/p320.011901.270.001901.275.761182.95
642023.01.13 10:12t/p330.011903.560.001903.566.241189.19
652023.01.13 10:42t/p310.011907.110.001907.1117.981207.17
662023.01.13 15:41buy340.011899.570.001908.39
672023.01.13 16:47t/p340.011908.390.001908.398.821215.99
682023.01.16 04:31t/p300.011925.300.001925.3033.121249.11
692023.01.16 15:55buy350.011914.440.001919.66
702023.01.16 16:30buy360.011914.600.001920.40
712023.01.16 20:00buy370.011914.160.001916.24
722023.01.17 01:05t/p370.011916.240.001916.242.081251.19
732023.01.17 04:15buy380.011915.870.001921.35
742023.01.17 09:45buy390.011910.040.001915.68
752023.01.17 10:45close390.011910.310.001915.680.271251.46
762023.01.17 10:45buy400.011910.810.001917.41
772023.01.17 15:30close400.011911.980.001917.411.171252.63
782023.01.17 15:30buy410.011912.480.001922.68
792023.01.17 18:30close410.011912.600.001922.680.121252.75
802023.01.17 18:30buy420.011913.100.001920.64
812023.01.18 15:30t/p350.011919.660.001919.665.221257.97
822023.01.18 15:30t/p360.011920.400.001920.405.801263.77
832023.01.18 15:30t/p420.011920.640.001920.647.541271.31
842023.01.18 15:31t/p380.011921.350.001921.355.481276.79
852023.01.18 23:30buy430.011904.630.001908.69
862023.01.19 01:06buy440.011904.440.001906.46
872023.01.19 01:51t/p440.011906.460.001906.462.021278.81
882023.01.19 02:33t/p430.011908.690.001908.694.061282.87
892023.01.19 04:30buy450.011903.550.001908.11
902023.01.19 05:07t/p450.011908.110.001908.114.561287.43
912023.01.19 13:00buy460.011909.940.001915.62
922023.01.19 13:30buy470.011909.670.001914.81
932023.01.19 14:08buy480.011909.630.001912.57
942023.01.19 14:45buy490.011910.690.001918.15
952023.01.19 15:30close490.011911.860.001918.151.171288.60
962023.01.19 15:30close480.011911.860.001912.572.231290.83
972023.01.19 15:30close470.011911.860.001914.812.191293.02
982023.01.19 15:30close460.011911.860.001915.621.921294.94
992023.01.19 15:30buy500.011912.360.001922.84
1002023.01.19 17:36t/p500.011922.840.001922.8410.481305.42
1012023.01.20 07:45buy510.011927.080.001934.26
1022023.01.20 10:06t/p510.011934.260.001934.267.181312.60
1032023.01.20 11:30buy520.011931.900.001942.00
1042023.01.20 12:15buy530.011929.300.001934.20
1052023.01.20 13:00buy540.011930.340.001935.18
1062023.01.20 15:03buy550.011929.550.001933.49
1072023.01.23 03:50t/p550.011933.490.001933.493.941316.54
1082023.01.23 04:12t/p530.011934.200.001934.204.901321.44
1092023.01.23 04:18t/p540.011935.180.001935.184.841326.28
1102023.01.23 10:37buy560.011923.900.001930.20
1112023.01.23 15:15buy570.011926.780.001933.48
1122023.01.23 17:31buy580.011918.590.001931.51
1132023.01.23 22:38t/p560.011930.200.001930.206.301332.58
1142023.01.23 22:45t/p580.011931.510.001931.5112.921345.50
1152023.01.24 03:36t/p570.011933.480.001933.486.701352.20
1162023.01.24 10:03t/p520.011942.000.001942.0010.101362.30
1172023.01.24 17:27buy590.011930.540.001952.36
1182023.01.25 01:45buy600.011937.100.001937.96
1192023.01.25 02:03t/p600.011937.960.001937.960.861363.16
1202023.01.25 03:00buy610.011937.140.001940.86
1212023.01.25 08:32buy620.011930.890.001938.43
1222023.01.25 10:27buy630.011931.860.001939.26
1232023.01.25 10:45close620.011931.070.001938.430.181363.34
1242023.01.25 10:45close590.011931.070.001952.360.531363.87
1252023.01.25 10:45buy640.011931.570.001939.29
1262023.01.25 14:38buy650.011926.590.001930.55
1272023.01.25 16:42t/p650.011930.550.001930.553.961367.83
1282023.01.25 19:32t/p630.011939.260.001939.267.401375.23
1292023.01.25 19:32t/p640.011939.290.001939.297.721382.95
1302023.01.25 20:21t/p610.011940.860.001940.863.721386.67
1312023.01.26 03:45buy660.011945.510.001950.81
1322023.01.26 04:15buy670.011946.010.001952.31
1332023.01.26 08:00buy680.011947.760.001952.28
1342023.01.26 10:30buy690.011943.920.001955.06
1352023.02.01 22:02close690.011944.430.001955.060.511387.18
1362023.02.01 22:08close660.011946.020.001950.810.511387.69
1372023.02.01 22:08close670.011946.520.001952.310.511388.20
1382023.02.01 22:31close680.011948.270.001952.280.511388.71
1392023.02.02 13:30buy700.011955.460.001962.46
1402023.02.02 14:16buy710.011955.350.001961.87
1412023.02.03 11:15buy720.011913.840.001919.96
1422023.02.09 18:30close700.011872.820.001962.46-82.641306.07
1432023.02.09 19:15close710.011873.210.001961.87-82.141223.93
1442023.02.10 03:00buy730.011863.180.001869.10
1452023.02.10 04:00buy740.011862.590.001868.75
1462023.02.10 04:45buy750.011863.040.001870.28
1472023.02.10 10:06t/p740.011868.750.001868.756.161230.09
1482023.02.10 10:06t/p730.011869.100.001869.105.921236.01
1492023.02.10 10:08t/p750.011870.280.001870.287.241243.25
1502023.02.10 12:30buy760.011864.280.001871.36
1512023.02.10 13:30buy770.011862.320.001865.36
1522023.02.10 14:43buy780.011865.240.001872.48
1532023.02.10 15:47t/p770.011865.360.001865.363.041246.29
1542023.02.10 16:00buy790.011867.310.001877.81
1552023.02.10 16:15close720.011866.390.001919.96-47.451198.84
1562023.02.10 17:15buy800.011865.270.001877.09
1572023.02.17 17:30close760.011833.960.001871.36-30.321168.52
1582023.02.17 19:30close780.011841.780.001872.48-23.461145.06
1592023.02.17 21:00close790.011841.980.001877.81-25.331119.73
1602023.02.17 22:15close800.011842.420.001877.09-22.851096.88
1612023.02.20 03:03buy810.011839.590.001842.75
1622023.02.20 04:06buy820.011840.900.001846.68
1632023.02.20 04:33t/p810.011842.750.001842.753.161100.04
1642023.02.20 05:45buy830.011842.690.001845.15
1652023.02.20 07:45buy840.011843.690.001848.09
1662023.02.20 08:06t/p830.011845.150.001845.152.461102.50
1672023.02.20 08:30buy850.011843.960.001848.90
1682023.02.20 09:15buy860.011845.180.001849.18
1692023.02.20 10:02t/p820.011846.680.001846.685.781108.28
1702023.02.20 11:00buy870.011844.500.001849.72
1712023.02.20 12:00close840.011843.730.001848.090.041108.32
1722023.02.20 12:00buy880.011844.230.001849.89
1732023.02.20 13:15close850.011844.160.001848.900.201108.52
1742023.02.20 13:15buy890.011844.660.001847.74
1752023.02.20 15:30close890.011845.880.001847.741.221109.74
1762023.02.20 15:30close880.011845.880.001849.891.651111.39
1772023.02.20 15:30close870.011845.880.001849.721.381112.77
1782023.02.20 15:30close860.011845.880.001849.180.701113.47
1792023.02.20 15:30buy900.011846.380.001853.38
1802023.02.20 16:00buy910.011846.710.001854.37
1812023.02.20 18:45buy920.011843.700.001845.84
1822023.02.21 01:15buy930.011842.570.001845.95
1832023.02.21 04:30close930.011842.610.001845.950.041113.51
1842023.02.21 04:30buy940.011843.110.001848.65
1852023.02.27 23:00close900.011816.990.001853.38-29.391084.12
1862023.02.27 23:30close910.011816.780.001854.37-29.931054.19
1872023.02.28 03:15close920.011816.580.001845.84-27.121027.07
1882023.02.28 09:30close940.011811.970.001848.65-31.14995.93
1892023.02.28 11:00buy950.011811.070.001823.15
1902023.02.28 13:45buy960.011810.890.001816.49
1912023.02.28 15:30buy970.011809.700.001812.60
1922023.02.28 15:52t/p970.011812.600.001812.602.90998.83
1932023.02.28 16:45t/p960.011816.490.001816.495.601004.43
1942023.02.28 17:02t/p950.011823.150.001823.1512.081016.51
1952023.03.01 16:00buy980.011837.490.001844.13
1962023.03.01 16:30buy990.011839.010.001848.69
1972023.03.01 16:57t/p980.011844.130.001844.136.641023.15
1982023.03.01 17:30buy1000.011838.590.001848.29
1992023.03.02 04:30buy1010.011836.160.001845.80
2002023.03.02 05:00buy1020.011834.900.001841.80
2012023.03.02 16:45close1020.011835.000.001841.800.101023.25
2022023.03.02 16:45buy1030.011835.500.001845.76
2032023.03.02 23:17close1030.011835.890.001845.760.391023.64
2042023.03.02 23:17buy1040.011836.390.001838.65
2052023.03.03 01:15close1040.011836.520.001838.650.131023.77
2062023.03.03 01:15close1010.011836.520.001845.800.361024.13
2072023.03.03 01:15buy1050.011837.020.001839.76
2082023.03.03 02:03t/p1050.011839.760.001839.762.741026.87
2092023.03.03 13:16t/p1000.011848.290.001848.299.701036.57
2102023.03.03 13:17t/p990.011848.690.001848.699.681046.25
2112023.03.03 18:00buy1060.011845.090.001856.21
2122023.03.06 06:13t/p1060.011856.210.001856.2111.121057.37
2132023.03.06 12:30buy1070.011852.960.001857.04
2142023.03.07 03:30buy1080.011846.530.001850.83
2152023.03.07 09:26t/p1080.011850.830.001850.834.301061.67
2162023.03.08 02:01buy1090.011814.410.001816.13
2172023.03.08 03:32buy1100.011813.370.001814.89
2182023.03.08 06:17buy1110.011811.370.001813.33
2192023.03.08 08:53t/p1110.011813.330.001813.331.961063.63
2202023.03.08 08:53buy1120.011813.830.001818.23
2212023.03.08 09:41t/p1100.011814.890.001814.891.521065.15
2222023.03.08 10:30buy1130.011814.330.001816.53
2232023.03.08 13:15close1130.011815.580.001816.531.251066.40
2242023.03.08 13:15close1120.011815.580.001818.231.751068.15
2252023.03.08 13:15close1090.011815.580.001816.131.171069.32
2262023.03.08 13:15buy1140.011816.080.001823.00
2272023.03.08 14:16buy1150.011815.450.001819.45
2282023.03.08 15:00buy1160.011815.410.001818.91
2292023.03.08 16:32close1160.011816.500.001818.911.091070.41
2302023.03.08 16:32close1150.011816.500.001819.451.051071.46
2312023.03.08 16:32close1140.011816.500.001823.000.421071.88
2322023.03.08 16:32buy1170.011817.000.001819.60
2332023.03.08 16:48t/p1170.011819.600.001819.602.601074.48
2342023.03.08 19:45buy1180.011818.290.001823.63
2352023.03.08 21:15buy1190.011816.200.001821.34
2362023.03.09 01:15buy1200.011815.680.001820.58
2372023.03.09 15:32t/p1200.011820.580.001820.584.901079.38
2382023.03.09 15:33t/p1190.011821.340.001821.345.141084.52
2392023.03.09 15:43t/p1180.011823.630.001823.635.341089.86
2402023.03.09 19:15buy1210.011828.400.001833.62
2412023.03.09 20:43t/p1210.011833.620.001833.625.221095.08
2422023.03.09 23:15buy1220.011831.560.001836.08
2432023.03.09 23:45buy1230.011831.330.001835.39
2442023.03.10 04:15buy1240.011832.700.001837.24
2452023.03.10 10:02t/p1230.011835.390.001835.394.061099.14
2462023.03.10 10:02t/p1220.011836.080.001836.084.521103.66
2472023.03.10 12:15buy1250.011833.580.001838.30
2482023.03.10 13:15buy1260.011835.020.001842.60
2492023.03.10 14:00close1250.011834.790.001838.301.211104.87
2502023.03.10 14:00close1240.011834.790.001837.242.091106.96
2512023.03.10 14:00buy1270.011835.290.001840.79
2522023.03.10 15:32t/p1270.011840.790.001840.795.501112.46
2532023.03.10 15:43t/p1260.011842.600.001842.607.581120.04
2542023.03.10 15:45buy1280.011844.210.001868.45
2552023.03.10 16:35close1070.011853.470.001857.040.511120.55
2562023.03.10 19:15buy1290.011859.600.001869.92
2572023.03.10 22:53t/p1280.011868.450.001868.4524.241144.79
2582023.03.10 23:01t/p1290.011869.920.001869.9210.321155.11
2592023.03.13 04:15buy1300.011876.090.001883.31
2602023.03.13 04:30t/p1300.011883.310.001883.317.221162.33
2612023.03.13 08:15buy1310.011882.210.001891.87
2622023.03.13 10:15buy1320.011878.890.001892.99
2632023.03.13 11:37t/p1310.011891.870.001891.879.661171.99
2642023.03.13 11:40t/p1320.011892.990.001892.9914.101186.09
2652023.03.13 13:30buy1330.011888.130.001902.01
2662023.03.13 14:53t/p1330.011902.010.001902.0113.881199.97
2672023.03.13 19:00buy1340.011909.440.001921.90
2682023.03.14 05:20buy1350.011907.130.001911.61
2692023.03.14 08:16t/p1350.011911.610.001911.614.481204.45
2702023.03.14 16:07buy1360.011905.350.001919.23
2712023.03.14 16:45buy1370.011905.430.001924.89
2722023.03.14 18:45buy1380.011906.720.001915.12
2732023.03.15 13:32t/p1380.011915.120.001915.128.401212.85
2742023.03.15 14:01t/p1360.011919.230.001919.2313.881226.73
2752023.03.15 14:03t/p1340.011921.900.001921.9012.461239.19
2762023.03.15 14:13t/p1370.011924.890.001924.8919.461258.65
2772023.03.15 16:00buy1390.011926.410.001943.85
2782023.03.15 16:45buy1400.011922.870.001933.23
2792023.03.15 17:30buy1410.011926.280.001943.20
2802023.03.15 18:00buy1420.011927.410.001943.71
2812023.03.15 18:23t/p1400.011933.230.001933.2310.361269.01
2822023.03.15 21:12buy1430.011919.750.001933.45
2832023.03.16 11:45close1430.011920.120.001933.450.371269.38
2842023.03.16 11:45buy1440.011920.620.001928.32
2852023.03.16 14:08t/p1440.011928.320.001928.327.701277.08
2862023.03.16 16:15buy1450.011928.890.001939.59
2872023.03.16 16:45close1450.011931.480.001939.592.591279.67
2882023.03.16 16:45close1420.011931.480.001943.714.071283.74
2892023.03.16 16:45close1410.011931.480.001943.205.201288.94
2902023.03.16 16:45close1390.011931.480.001943.855.071294.01
2912023.03.16 16:45buy1460.011931.980.001948.86
2922023.03.16 20:47buy1470.011920.920.001929.86
2932023.03.16 22:30buy1480.011919.600.001921.78
2942023.03.17 00:05buy1490.011920.130.001922.77
2952023.03.17 00:30close1490.011920.170.001922.770.041294.05
2962023.03.17 00:30close1480.011920.170.001921.780.571294.62
2972023.03.17 00:30buy1500.011920.670.001924.39
2982023.03.17 01:00buy1510.011920.330.001922.93
2992023.03.17 03:30close1510.011921.630.001922.931.301295.92
3002023.03.17 03:30close1500.011921.630.001924.390.961296.88
3012023.03.17 03:30close1470.011921.630.001929.860.711297.59
3022023.03.17 03:30buy1520.011922.130.001929.29
3032023.03.17 05:27t/p1520.011929.290.001929.297.161304.75
3042023.03.17 15:12t/p1460.011948.860.001948.8616.881321.63
3052023.03.17 18:45buy1530.011960.110.001969.11
3062023.03.17 19:31t/p1530.011969.110.001969.119.001330.63
3072023.03.17 22:30buy1540.011980.400.001993.04
3082023.03.20 02:02buy1550.011978.210.001982.81
3092023.03.20 07:52t/p1550.011982.810.001982.814.601335.23
3102023.03.20 08:03t/p1540.011993.040.001993.0412.641347.87
3112023.03.21 00:15buy1560.011979.290.001983.23
3122023.03.21 02:15buy1570.011979.540.001985.16
3132023.03.21 02:47buy1580.011978.860.001984.78
3142023.03.21 04:53t/p1560.011983.230.001983.233.941351.81
3152023.03.21 05:32t/p1580.011984.780.001984.785.921357.73
3162023.03.21 15:30buy1590.011965.280.001977.62
3172023.03.22 01:00buy1600.011941.500.001944.64
3182023.03.22 02:45buy1610.011943.740.001946.06
3192023.03.22 03:02t/p1600.011944.640.001944.643.141360.87
3202023.03.22 03:13t/p1610.011946.060.001946.062.321363.19
3212023.03.22 03:45buy1620.011945.010.001949.71
3222023.03.22 05:31buy1630.011941.140.001945.66
3232023.03.22 10:15close1630.011943.300.001945.662.161365.35
3242023.03.22 10:15buy1640.011943.800.001962.26
3252023.03.22 16:48t/p1620.011949.710.001949.714.701370.05
3262023.03.22 20:03t/p1640.011962.260.001962.2618.461388.51
3272023.03.22 20:50t/p1590.011977.620.001977.6212.341400.85
3282023.03.23 01:15buy1650.011966.940.001971.16
3292023.03.23 02:03t/p1650.011971.160.001971.164.221405.07
3302023.03.23 10:15buy1660.011978.440.001984.82
3312023.03.23 12:00buy1670.011978.390.001985.17
3322023.03.23 12:30buy1680.011979.800.001988.88
3332023.03.23 14:15close1670.011978.410.001985.170.021405.09
3342023.03.23 14:15buy1690.011978.910.001985.01
3352023.03.23 15:30close1660.011978.450.001984.820.011405.10
3362023.03.23 15:30buy1700.011978.950.002003.17
3372023.03.23 17:22t/p1690.011985.010.001985.016.101411.20
3382023.03.23 17:22t/p1570.011985.160.001985.165.621416.82
3392023.03.23 18:16t/p1680.011988.880.001988.889.081425.90
3402023.03.23 21:15buy1710.011996.500.002012.82
3412023.03.23 22:00buy1720.011998.160.002017.82
3422023.03.24 02:30buy1730.011994.000.002001.48
3432023.03.24 03:00close1700.011993.560.002003.1714.611440.51
3442023.03.24 03:00buy1740.011994.060.002002.12
3452023.03.24 14:00close1740.011995.620.002002.121.561442.07
3462023.03.24 14:00close1730.011995.620.002001.481.621443.69
3472023.03.24 14:00buy1750.011996.120.002006.46
3482023.03.24 14:30buy1760.011997.220.002009.76
3492023.03.24 16:45close1750.011996.950.002006.460.831444.52
3502023.03.24 16:45close1710.011996.950.002012.820.451444.97
3512023.03.24 16:45buy1770.011997.450.002019.99
3522023.03.24 17:15buy1780.011993.810.002008.41
3532023.03.31 05:00close1720.011982.100.002017.82-16.061428.91
3542023.03.31 12:01buy1790.011976.870.001980.91
3552023.03.31 14:07t/p1790.011980.910.001980.914.041432.95
3562023.03.31 15:45buy1800.011982.210.001993.71
3572023.03.31 20:30close1760.011968.440.002009.76-28.781404.17
3582023.03.31 21:45buy1810.011971.180.001979.18
3592023.03.31 22:45close1770.011969.930.002019.99-27.521376.65
3602023.03.31 23:15close1780.011968.940.002008.41-24.871351.78
3612023.04.03 09:34buy1820.011955.270.001962.69
3622023.04.03 10:15buy1830.011958.850.001974.33
3632023.04.03 11:02t/p1820.011962.690.001962.697.421359.20
3642023.04.03 14:17t/p1830.011974.330.001974.3315.481374.68
3652023.04.03 15:03t/p1810.011979.180.001979.188.001382.68
3662023.04.03 17:15buy1840.011983.360.002004.70
3672023.04.03 21:30buy1850.011985.250.001991.47
3682023.04.03 22:16buy1860.011985.360.001989.58
3692023.04.03 22:45close1860.011985.520.001989.580.161382.84
3702023.04.03 22:45close1850.011985.520.001991.470.271383.11
3712023.04.03 22:45close1840.011985.520.002004.702.161385.27
3722023.04.03 22:45close1800.011985.520.001993.713.311388.58
3732023.04.03 22:45buy1870.011986.020.001993.18
3742023.04.04 01:15buy1880.011985.530.001988.81
3752023.04.04 02:06buy1890.011984.590.001985.05
3762023.04.04 02:38t/p1890.011985.050.001985.050.461389.04
3772023.04.04 03:30buy1900.011984.950.001987.71
3782023.04.04 08:18buy1910.011980.650.001984.97
3792023.04.04 11:00close1910.011982.000.001984.971.351390.39
3802023.04.04 11:00buy1920.011982.500.001992.90
3812023.04.04 13:30close1920.011983.790.001992.901.291391.68
3822023.04.04 13:30buy1930.011984.290.001991.91
3832023.04.04 16:25t/p1900.011987.710.001987.712.761394.44
3842023.04.04 16:32t/p1880.011988.810.001988.813.281397.72
3852023.04.04 16:44t/p1930.011991.910.001991.917.621405.34
3862023.04.04 17:00t/p1870.011993.180.001993.187.161412.50
3872023.04.05 18:45buy1940.012021.120.002042.96
3882023.04.05 21:15buy1950.012022.000.002027.24
3892023.04.05 22:30buy1960.012022.220.002024.76
3902023.04.06 01:45buy1970.012020.650.002023.91
3912023.04.12 15:31close1970.012021.180.002023.910.531413.03
3922023.04.12 15:32close1940.012021.640.002042.960.521413.55
3932023.04.12 15:32close1950.012022.510.002027.240.511414.06
3942023.04.12 15:33close1960.012022.730.002024.760.511414.57
3952023.04.12 18:00buy1980.012007.810.002019.03
3962023.04.12 19:15buy1990.012008.540.002014.38
3972023.04.12 21:08t/p1990.012014.380.002014.385.841420.41
3982023.04.13 03:01t/p1980.012019.030.002019.0311.221431.63
3992023.04.13 05:15buy2000.012019.460.002026.04
4002023.04.13 07:15buy2010.012019.060.002025.18
4012023.04.13 09:15buy2020.012018.670.002024.85
4022023.04.13 10:38t/p2020.012024.850.002024.856.181437.81
4032023.04.13 10:40t/p2010.012025.180.002025.186.121443.93
4042023.04.13 11:05t/p2000.012026.040.002026.046.581450.51
4052023.04.13 18:45buy2030.012042.040.002058.26
4062023.04.13 23:00buy2040.012040.760.002048.48
4072023.04.14 03:00buy2050.012040.040.002042.08
4082023.04.14 03:30buy2060.012040.250.002043.07
4092023.04.14 03:42t/p2050.012042.080.002042.082.041452.55
4102023.04.14 03:45t/p2060.012043.070.002043.072.821455.37
4112023.04.14 04:15buy2070.012042.350.002049.37
4122023.04.14 09:00buy2080.012043.110.002049.23
4132023.04.14 09:31close2070.012042.930.002049.370.581455.95
4142023.04.14 09:31close2040.012042.930.002048.482.171458.12
4152023.04.14 09:31close2030.012042.930.002058.260.891459.01
4162023.04.14 09:31buy2090.012043.430.002050.21
4172023.04.14 12:36buy2100.012036.710.002044.67
4182023.04.14 15:30buy2110.012036.920.002045.88
4192023.04.21 14:00close2080.011987.900.002049.23-55.211403.80
4202023.04.21 14:30close2090.011985.170.002050.21-58.261345.54
4212023.04.21 15:32buy2120.011990.420.002004.28
4222023.04.21 17:30close2100.011982.080.002044.67-54.631290.91
4232023.04.21 20:30close2110.011979.620.002045.88-57.301233.61
4242023.04.24 09:00buy2130.011979.680.001983.98
4252023.04.24 10:30buy2140.011982.870.001992.63
4262023.04.24 11:00buy2150.011983.000.001993.02
4272023.04.24 11:54t/p2130.011983.980.001983.984.301237.91
4282023.04.24 17:45buy2160.011986.500.002010.66
4292023.04.25 01:05t/p2140.011992.630.001992.639.761247.67
4302023.04.25 01:08t/p2150.011993.020.001993.0210.021257.69
4312023.04.25 08:15buy2170.011994.120.002000.20
4322023.04.25 08:49buy2180.011994.410.001998.25
4332023.04.25 12:15close2160.011989.730.002010.663.231260.92
4342023.04.25 12:15buy2190.011990.230.001995.91
4352023.04.25 20:26t/p2190.011995.910.001995.915.681266.60
4362023.04.25 20:53t/p2180.011998.250.001998.253.841270.44
4372023.04.25 21:03t/p2170.012000.200.002000.206.081276.52
4382023.04.25 23:00buy2200.011999.540.002009.26
4392023.04.26 01:15buy2210.011997.970.002001.67
4402023.04.26 03:10t/p2210.012001.670.002001.673.701280.22
4412023.04.26 05:00buy2220.011999.190.002005.57
4422023.04.26 05:30buy2230.011998.620.002003.86
4432023.04.26 07:49close2120.011995.770.002004.285.351285.57
4442023.04.26 07:49buy2240.011996.270.002000.57
4452023.04.26 09:22close2240.011996.910.002000.570.641286.21
4462023.04.26 09:22buy2250.011997.410.002000.93
4472023.04.26 10:30close2250.011998.040.002000.930.631286.84
4482023.04.26 10:30buy2260.011998.540.002006.24
4492023.04.26 13:00close2260.011998.660.002006.240.121286.96
4502023.04.26 13:00close2230.011998.660.002003.860.041287.00
4512023.04.26 13:00buy2270.011999.160.002004.66
4522023.04.26 16:00buy2280.011998.260.002011.28
4532023.04.26 16:22t/p2270.012004.660.002004.665.501292.50
4542023.04.26 16:24t/p2220.012005.570.002005.576.381298.88
4552023.04.26 21:56buy2290.011991.040.001996.34
4562023.04.27 05:16t/p2290.011996.340.001996.345.301304.18
4572023.04.27 17:07buy2300.011985.500.002001.28
4582023.04.27 20:00buy2310.011984.770.001991.37
4592023.04.28 17:38t/p2310.011991.370.001991.376.601310.78
4602023.05.01 07:13buy2320.011984.280.001989.62
4612023.05.01 14:42t/p2320.011989.620.001989.625.341316.12
4622023.05.01 15:32close2200.012000.050.002009.260.511316.63
4632023.05.01 15:35t/p2300.012001.280.002001.2815.781332.41
4642023.05.01 23:30buy2330.011981.190.001984.01
4652023.05.02 02:30buy2340.011983.000.001986.00
4662023.05.02 03:15buy2350.011983.330.001987.81
4672023.05.02 03:45close2340.011983.040.001986.000.041332.45
4682023.05.02 03:45close2330.011983.040.001984.011.851334.30
4692023.05.02 03:45buy2360.011983.540.001988.44
4702023.05.02 04:15buy2370.011983.510.001988.35
4712023.05.02 10:00close2370.011984.430.001988.350.921335.22
4722023.05.02 10:00close2360.011984.430.001988.440.891336.11
4732023.05.02 10:00close2350.011984.430.001987.811.101337.21
4742023.05.02 10:00buy2380.011984.930.001989.69
4752023.05.02 11:45buy2390.011981.760.001987.72
4762023.05.02 12:15buy2400.011983.150.001991.89
4772023.05.02 12:45close2400.011984.610.001991.891.461338.67
4782023.05.02 12:45close2390.011984.610.001987.722.851341.52
4792023.05.02 12:45buy2410.011985.110.001997.77
4802023.05.02 14:06t/p2380.011989.690.001989.694.761346.28
4812023.05.02 17:13t/p2410.011997.770.001997.7712.661358.94
4822023.05.02 17:14close2280.011998.790.002011.280.531359.47
4832023.05.02 21:30buy2420.012015.390.002023.23
4842023.05.02 22:00buy2430.012014.620.002020.92
4852023.05.02 23:30buy2440.012016.680.002020.60
4862023.05.03 01:30buy2450.012016.300.002017.22
4872023.05.03 03:00close2430.012015.710.002020.921.091360.56
4882023.05.03 03:00close2420.012015.710.002023.230.321360.88
4892023.05.03 03:00buy2460.012016.210.002016.93
4902023.05.03 03:30buy2470.012016.420.002020.30
4912023.05.03 04:15t/p2460.012016.930.002016.930.721361.60
4922023.05.03 04:16t/p2450.012017.220.002017.220.921362.52
4932023.05.03 05:00buy2480.012017.100.002019.44
4942023.05.03 06:15buy2490.012018.180.002020.84
4952023.05.03 07:00close2490.012018.300.002020.840.121362.64
4962023.05.03 07:00close2480.012018.300.002019.441.201363.84
4972023.05.03 07:00close2470.012018.300.002020.301.881365.72
4982023.05.03 07:00close2440.012018.300.002020.601.621367.34
4992023.05.03 07:00buy2500.012018.800.002021.78
5002023.05.03 07:48buy2510.012017.570.002018.01
5012023.05.03 09:30buy2520.012016.540.002020.22
5022023.05.03 09:50t/p2510.012018.010.002018.010.441367.78
5032023.05.03 10:00buy2530.012018.330.002025.59
5042023.05.03 11:30buy2540.012016.320.002023.16
5052023.05.03 13:36close2540.012016.340.002023.160.021367.80
5062023.05.03 13:36buy2550.012016.840.002018.54
5072023.05.03 16:29t/p2550.012018.540.002018.541.701369.50
5082023.05.03 17:45buy2560.012019.060.002032.86
5092023.05.03 17:52t/p2520.012020.220.002020.223.681373.18
5102023.05.03 18:02t/p2500.012021.780.002021.782.981376.16
5112023.05.03 18:22t/p2530.012025.590.002025.597.261383.42
5122023.05.03 21:02t/p2560.012032.860.002032.8613.801397.22
5132023.05.03 21:15buy2570.012025.830.002038.07
5142023.05.03 22:30buy2580.012025.950.002043.35
5152023.05.03 23:50t/p2570.012038.070.002038.0712.241409.46
5162023.05.04 01:05t/p2580.012043.350.002043.3517.401426.86
5172023.05.04 16:45buy2590.012041.070.002058.53
5182023.05.04 17:44t/p2590.012058.530.002058.5317.461444.32
5192023.05.04 18:36buy2600.012050.470.002060.89
5202023.05.04 19:15buy2610.012054.070.002074.83
5212023.05.04 19:45buy2620.012051.680.002067.66
5222023.05.04 20:45buy2630.012048.670.002056.47
5232023.05.04 22:15close2630.012049.070.002056.470.401444.72
5242023.05.04 22:15buy2640.012049.570.002057.37
5252023.05.04 23:15close2640.012050.140.002057.370.571445.29
5262023.05.04 23:15buy2650.012050.640.002056.98
5272023.05.11 23:30close2600.012013.690.002060.89-36.781408.51
5282023.05.12 01:15close2610.012015.960.002074.83-38.111370.40
5292023.05.12 01:45close2620.012015.350.002067.66-36.331334.07
5302023.05.12 05:15close2650.012011.920.002056.98-38.721295.35
5312023.05.12 10:15buy2660.012010.210.002018.67
5322023.05.12 13:45buy2670.012006.810.002018.07
5332023.05.12 16:05t/p2670.012018.070.002018.0711.261306.61
5342023.05.12 16:06t/p2660.012018.670.002018.678.461315.07
5352023.05.12 19:15buy2680.012010.470.002014.07
5362023.05.12 20:01t/p2680.012014.070.002014.073.601318.67
5372023.05.15 15:30buy2690.012015.350.002021.61
5382023.05.15 16:58t/p2690.012021.610.002021.616.261324.93
5392023.05.15 18:45buy2700.012018.550.002028.39
5402023.05.16 10:52buy2710.012009.630.002019.29
5412023.05.16 13:15buy2720.012010.410.002012.89
5422023.05.16 15:30buy2730.012007.380.002014.36
5432023.05.16 15:43t/p2720.012012.890.002012.892.481327.41
5442023.05.16 15:45t/p2730.012014.360.002014.366.981334.39
5452023.05.17 01:30buy2740.011989.890.001993.11
5462023.05.17 03:00buy2750.011990.150.001991.79
5472023.05.17 03:20t/p2750.011991.790.001991.791.641336.03
5482023.05.17 05:00buy2760.011992.950.001998.57
5492023.05.17 06:00close2740.011992.550.001993.112.661338.69
5502023.05.17 06:00buy2770.011993.050.001997.67
5512023.05.22 23:45close2700.011971.650.002028.39-46.901291.79
5522023.05.23 15:45close2710.011959.200.002019.29-50.431241.36
5532023.05.23 18:45buy2780.011967.250.001972.51
5542023.05.23 19:15buy2790.011968.770.001977.05
5552023.05.23 19:38t/p2780.011972.510.001972.515.261246.62
5562023.05.23 21:26t/p2790.011977.050.001977.058.281254.90
5572023.05.24 10:00close2760.011971.540.001998.57-21.411233.49
5582023.05.24 10:45buy2800.011976.440.001987.36
5592023.05.24 11:00close2770.011973.800.001997.67-19.251214.24
5602023.05.25 01:15buy2810.011959.230.001962.01
5612023.05.25 01:46buy2820.011959.860.001963.14
5622023.05.25 04:00buy2830.011959.650.001963.07
5632023.05.25 11:23t/p2810.011962.010.001962.012.781217.02
5642023.05.25 11:25t/p2830.011963.070.001963.073.421220.44
5652023.05.25 11:25t/p2820.011963.140.001963.143.281223.72
5662023.05.25 17:05buy2840.011949.160.001963.92
5672023.05.26 01:05buy2850.011941.660.001946.72
5682023.05.26 04:00buy2860.011941.280.001949.74
5692023.05.26 04:58t/p2850.011946.720.001946.725.061228.78
5702023.05.26 08:35t/p2860.011949.740.001949.748.461237.24
5712023.05.26 16:45buy2870.011950.430.001962.17
5722023.05.26 17:15buy2880.011950.730.001962.89
5732023.05.30 17:15close2880.011955.910.001962.895.181242.42
5742023.05.30 17:15close2870.011955.910.001962.175.481247.90
5752023.05.30 17:15close2840.011955.910.001963.926.751254.65
5762023.05.30 17:15buy2890.011956.410.001966.61
5772023.05.31 06:00buy2900.011956.510.001961.59
5782023.05.31 08:30buy2910.011959.570.001962.43
5792023.05.31 08:43t/p2900.011961.590.001961.595.081259.73
5802023.05.31 08:50t/p2910.011962.430.001962.432.861262.59
5812023.05.31 11:15buy2920.011958.320.001963.14
5822023.05.31 12:21buy2930.011958.020.001960.36
5832023.05.31 13:00close2930.011958.480.001960.360.461263.05
5842023.05.31 13:00close2920.011958.480.001963.140.161263.21
5852023.05.31 13:00close2890.011958.480.001966.612.071265.28
5862023.05.31 13:00buy2940.011958.980.001966.46
5872023.05.31 14:15buy2950.011958.590.001964.21
5882023.05.31 16:13t/p2950.011964.210.001964.215.621270.90
5892023.05.31 16:42t/p2940.011966.460.001966.467.481278.38
5902023.05.31 17:30buy2960.011966.450.001977.69
5912023.05.31 18:15close2800.011971.120.001987.36-5.321273.06
5922023.05.31 20:45buy2970.011968.340.001978.22
5932023.05.31 21:15buy2980.011967.370.001975.31
5942023.06.01 01:10buy2990.011963.980.001965.92
5952023.06.01 01:46t/p2990.011965.920.001965.921.941275.00
5962023.06.01 03:15buy3000.011966.760.001968.70
5972023.06.01 16:00t/p3000.011968.700.001968.701.941276.94
5982023.06.01 16:30buy3010.011968.550.001987.73
5992023.06.01 17:00t/p2980.011975.310.001975.317.941284.88
6002023.06.01 18:07t/p2960.011977.690.001977.6911.241296.12
6012023.06.01 18:07t/p2970.011978.220.001978.229.881306.00
6022023.06.01 21:00buy3020.011978.390.001982.23
6032023.06.01 21:45buy3030.011977.680.001980.10
6042023.06.01 22:17buy3040.011977.500.001980.26
6052023.06.02 02:49close3010.011976.650.001987.738.101314.10
6062023.06.02 02:49buy3050.011977.150.001978.69
6072023.06.02 05:07t/p3050.011978.690.001978.691.541315.64
6082023.06.02 05:50t/p3030.011980.100.001980.102.421318.06
6092023.06.02 05:51t/p3040.011980.260.001980.262.761320.82
6102023.06.02 06:19t/p3020.011982.230.001982.233.841324.66
6112023.06.05 01:25buy3060.011950.340.001955.26
6122023.06.05 04:45buy3070.011947.480.001949.50
6132023.06.05 06:45buy3080.011947.430.001953.67
6142023.06.05 08:44buy3090.011946.000.001948.80
6152023.06.05 17:00t/p3090.011948.800.001948.802.801327.46
6162023.06.05 17:00t/p3070.011949.500.001949.502.021329.48
6172023.06.05 17:00t/p3080.011953.670.001953.676.241335.72
6182023.06.05 17:01t/p3060.011955.260.001955.264.921340.64
6192023.06.06 17:19buy3100.011961.380.001971.82
6202023.06.06 18:00buy3110.011960.390.001971.81
6212023.06.06 18:31buy3120.011961.070.001968.45
6222023.06.07 11:15buy3130.011959.370.001967.71
6232023.06.07 16:45close3130.011961.830.001967.712.461343.10
6242023.06.07 16:45close3120.011961.830.001968.450.761343.86
6252023.06.07 16:45close3110.011961.830.001971.811.441345.30
6262023.06.07 16:45close3100.011961.830.001971.820.451345.75
6272023.06.07 16:45buy3140.011962.330.001972.03
6282023.06.08 21:46buy3150.011964.760.001969.40
6292023.06.09 01:45buy3160.011966.260.001968.02
6302023.06.09 02:45buy3170.011966.170.001967.65
6312023.06.09 04:15close3140.011964.510.001972.032.181347.93
6322023.06.09 04:15buy3180.011965.010.001967.73
6332023.06.09 09:30close3150.011964.800.001969.400.041347.97
6342023.06.09 09:30buy3190.011965.300.001970.00
6352023.06.09 15:30t/p3170.011967.650.001967.651.481349.45
6362023.06.09 15:30t/p3180.011967.730.001967.732.721352.17
6372023.06.09 15:30t/p3160.011968.020.001968.021.761353.93
6382023.06.09 15:31t/p3190.011970.000.001970.004.701358.63
6392023.06.09 15:45buy3200.011965.820.001969.38
6402023.06.09 17:00buy3210.011962.410.001972.33
6412023.06.12 18:09buy3220.011955.880.001965.98
6422023.06.13 01:45buy3230.011958.430.001961.19
6432023.06.13 04:15close3230.011958.780.001961.190.351358.98
6442023.06.13 04:15close3220.011958.780.001965.982.901361.88
6452023.06.13 04:15buy3240.011959.280.001962.20
6462023.06.13 05:45buy3250.011958.670.001963.47
6472023.06.13 09:21t/p3240.011962.200.001962.202.921364.80
6482023.06.13 10:08t/p3250.011963.470.001963.474.801369.60
6492023.06.13 15:30t/p3200.011969.380.001969.383.561373.16
6502023.06.13 22:52buy3260.011943.360.001948.06
6512023.06.14 01:07buy3270.011944.400.001949.38
6522023.06.14 01:45buy3280.011945.350.001951.23
6532023.06.14 03:00close3260.011943.800.001948.060.441373.60
6542023.06.14 03:00buy3290.011944.300.001947.88
6552023.06.14 05:00close3290.011946.700.001947.882.401376.00
6562023.06.14 05:00close3280.011946.700.001951.231.351377.35
6572023.06.14 05:00close3270.011946.700.001949.382.301379.65
6582023.06.14 05:00buy3300.011947.200.001953.00
6592023.06.14 06:00buy3310.011947.830.001951.31
6602023.06.14 06:30buy3320.011948.020.001951.02
6612023.06.14 07:30close3320.011948.390.001951.020.371380.02
6622023.06.14 07:30close3310.011948.390.001951.310.561380.58
6632023.06.14 07:30close3300.011948.390.001953.001.191381.77
6642023.06.14 07:30buy3330.011948.890.001952.37
6652023.06.14 08:15buy3340.011949.350.001951.81
6662023.06.14 08:45buy3350.011947.950.001950.85
6672023.06.14 10:30close3350.011948.850.001950.850.901382.67
6682023.06.14 10:30buy3360.011949.350.001957.03
6692023.06.14 12:26t/p3340.011951.810.001951.812.461385.13
6702023.06.14 12:34t/p3330.011952.370.001952.373.481388.61
6712023.06.14 15:15buy3370.011948.480.001953.24
6722023.06.14 15:36t/p3370.011953.240.001953.244.761393.37
6732023.06.14 15:43t/p3360.011957.030.001957.037.681401.05
6742023.06.15 08:30buy3380.011935.850.001945.35
6752023.06.15 10:37buy3390.011934.230.001943.29
6762023.06.15 11:15buy3400.011934.480.001944.94
6772023.06.15 12:30close3390.011934.350.001943.290.121401.17
6782023.06.15 12:30buy3410.011934.850.001942.43
6792023.06.15 13:46close3400.011934.710.001944.940.231401.40
6802023.06.15 13:46buy3420.011935.210.001939.41
6812023.06.15 16:25t/p3420.011939.410.001939.414.201405.60
6822023.06.15 16:27t/p3410.011942.430.001942.437.581413.18
6832023.06.15 16:43t/p3380.011945.350.001945.359.501422.68
6842023.06.16 09:33close3210.011962.920.001972.330.511423.19
6852023.06.16 16:45buy3430.011962.910.001975.15
6862023.06.16 17:56buy3440.011960.330.001970.55
6872023.06.16 18:30buy3450.011960.650.001973.45
6882023.06.16 20:25buy3460.011958.100.001965.60
6892023.06.26 01:15close3430.011923.680.001975.15-39.231383.96
6902023.06.26 02:15close3440.011924.300.001970.55-36.031347.93
6912023.06.26 03:00close3450.011925.150.001973.45-35.501312.43
6922023.06.26 04:45close3460.011927.640.001965.60-30.461281.97
6932023.06.26 18:17buy3470.011926.410.001935.09
6942023.06.27 03:30buy3480.011923.740.001928.92
6952023.06.27 04:00buy3490.011922.960.001926.58
6962023.06.27 04:42t/p3490.011926.580.001926.583.621285.59
6972023.06.27 04:49t/p3480.011928.920.001928.925.181290.77
6982023.06.27 10:00buy3500.011927.720.001934.24
6992023.06.27 15:01buy3510.011924.180.001931.16
7002023.06.28 01:15buy3520.011915.060.001918.66
7012023.06.28 04:00close3520.011915.950.001918.660.891291.66
7022023.06.28 04:00buy3530.011916.450.001918.91
7032023.06.28 23:54close at stop3530.011906.650.001918.91-9.801281.86
7042023.06.28 23:54close at stop3510.011906.650.001931.16-17.531264.33
7052023.06.28 23:54close at stop3500.011906.650.001934.24-21.071243.26
7062023.06.28 23:54close at stop3470.011906.650.001935.09-19.761223.50
+
diff --git a/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif b/Docs/Reports/14020412/OSC XMA 15Min Long/Only XMA/StrategyTester_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..005d1407b75473ecb73297c47ab58a18c4c65f6c GIT binary patch literal 9079 zcmcg}gq%PN578sUbHY`MvB^Z85bRBT0KoiBHI_*1O&TNwJAY%`TrD?|$Qy6~02#Pp-Q+>ukZyYVuZSD} ze+YJd9yyP{u`F+VfGSG}0AdNa(X~X*-!yA^^S){Q|ML>M`F+5DvjC720s+Axp<&?> zut+!}Dmo?>85f_Bn3SA?LZ_ysXJlq&=j7()7ZhTOic3n%$}1|XzE;=N)?w=#8gWg{ zEv;?s-@bQrc6Imk_Vo`84h@ftmJv-%PEF6?XXoY@7MFf3udM$3wYI*oxwXBsySM-Q z;PB7iqvMm)gDRpd;(ynfSAgps2IR7W<}KR03yH{;7aCOeNF{K1`~8 zs{Kxx$h9IKZVez(zeNe_hi?OdUy{@D(fktE*LzLDObHR>cX(K7Pk7jMtKDONuCkDo zRO|BZeqIgr-GhgnjBi(3VVBw(YqT#&L3BJ(56zG1!oUf_pW54{L%68eSPe4=b4bK* zr!p-+Z1O>d+}76{(H`n^ykB3rpjOpO0O){bojRmot$)6zKiX(h$ooM3dATZ5bBY_00 zv$Wii`C(3vCvd_Gu%Yj|y20JUStOt9Yi%5Z@D*J$y6#p;({+HZs~x8S`t88N>rce>DakTX)dAq8l)8dvuofi|;X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6P~TLMvj{x# z6Tpn}dZZixtqr-53{83uQS=HOcZJy32WGlD8tM>>^boz{3wwo8+>!KsSLA8Bq4c5G zwPS{8EI~15J&dg$@_d5;mV*Teoq_DF0bgJ~d8DDOr_jP0#n-wXG0CCtBO;vfp?~W^ zR5UOjK8jE;S1qaVhCtZx1S}W@ie(O4BzHG~Q7XI-*XLv8@Ac2&cAZiP$*EULKMM^t ziBPkK73c=Pw+aK8M3(isVtPTzUSCx4!LxtiDM0sXFGL;QJF^$!*Z|6RgXkh}wHJn` zD?~+g2hBwQ@{58?ix9;P;U%Q9qxg{NO{HcS=(Te6EZ#S`JsL#=ufW6Wv|?8ILKSI! z8xBHJ`6zy(K&{g;G+v%@=CMOPAqV7kG?FgmD1?n?46-%`bpW5O_W{x%qnJZ(NyC7F z$kUndL*9kBkEby?5kY^>kjK5qSNW9q&#x}eK=)@oV?5o)NP^G!-1zk3R~q71He<)E zV@$n*PcZQ&haMT^q5a4h&K21wr-=xz^yk2f)0Au-=P9N`I>{0t%O1sR`4wXY)+ zIg=Ds65gsLz4Huy!kYx$NXlZ4)vkxA6(`ipBr@B?$#^Hr&L(|hPSk4z=|(1*fKv3l z0&;2;rDr4cbW_?;VXC0mzeOqbM~Po&qKrY_k^ITb8>m + + + Strategy Tester: x-saherelm.osc.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.osc.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2023.01.03 01:00 - 2023.06.28 23:45 (2023.01.01 - 2023.06.29)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_OSC"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=480; fastOSCLength=10; fastOSCMultiplier=1; slowOSCLength=30; slowOSCMultiplier=3; minPowerOSC=0.055; minVarianceOSC=0; zDeviation=5; zBackStep=3; shortCycleFastMultiplier=1; shortCycleSlowMultiplier=4; mediumCycleFastMultiplier=7; mediumCycleSlowMultiplier=14; longCycleFastMultiplier=70; longCycleSlowMultiplier=140; showShortCycle=false; +showShortCycleCrossLines=false; +showMediumCycle=false; +showMediumCycleCrossLines=false; +showLongCycle=false; +showLongCycleCrossLines=false; +shortCycleFastColor=Green; shortCycleSlowColor=Red; mediumCycleFastColor=Aqua; mediumCycleSlowColor=Magenta; longCycleFastColor=Goldenrod; longCycleSlowColor=Brown;
Bars in test12551Ticks modelled15360882Modelling qualityn/a
Mismatched charts errors1395
Initial deposit1000.00SpreadCurrent (57)
Total net profit58.78Gross profit582.17Gross loss-523.39
Profit factor1.11Expected payoff0.78
Absolute drawdown10.15Maximal drawdown322.36 (23.55%)Relative drawdown23.55% (322.36)
Total trades75Short positions (won %)0 (0.00%)Long positions (won %)75 (80.00%)
Profit trades (% of total)60 (80.00%)Loss trades (% of total)15 (20.00%)
Largestprofit trade32.50loss trade-83.16
Averageprofit trade9.70loss trade-34.89
Maximumconsecutive wins (profit in money)23 (247.24)consecutive losses (loss in money)5 (-152.61)
Maximalconsecutive profit (count of wins)247.24 (23)consecutive loss (count of losses)-224.33 (4)
Averageconsecutive wins12consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12023.01.06 10:45buy10.011838.920.001843.76
22023.01.06 13:30buy20.011840.110.001852.61
32023.01.06 15:41t/p10.011843.760.001843.764.841004.84
42023.01.06 17:02t/p20.011852.610.001852.6112.501017.34
52023.01.10 10:45buy30.011874.470.001882.55
62023.01.11 07:36t/p30.011882.550.001882.558.081025.42
72023.01.12 04:00buy40.011880.930.001888.89
82023.01.12 14:23t/p40.011888.890.001888.897.961033.38
92023.01.17 16:30buy50.011915.960.001934.12
102023.01.17 17:00buy60.011913.860.001920.64
112023.01.18 10:30buy70.011912.320.001931.62
122023.01.18 10:45buy80.011912.000.001927.60
132023.01.18 15:30t/p60.011920.640.001920.646.781040.16
142023.01.19 06:45buy90.011909.950.001916.75
152023.01.19 16:21t/p90.011916.750.001916.756.801046.96
162023.01.19 21:26t/p80.011927.600.001927.6015.601062.56
172023.01.19 22:07t/p70.011931.620.001931.6219.301081.86
182023.01.19 22:13t/p50.011934.120.001934.1218.161100.02
192023.01.23 02:45buy100.011930.950.001942.63
202023.01.23 21:30buy110.011928.100.001937.10
212023.01.24 08:31t/p110.011937.100.001937.109.001109.02
222023.01.25 18:57buy120.011937.690.001955.77
232023.01.25 21:57t/p100.011942.630.001942.6311.681120.70
242023.01.27 14:15buy130.011932.410.001941.85
252023.01.27 18:45buy140.011931.740.001962.44
262023.01.31 17:15buy150.011922.500.001941.44
272023.02.01 21:43close120.011938.200.001955.770.511121.21
282023.02.01 21:52t/p150.011941.440.001941.4418.941140.15
292023.02.01 21:52t/p130.011941.850.001941.859.441149.59
302023.02.02 06:45close140.011953.230.001962.4421.491171.08
312023.02.07 04:45buy160.011874.080.001882.44
322023.02.07 19:48t/p160.011882.440.001882.448.361179.44
332023.02.08 02:07buy170.011874.940.001882.96
342023.02.08 09:56t/p170.011882.960.001882.968.021187.46
352023.02.09 05:00buy180.011879.500.001891.10
362023.02.10 16:30buy190.011867.550.001879.53
372023.02.10 16:46buy200.011865.500.001873.38
382023.02.10 17:18buy210.011866.930.001883.07
392023.02.16 10:00close180.011841.080.001891.10-38.421149.04
402023.02.17 21:30close190.011842.050.001879.53-25.501123.54
412023.02.17 21:45close200.011841.760.001873.38-23.741099.80
422023.02.17 22:15close210.011842.420.001883.07-24.511075.29
432023.02.22 04:18buy220.011836.810.001840.77
442023.02.22 10:05t/p220.011840.770.001840.773.961079.25
452023.02.24 04:30buy230.011826.890.001832.79
462023.02.24 05:15buy240.011827.540.001834.30
472023.02.24 08:15buy250.011825.790.001829.71
482023.02.24 08:30buy260.011825.830.001829.83
492023.02.28 19:25t/p250.011829.710.001829.713.921083.17
502023.02.28 19:25t/p260.011829.830.001829.834.001087.17
512023.03.01 08:15t/p230.011832.790.001832.795.901093.07
522023.03.01 08:32t/p240.011834.300.001834.306.761099.83
532023.03.02 17:33buy270.011839.300.001854.26
542023.03.02 17:45buy280.011836.180.001842.78
552023.03.02 20:52buy290.011835.880.001843.44
562023.03.03 08:42t/p280.011842.780.001842.786.601106.43
572023.03.03 08:48t/p290.011843.440.001843.447.561113.99
582023.03.03 22:04t/p270.011854.260.001854.2614.961128.95
592023.03.08 17:00buy300.011820.920.001838.76
602023.03.09 10:45buy310.011819.070.001832.05
612023.03.09 17:02t/p310.011832.050.001832.0512.981141.93
622023.03.10 15:31t/p300.011838.760.001838.7617.841159.77
632023.03.14 20:30buy320.011909.590.001918.35
642023.03.14 20:45buy330.011908.470.001914.99
652023.03.15 13:30buy340.011912.290.001944.79
662023.03.15 13:32t/p330.011914.990.001914.996.521166.29
672023.03.15 13:33t/p320.011918.350.001918.358.761175.05
682023.03.17 14:33t/p340.011944.790.001944.7932.501207.55
692023.03.21 04:55buy350.011984.480.001995.38
702023.03.22 16:45buy360.011945.310.001959.07
712023.03.22 20:02t/p360.011959.070.001959.0713.761221.31
722023.03.23 19:34t/p350.011995.380.001995.3810.901232.21
732023.03.28 08:45buy370.011960.000.001967.16
742023.03.28 15:38t/p370.011967.160.001967.167.161239.37
752023.03.30 09:30buy380.011967.110.001981.19
762023.03.30 19:33t/p380.011981.190.001981.1914.081253.45
772023.04.03 14:00buy390.011972.870.001992.83
782023.04.04 15:15buy400.011984.560.001997.18
792023.04.04 16:46t/p390.011992.830.001992.8319.961273.41
802023.04.04 17:00t/p400.011997.180.001997.1812.621286.03
812023.04.06 14:15buy410.012020.250.002025.97
822023.04.11 05:30buy420.011996.090.002011.05
832023.04.12 04:37t/p420.012011.050.002011.0514.961300.99
842023.04.12 15:35t/p410.012025.970.002025.975.721306.71
852023.04.17 15:00buy430.012009.490.002019.07
862023.04.18 10:29buy440.012002.540.002011.86
872023.04.19 22:00buy450.011996.680.002003.18
882023.04.20 13:29t/p450.012003.180.002003.186.501313.21
892023.04.20 17:08t/p440.012011.860.002011.869.321322.53
902023.04.24 12:15buy460.011985.670.001995.83
912023.04.24 20:00close430.011986.450.002019.07-23.041299.49
922023.04.25 02:42t/p460.011995.830.001995.8310.161309.65
932023.04.25 20:30buy470.011994.280.002006.76
942023.04.26 16:26t/p470.012006.760.002006.7612.481322.13
952023.04.27 06:00buy480.011999.130.002015.61
962023.04.28 17:45buy490.011988.940.002003.12
972023.05.01 14:15buy500.011987.350.001996.19
982023.05.01 15:24t/p500.011996.190.001996.198.841330.97
992023.05.01 15:36t/p490.012003.120.002003.1214.181345.15
1002023.05.02 13:45buy510.011988.110.002003.63
1012023.05.02 17:15close480.011999.650.002015.610.521345.67
1022023.05.02 17:28t/p510.012003.630.002003.6315.521361.19
1032023.05.08 11:45buy520.012022.380.002027.64
1042023.05.08 18:29t/p520.012027.640.002027.645.261366.45
1052023.05.10 15:45buy530.012046.500.002090.02
1062023.05.11 03:15buy540.012032.950.002038.13
1072023.05.11 14:32buy550.012038.380.002062.76
1082023.05.11 14:33t/p540.012038.130.002038.135.181371.63
1092023.05.12 16:47buy560.012020.820.002054.00
1102023.05.12 20:02buy570.012014.980.002028.60
1112023.05.17 20:45close530.011981.850.002090.02-64.651306.98
1122023.05.18 19:30close550.011955.220.002062.76-83.161223.82
1132023.05.19 21:45close560.011979.300.002054.00-41.521182.30
1142023.05.22 02:00close570.011979.980.002028.60-35.001147.30
1152023.05.23 17:30buy580.011969.700.001991.80
1162023.05.23 17:45buy590.011967.930.001978.41
1172023.05.24 07:30t/p590.011978.410.001978.4110.481157.78
1182023.05.26 09:45buy600.011951.870.001962.05
1192023.05.29 15:00buy610.011946.780.001952.32
1202023.05.29 15:15buy620.011945.930.001949.77
1212023.05.30 12:55t/p620.011949.770.001949.773.841161.62
1222023.05.30 12:59t/p610.011952.320.001952.325.541167.16
1232023.05.30 15:20t/p600.011962.050.001962.0510.181177.34
1242023.05.31 02:00close580.011958.460.001991.80-11.241166.10
1252023.06.01 14:30buy630.011967.510.001983.01
1262023.06.02 06:21t/p630.011983.010.001983.0115.501181.60
1272023.06.05 17:30buy640.011959.060.001992.22
1282023.06.07 17:00buy650.011970.110.001996.37
1292023.06.07 17:15buy660.011964.900.001980.74
1302023.06.08 15:38buy670.011957.110.001981.87
1312023.06.09 05:30close640.011963.620.001992.224.561186.16
1322023.06.12 11:30buy680.011964.510.001976.49
1332023.06.13 13:55close660.011965.420.001980.740.521186.68
1342023.06.13 15:30close650.011970.760.001996.370.651187.33
1352023.06.14 12:31buy690.011952.480.001961.02
1362023.06.14 15:36buy700.011952.840.001967.32
1372023.06.14 15:44close670.011957.620.001981.870.511187.84
1382023.06.15 17:15buy710.011956.020.002008.72
1392023.06.16 04:46t/p690.011961.020.001961.028.541196.38
1402023.06.16 13:53close680.011965.040.001976.490.531196.91
1412023.06.16 15:15t/p700.011967.320.001967.3214.481211.39
1422023.06.20 10:45buy720.011955.420.001968.94
1432023.06.21 21:45buy730.011937.390.001945.49
1442023.06.21 22:00buy740.011936.290.001941.61
1452023.06.23 01:45close710.011913.380.002008.72-42.641168.75
1462023.06.27 05:45buy750.011928.250.001937.95
1472023.06.27 15:45close720.011927.430.001968.94-27.991140.76
1482023.06.28 23:54close at stop750.011906.650.001937.95-21.601119.16
1492023.06.28 23:54close at stop740.011906.650.001941.61-29.641089.52
1502023.06.28 23:54close at stop730.011906.650.001945.49-30.741058.78
+
diff --git a/Docs/Reports/14020427/StrategyTester 1.gif b/Docs/Reports/14020427/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..1f3c0ce15cc22fa0bdfa7620309916ecf514fbc9 GIT binary patch literal 7328 zcmch*g;NyH|37||9*rozkP`yYNgyE8k_N9=QVXJ>X-O+!^$#_~Bu4`2-dAdyG_0AOHXfK=TNf*(|a z!PVEHYA^^+09-c`i2w&(hpNHX%T3`*P52)X z0038CORvQs02mAa{Lhkf4OfH9KuvJcDj0O_55I;$plcGi2>|E^ftpCy0HBQUKT~iS z0K7`NR=}^pvTN`dx+eYK$ko>@0_i$o@HGY~1A_pd>v{kGUxcq$AMk&B0k}zm00IJo zfX!Xu!Ou&8KwOl(|yLSj;KN-82PJtH$KJ0~|Uzn~C_LSu@GOG?YiD=MpgRoB$k z)i*RYHMd|}+uA!iySjUN`}zk4aYMsJWMktKlT*_(c*5-5{KDeW^6!<^wRPgg=GOMk z?w`H=gTIIWj*j=r$TG<&Kg(H{ZT4+W45=lQ1{(EQL10htKRBqs_{Ka zsCxbun}*5aWm5vYBcsSE$pJwYhy5vOD8IoZKaP;!2<+1Y8HZzxG`^C^kT66w26cmM z_^Rj}SrmBFi`sVXb!{0h3MHo!#;x2IR2GCZ%Xvdq5lqV}Zv7_D^2LKbxXh2NHRUn# zhEIBoE_-D5n}&rlBTqVx{^jB0X3@SsK)bVZK2JKq9b`e4gwT)&g(kqNX?M~HKOI?mQq|UeHDLioGC32P2s>xc7S1$mmlX zvy|xpCgB0}QWlUG3?QYMl{mm6-~4VF$SC(A*+W!|6x7ZK+#PvNyEE2-V;&G2Bj}X{F&$B@ zVUs)OiZ?a0)&7pM2~iOgEWEKzjp2^^RAb{>rGV$QYh8;dNbTHAEGl~FEMaFCCc-XI z;^vZCn1jyfvqj6%jZiSYj6AYI;V0SbplNqU>|E=`A^g=&ys5UejxPO4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ORm{!h=2ar6 zs&y4IVB)R~waBRKx{_n}bo||$BD&x;Ter0lf)esA5d$5r4Ub4D0W8P@{w%f9GV5NH zp8eYP09pny>!@1> z-!%)f3}JKXu?*$%1%3)+V{TKv*_OaR>$#TjZdRtf%7!{Jt_L^`m85y``+*Fo;=u!X zk%L@bWiIhNo>w`pR$kJNsRv?$q-AoYmCJ>g18HX_-~Z)3X!n+z}H{pDEl8GPy%sWYyjW1kPRd`(gqDkPl_eSaA&8I+ZWd! zY-}PR&3%|c>{$pJor6X5=Vo#v2nF2-cJ`>DvjQQhe`LcDMBbw6rq~Sm-$%54Ic;RX z&UjmX4*yYG2ho-vuU+{S@iB`#M?jIyWqE98!{tY{`|Vg zarxSco|V1dT=0ftw>ES3TvYhZJDGh7x-54wzGJ~{&1&XK%ue@gmitbpEZsl^#j~wX zmACHOXlZu05xf7EH$1U;+OXIu{5?Z*%;8`#a8|Q#lyn42KSZq6^Sbu3zoS3wkXld^ zpcZ4dw@ZE-`lM$DzSj7CS|OLydio}v>2u^m$j+~s_b;?0#_>MT=k4CKc(NH`*nKIPRaSN+3pEZig8nhkK;3g$5u+? zE_$_K_zJuf(1rsn=jf_<6N?tj=64&F6@1o;Fr%LMKAcSnm))pqPO!|Tn&9-1d& z_y-R8A`2oG@&XIbTqKV&UuSv_dS|wTt?mh_)Fb?9GpwgPZ;O+7YNH1mk3Q^rW+t2M z_aw;d4$^p$Q_k#AA{8m??R-|fgUHScfrm(4(jDT{MM;j2HChhCHm!TYKlvKoZ?fr<)VQ55>PJ0b oLGwMiL%85+bojt$!S5*p4h7FLsRwN|zo(8<6&09}lL2J^AB9390{{R3 literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/StrategyTester 1.htm b/Docs/Reports/14020427/StrategyTester 1.htm new file mode 100644 index 0000000..3057841 --- /dev/null +++ b/Docs/Reports/14020427/StrategyTester 1.htm @@ -0,0 +1,77 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.02.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test4192Ticks modelled3544155Modelling quality24.42%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit54.27Gross profit54.27Gross loss-0.00
Profit factorExpected payoff10.85
Absolute drawdown29.71Maximal drawdown53.15 (5.19%)Relative drawdown5.19% (53.15)
Total trades5Short positions (won %)0 (0.00%)Long positions (won %)5 (100.00%)
Profit trades (% of total)5 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade20.17loss trade-0.00
Averageprofit trade10.85loss trade-0.00
Maximumconsecutive wins (profit in money)5 (54.27)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)54.27 (5)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins5consecutive losses0
+Graph
+ + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001828.18
22020.12.02 12:22t/p10.011828.180.001828.1813.621013.62
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001864.07
52020.12.07 16:49t/p20.011850.470.001850.477.371020.99
62020.12.07 17:46t/p30.011864.070.001864.0720.171041.17
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321044.49
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781054.27
+
diff --git a/Docs/Reports/14020427/StrategyTester 2.gif b/Docs/Reports/14020427/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..e902f9a3b8a168ca11ffce4c62ada5658ff11809 GIT binary patch literal 7581 zcmch5^6^^EH}_c=e^FEpPkD8740GyvEH0PuJ`000;n8Np+QL5LHKogL;j zg|P!6aDdx|$Kw#7+Z4v`mU$Zj@Hi|8PzAW1AngC+;ZG2t{}O;<%q8%(9umk+(b^EwAzGYzSsz9v>{KoAI0*A1(1KcLpQRZJT%m2y|QER))dY;clC=Ltt*JB0w12ZGb`GZe4GkTW^(^VE||t z141BfNw-`4Ur)EB|5e7^vT*p@p6zZiK$YF?zW@IZvD>c?_}^Io$nX$ANN8AiL?jdz z1&@x2jYGsIBqk-Nq^6~3WFoV&b8_=g`2}AKi;B@DrDf$6l~vU>wRPVx^$m?p%`L5M z?H!$6-95d1{R4wT!y}_(;}c~B-=}A0=dkk&xW%RAA1gms*VZ>Sx3+h7_x2ACkB)zx z{678j_up|9K@Q>7P4+e5W{(N6qNYbe&$XC@`1x3unpbs%DSq{-4)cQ>+`p)N^)Eb+ zqF%EmtZPKxH^@#(OW4qYi@$4|W=$;YH}r5l1VpF`6bQ01@r9Uz*fU1XXp)dLbVv(i1}inybjK4E$7Etk(WC?uH)WT_ zWuat#?)4OM(-wDMypk9t>FRamhl>Lo!0)JjKLg|Bv zAYaw^AWIDVvGA>M)?^#TclyM4?#(BdQVQ|NYyC8dH>D9-x607{r?yjF`;7!C0-(_V zx)Df+aF_${4M5$CNw#@--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*W4J(cRT;vG5|V1Rk^Bw5gmQz!_#vcyKDZ<1;X(w5fVHq)98}G!_xGt z6~VT1W*fH@h1`86C~pLc>^jzwdr-r`e4Q z6W?1QxM5MNh=GK%Gw~9qlc|&L+I%E_x=bB7OF)MjClFpIZi)R%PDv=~2`1v3GZ?;%Y*pe_-loB@xAa3^!E_uzSQjbMk8Ps*hulLbmr7`xNwz6MUKW zdN%LyXllD8(DN6p-{CarJzMfff+P4unF*dJ|CxxC9k!;X{x$S;;#VkC=K~XqChP?% z!>2br>p0dO?ZeT@RLs4?1ywe!7eJZRC_ExrSd>@v-Qi>KgQOl=k~4CZkghjbxpw>m z{f)6pC#k^GO}0c>H;z;C%Sp?|x*d4vU4@MCuDRWE!_Ej9CNb`~U{RT$SI6_>H{JS( zmGmeWsD}EUXGCmr{`$|TW`R~_vq$Et(Tifhr&meo1y=O(59;E&DiX7V%ms}}n-S6g z1HKsH{5Jct(8nQ#3MvBkeKQP2Z(bL=J+V1_zc7-&%v6}l!$GJlGOekQT$JYF^s+SL zJ3}^8redqptB)D46Qn5!B(8Uj(?yJ)7|fL6hj#~;Ddrl6yemGHms%V}&9&@$R|XuE gTHz_M9TYxQVd7=)XyMo%5ufU45 + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.02.26 23:45 (2020.01.01 - 2021.03.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test6016Ticks modelled6166924Modelling quality24.60%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (50)
Total net profit35.23Gross profit66.77Gross loss-31.54
Profit factor2.12Expected payoff5.03
Absolute drawdown29.69Maximal drawdown53.15 (5.19%)Relative drawdown5.19% (53.15)
Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (85.71%)
Profit trades (% of total)6 (85.71%)Loss trades (% of total)1 (14.29%)
Largestprofit trade20.17loss trade-31.54
Averageprofit trade11.13loss trade-31.54
Maximumconsecutive wins (profit in money)6 (66.77)consecutive losses (loss in money)1 (-31.54)
Maximalconsecutive profit (count of wins)66.77 (6)consecutive loss (count of losses)-31.54 (1)
Averageconsecutive wins6consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001828.17
22020.12.02 12:22t/p10.011828.170.001828.1713.621013.62
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001864.06
52020.12.07 16:49t/p20.011850.460.001850.467.371020.99
62020.12.07 17:46t/p30.011864.060.001864.0620.171041.17
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321044.49
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781054.27
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501066.77
132021.02.10 15:15buy70.011844.620.001857.72
142021.02.12 10:19close70.011814.620.001857.72-31.541035.23
+
diff --git a/Docs/Reports/14020427/StrategyTester 3.gif b/Docs/Reports/14020427/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..7728f57acb6914c563a73e2fdc295e1b54eff50d GIT binary patch literal 7362 zcmch5^WHu0Rl;_#Y7f zutr@;uf!mLHQ+z5tKXIJ6$52m1!{wm)~+T{BGlR%a85BBf&ZsLEk#v>W`U(S7U8S(T3URgi|DTV<)$RlScNPE|QZOJi zEIcAI3Ji&kiH(a-fF>p-e@jVCgQaI=!m|+BIk|cH-wO(hic3n7W#tu>Rn;}Mb@ix* z#-`?$*0%PJ&aUpB-oE|;^xzO?cw`hiRz@~4IW>*L6K06BbMp&}OUo;(YwH`ETiZLk zd;32RejWb)^Y`D;K^0jx`S~T{0&ux=1G=dCl8S|I_8WBRiS9K4mEjwS%TIOKWG{(F z(fMj2{EwsGa3rm2M%~p%e1j#eX~jrdwoh^-7Y-Oc%HNtDtSx%=np2vp{z09AzSeW$ zyD4=K3_9V+96>Hsz-uy!yox+f@ZwkqB^~A0I61=~cfLC0J6T^aRYW)*W6IUi>~!kE|wwp5va4-gis&+e1(V_ndXL z3G$YY`b@3|WDeUVMG8M8d;k6YK9f9K8t4w%pPloU?6dAA3%4XjMcytl1J>c~EU3N$ zmrk3&EI|~(1*(FTiUTb&pZdD^ z#M?Dx8bDE0Z4HQ8nJU)uDT1?4)8Cd5B4eP|Te}UV=sn0MyEnYZLAv(v+!#$KK@Q0F zzk!DmsJUhVs;Q!jPzq|$Zf6+(O(o8|fo}}gRhjV0%)w055(ie#!6qEeZt|%YB|Ygo&_c2FV7>P_mvXkKed+UE4pAq{n`}K2as?coXLTLS~E) zAi$JEIY?P73?5=;UIz4rnWb`4b4%pj4KQ)?p$Pc%VlbRvyOE*RJzsZ%&AX56KoHQ^ zms&R-!q!-4rYo<{3s@YSN(lnMQGX^RJQ2A+N6dBz?{3VVc;Me zbH^nr-W$FO2-LLAbFMjl6LIMDZV@j!HbRmfOr8m&4mIt1`OvD1>GGRK9Hpk38_Ctm<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ntujZQU!@pjE-(|M=l(LaqH?d)EvFU@ z8#*ymJ4JuSlT_yZVD*^D%SAsu_DA8tmo1nXm5Eu;X$f^+OXTf47kiby73B^5!9`*Z zr+h!~Hs<->>a52##Y2zgf*P`1iFONN&iK2p+wEuq*!O~$+JGg5v2l$vcD3CYMaL74E^4O%HI%~yA6Q&YOwuly^ zISpO3kq5@-zi-`9u~mBpv<=Q@9;5m7_1=J8Xyk{O{=bDw*&lijSky2^2oZEw%^uWS zsEnsi(;6jg!2F*14nHtaKKFLsn5lx90P!2FO{kwfI_-Foslgb`Z#ojLF7fmzy0M?| z>xJ#PAI z%b->g^NsWetGn_i=+7ym9~0gPh>8+4-%`?(`JI0fHcTIUTQ;6tQ}=xlXrit?Zjh4t z;4^ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.02.26 23:45 (2020.01.01 - 2021.03.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test6016Ticks modelled6166924Modelling quality24.60%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit56.23Gross profit56.23Gross loss-0.00
Profit factorExpected payoff8.03
Absolute drawdown36.52Maximal drawdown53.15 (5.23%)Relative drawdown5.23% (53.15)
Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (100.00%)
Profit trades (% of total)7 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade12.50loss trade-0.00
Averageprofit trade8.03loss trade-0.00
Maximumconsecutive wins (profit in money)7 (56.23)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)56.23 (7)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins7consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001821.37
22020.12.02 10:36t/p10.011821.370.001821.376.811006.81
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001853.79
52020.12.07 16:49t/p20.011850.470.001850.477.371014.18
62020.12.07 16:52t/p30.011853.790.001853.799.891024.08
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321027.40
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781037.18
112021.02.09 03:15buy60.011835.690.001848.19
122021.02.09 11:54t/p60.011848.190.001848.1912.501049.68
132021.02.10 15:15buy70.011844.630.001851.18
142021.02.10 15:37t/p70.011851.180.001851.186.551056.23
+
diff --git a/Docs/Reports/14020427/StrategyTester 4.gif b/Docs/Reports/14020427/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..190c6f7ae1de3bcf2478e2eaaddf11aa372ec0fd GIT binary patch literal 7446 zcmch5_d6Tj`**03*rhF^MpbRvDy6Y?*tELr)z)5BwW*qk8N?>`2tlj}v0HoZ5!BwR zs7=1!pXYyg&UMap-PipZ=f2PR=^SO%S5nW+#BX!}RsaAZkq7_)dU|?@*lq}XA8TQ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&k@7 literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/StrategyTester 4.htm b/Docs/Reports/14020427/StrategyTester 4.htm new file mode 100644 index 0000000..3f65e6f --- /dev/null +++ b/Docs/Reports/14020427/StrategyTester 4.htm @@ -0,0 +1,87 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +

+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.31 23:45 (2020.01.01 - 2021.04.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test8132Ticks modelled9612073Modelling quality24.70%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (50)
Total net profit80.25Gross profit80.25Gross loss-0.00
Profit factorExpected payoff8.03
Absolute drawdown36.50Maximal drawdown53.15 (5.23%)Relative drawdown5.23% (53.15)
Total trades10Short positions (won %)0 (0.00%)Long positions (won %)10 (100.00%)
Profit trades (% of total)10 (100.00%)Loss trades (% of total)0 (0.00%)
Largestprofit trade12.50loss trade-0.00
Averageprofit trade8.03loss trade-0.00
Maximumconsecutive wins (profit in money)10 (80.25)consecutive losses (loss in money)0 (-0.00)
Maximalconsecutive profit (count of wins)80.25 (10)consecutive loss (count of losses)-0.00 (0)
Averageconsecutive wins10consecutive losses0
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001821.36
22020.12.02 10:36t/p10.011821.360.001821.366.811006.81
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001853.78
52020.12.07 16:49t/p20.011850.460.001850.467.371014.18
62020.12.07 16:52t/p30.011853.780.001853.789.891024.08
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321027.40
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781037.18
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501049.68
132021.02.10 15:15buy70.011844.620.001851.17
142021.02.10 15:37t/p70.011851.170.001851.176.551056.23
152021.03.10 03:15buy80.011718.560.001729.52
162021.03.10 15:15buy90.011714.680.001724.00
172021.03.10 20:33t/p90.011724.000.001724.009.321065.55
182021.03.11 04:07t/p80.011729.520.001729.529.801075.35
192021.03.16 12:30buy100.011733.030.001737.93
202021.03.16 16:22t/p100.011737.930.001737.934.901080.25
+
diff --git a/Docs/Reports/14020427/StrategyTester 5.gif b/Docs/Reports/14020427/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..a43105aaa04f6795435402094a5887d7d46b5165 GIT binary patch literal 7769 zcmch5^;=Zm_x%hY4h@1dNJvVE3c@I*poCz6NJxpm0Fp{d=P=Yz(%s!d4P65aox?D6 zw}dqF;r0Ih58w0L^W1aSUTf{W&v~Bn!+op#MpDZ786gU=1_0pkcmM!^Mx*hFelYwH zVP=N7g%D<7I2Ld_@pvp8d!mJ$J1jn!5e!#JCGc&*~Xa)v=5oS#QKtCAVgujge z%CY~mHY*31t>SM*@Y`V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%w{{SK^;F16U literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/StrategyTester 5.htm b/Docs/Reports/14020427/StrategyTester 5.htm new file mode 100644 index 0000000..9ed9171 --- /dev/null +++ b/Docs/Reports/14020427/StrategyTester 5.htm @@ -0,0 +1,99 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.30 23:45 (2020.01.01 - 2021.05.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test10063Ticks modelled11947707Modelling quality24.76%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (51)
Total net profit76.08Gross profit106.85Gross loss-30.77
Profit factor3.47Expected payoff4.76
Absolute drawdown36.52Maximal drawdown59.05 (5.44%)Relative drawdown5.44% (59.05)
Total trades16Short positions (won %)0 (0.00%)Long positions (won %)16 (93.75%)
Profit trades (% of total)15 (93.75%)Loss trades (% of total)1 (6.25%)
Largestprofit trade12.50loss trade-30.77
Averageprofit trade7.12loss trade-30.77
Maximumconsecutive wins (profit in money)12 (85.99)consecutive losses (loss in money)1 (-30.77)
Maximalconsecutive profit (count of wins)85.99 (12)consecutive loss (count of losses)-30.77 (1)
Averageconsecutive wins8consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.560.001821.37
22020.12.02 10:36t/p10.011821.370.001821.376.811006.81
32020.12.04 14:15buy20.011842.710.001850.47
42020.12.04 16:15buy30.011843.510.001853.79
52020.12.07 16:49t/p20.011850.470.001850.477.371014.18
62020.12.07 16:52t/p30.011853.790.001853.799.891024.08
72020.12.18 01:00buy40.011884.910.001888.23
82020.12.18 14:09t/p40.011888.230.001888.233.321027.40
92021.01.05 05:45buy50.011942.150.001951.93
102021.01.05 16:16t/p50.011951.930.001951.939.781037.18
112021.02.09 03:15buy60.011835.690.001848.19
122021.02.09 11:54t/p60.011848.190.001848.1912.501049.68
132021.02.10 15:15buy70.011844.630.001851.18
142021.02.10 15:37t/p70.011851.180.001851.186.551056.23
152021.03.10 03:15buy80.011718.570.001729.53
162021.03.10 15:15buy90.011714.690.001724.01
172021.03.10 20:33t/p90.011724.010.001724.019.321065.55
182021.03.11 04:07t/p80.011729.530.001729.539.801075.35
192021.03.16 12:30buy100.011733.040.001737.94
202021.03.16 16:22t/p100.011737.940.001737.944.901080.25
212021.04.06 13:30buy110.011732.050.001734.85
222021.04.06 14:24t/p110.011734.850.001734.852.801083.05
232021.04.08 03:00buy120.011737.150.001740.09
242021.04.08 08:01t/p120.011740.090.001740.092.941085.99
252021.04.09 04:30buy130.011756.920.001760.31
262021.04.13 08:37close130.011726.920.001760.31-30.771055.22
272021.04.14 09:15buy140.011746.430.001751.74
282021.04.14 15:39buy150.011746.670.001755.93
292021.04.15 15:19t/p140.011751.740.001751.744.151059.38
302021.04.15 16:54t/p150.011755.930.001755.938.101067.48
312021.04.21 14:15buy160.011782.360.001790.96
322021.04.21 16:49t/p160.011790.960.001790.968.601076.08
+
diff --git a/Docs/Reports/14020427/StrategyTester 6.gif b/Docs/Reports/14020427/StrategyTester 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..c3ebb99217bbbb89e48583f0a5bc73eed579e47d GIT binary patch literal 8177 zcmchb^;;Co_xBeRSQ@p-meog^V`VE%Lt2n=YP}-*Z=@97z_Xa7#JA9Ap5~lCrC3hUVB=7B((m4ln3FzaUE2S?O{3I;!LX3YRVKN#GMc@O~Q=>O$4D+idZ zV;&-+9>nqo@u5dd)B_F%0{~zo(hU93nOPL_p=1;oiGDDUQRs)14{4hpB9Z+7a6b|p z74-l;obSJe9-#lqA|EI;=AmJ;2Mthe1_pp1&i(&?aQ=5Q|GfnO5915)4+snj4uOP* zg-1YPkx|hxvA^Tu6X1x%q~w&;wDgS3tn8fJy!?W~qT-U$vhs?`s_GhKZC!msV^ecW zYg>EApU$rCp58uG|G?nT@JKP%_{8MY^vvuWdVXPXX?bP!@7nst=GOMk?%w{v;nDHQ z>A$n{i=%R^H0;~^)H}fa?$fAcDHR-Y`uX2cEAN$wUr7u+jb4>jdd7Q?z6i^D=f@x! zrcM>JCKtk_n)(|av#t;h`ra}@6`R|mA(XW}-&d9Q>B|dloErXWHB|*!7N)prezmsb zqI5=TDZm%3N13IWVBh5tzsCfRe?SE_MzL`NPzqq3&?0Sldkj`SGznQ$fQvP9Uwo5a z9DwJJZ@HjYSI$^aAod=@@UA1UJTPBB^D|au5Fr(x`RDBKA6}!PM4Zz%-i>278mW>x z9${JUXyu8Ff;!L7vgcyw3%#Ae2lES_pf0mctibQ+kl@#Oy1?ogOGBI=z!ho$4mp+# zRb8r=s7vD;1=^RxguLus%pIvfPPs~^n&+RT?0$DtG1kzk547?p9r%qI4^BOID10o( z@Tv~K7ij13DxKkVO9u0DKw#6y@2@CjVqP)RFt5J!voG;ovGd9Jh(!oer$k$FFgj3M z<2uVNMijzb3EaQef9^1P(qstuDt0XlAQGo03m}3GN`1gY1{E`;G8_-ez9UB1ru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*V*iSbi}${bNpFh}uw>JP&5Tc_ zC(Q;Ym}HbV4W;rzGP2)#TClS!4Cg8FvpoXkv;Gr_BYfwa+F1Qjy)J)LOMzAxHj4`WQxgfQ*NsU|H;$%2GV4#qontdIMTp>u?XHBEU!8r=aQ}jKbJ*+lH zfWnNfNLI4qDXvsaNg;4g=L@-}%#-I8HsTx@jT-i_Hpgd_q3at4BIKIo`hpaGXB=FQ zoo3XfYbsgfN23&u84R=IE5&#^@EDT9`mh7Am3>PTQYwAB!oG^^?SN*r%pE9g`-B|tFsV~ z%@#?-6;!#4hOGX4&A9_IgmR3K=uSWP|IudsD?>5(#Hj4YzPYzw*vwMLMGIubmmmsd z_|EM|YuEY~B@XQpfvRasvH+K#sLl7sJ?HIbIY%tCx4&`HF53Zc9N0=TmhWU@9&$U)n46}&S)pGO}sDLeXm`%lW2ad zv29+laaNv0-05y8X6Fwfrx^^vPJ<;H{2|P)Gd+ZM8aM$s&W#uii{nfkKhvEk*PkS?knK1=AGBYmbJf zk+=drlYh1pk18hUEiL^j_zfj=w7Zk0T=ZsdEkQ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2021.09.30 23:45 (2020.01.01 - 2021.10.01)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test20043Ticks modelled22474457Modelling quality24.88%
Mismatched charts errors0
Initial deposit1000.00SpreadCurrent (60)
Total net profit87.01Gross profit151.26Gross loss-64.25
Profit factor2.35Expected payoff2.90
Absolute drawdown36.70Maximal drawdown85.54 (7.74%)Relative drawdown7.74% (85.54)
Total trades30Short positions (won %)0 (0.00%)Long positions (won %)30 (83.33%)
Profit trades (% of total)25 (83.33%)Loss trades (% of total)5 (16.67%)
Largestprofit trade12.50loss trade-30.77
Averageprofit trade6.05loss trade-12.85
Maximumconsecutive wins (profit in money)12 (85.99)consecutive losses (loss in money)3 (-32.06)
Maximalconsecutive profit (count of wins)85.99 (12)consecutive loss (count of losses)-32.06 (3)
Averageconsecutive wins6consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.371014.18
62020.12.07 16:52t/p30.011853.880.001853.889.891024.08
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.40
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.18
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.68
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.23
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.55
182021.03.11 04:07t/p80.011729.620.001729.629.801075.35
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.25
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801083.05
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.99
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.771055.22
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.151059.38
302021.04.15 16:54t/p150.011756.020.001756.028.101067.48
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601076.08
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 16:04t/p170.011843.260.001843.264.731080.81
362021.05.14 15:16close180.011837.920.001846.05-1.421079.40
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041084.44
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.931091.37
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621093.99
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:39t/p220.011816.230.001816.236.471100.47
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.771069.70
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.04 16:09close240.011830.460.001835.53-0.651069.05
502021.08.04 16:22close250.011830.700.001836.63-0.651068.41
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.591074.00
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041078.04
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741080.78
582021.09.15 15:24t/p280.011806.410.001806.412.381083.16
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851087.01
+
diff --git a/Docs/Reports/14020427/Whole StrategyTester 1.gif b/Docs/Reports/14020427/Whole StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..db66459323dc6462eadb6731501eb85a470a67a6 GIT binary patch literal 8822 zcmch5^;Z+#|Nm%4Hxnc*QczH8fPf+$qEe!$bSp@AGX{)FcgKJMqsB-9$ISR=0C+qe008v$_2JRIVE7^0!UBC8 zLR*00(}3H7$4|q-w;{B}E%SB?z)w$t0Vu$22T%S#9{vyx{x1ONMc;zp$?5-y0DuMh zR(dN211u~6fd4GUElu-x+VQDGy0Y_jlV6};uZs-EWiNp?YjT}x5u};5BT3%0LbwEfWV;OkkBwl zI5Z+M3Kk9j850{9pOBc8oRXTBo{^cAos*lFUr>lBDlS2mmX)I_Dyyn%(6yMl`i91) z=3gzXZNJ+)I=i}iu)Tf#1A{|If|1d&@rlVP-1N-s-2B4g(%Vp#WkEV#g?PyNh+AA}SSKQbbBHbc4J? zAcM#}f!4F?7}WiuBAJ&EZiTjBR4~Fg=M6z+2qj3=@=e~?R}ZjoDd((Jg%QFA6CGNo zeFED}!$PTHq4v|0JY4Kdv9B|DcV^aGsKcV2Ao%NaSm=YokL1tq(cGiDrUr=bJV%k0 z31)HM_n)PI2#Z(?0mUydeAOgoc{mmGfs&V7;^m^@&kr>G%b!y;&*V2Ms%l8m1OPND z@%IBfM{xrDHpZ5$ zk?B?o?$0~l&hf8>j1dAOR2KpX-k+TR1w1*o0#J!a^8ChAy`o! z2JnAGAwJ_zKqIwImmm9v(0@KIUJ6A7969*XLMVGaL=`nSDLaM2;K?S5V;2fU|OQ zI807-Autd~$<7SjwD|(dz#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{LU4NQ` zE?n*(EKb&*>23>Qfog?-Ob3ps%HgC$J-e`D<&vqPAT>(0V$(SFzTUvU6J9Ix5(OmN zc+I6_nH3eqK8wlJFszK*!fsn@(vz-RT%I5O$&@AYzS->fQPtG7fQ?_ytq4v<}jVl`nRGT^$F%WPH5EhoFbzG&3KGFddKW`6uKL6 zSfx7%Sq0OS#KxtHvE9LFO{eU{wpFU6^I@shW7ovCb*;?$L1`Eeb|v$dyEb?{JM={T zi}yC~9`Tfj>|yo~lQk|p@$_r0LpPbIrNicwR?D)3^uM##u6y<9cVGBu0KR=etY@{- zD3ex79HXw6ZbpDmeW#f3vL3vaPa-DMr7l!BT@wFsg`Z(zF=KAJTXRBfQ2zEVp_2MFkT>6n&*|{9^ z+%|7?^Wvb+i4I_X1wPWSKaKVgW1YL47xu=zqZd6)CG4ntd(iP$&wNea#M!Cp<<;jw zAX_gN_@?<$SNlCIgIl6U`_UmD!?Sl^r&A;<~$!MXX7LMR#z{a0ChZ70Na*L+M8 z175fV7BJrT2r*^?~DszDRMO zt200Hp&-35`$i?tMYJQ&yWql>j}xx`=|jQMRnAfdU}cQ?dr3jTFG2AD`vOxJ2cn=B zR|i=)ifG1Azk(3{XVXCvNs`)C0mc*J`vsw3D{@PHuz6U3nEUtVc`>+=8ZT>@F0By!IMJe&`^hQNYgp6j6A$b9~j98 zjw=9Q5fRbdw?CYbR9TS&lfW?qWYj%k#2`GrJ1Pki1?GYMRe`No!PX$K4Fqhf8@96! b+ar%Y;EO&|i9WH4K7&MGtiu8T0O|h&uRZx$ literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/Whole StrategyTester 1.htm b/Docs/Reports/14020427/Whole StrategyTester 1.htm new file mode 100644 index 0000000..5e808a8 --- /dev/null +++ b/Docs/Reports/14020427/Whole StrategyTester 1.htm @@ -0,0 +1,321 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (50)
Total net profit278.17Gross profit741.15Gross loss-462.98
Profit factor1.60Expected payoff2.19
Absolute drawdown36.51Maximal drawdown158.60 (12.94%)Relative drawdown12.94% (158.60)
Total trades127Short positions (won %)0 (0.00%)Long positions (won %)127 (83.46%)
Profit trades (% of total)106 (83.46%)Loss trades (% of total)21 (16.54%)
Largestprofit trade42.29loss trade-31.57
Averageprofit trade6.99loss trade-22.05
Maximumconsecutive wins (profit in money)19 (161.16)consecutive losses (loss in money)4 (-122.74)
Maximalconsecutive profit (count of wins)161.16 (19)consecutive loss (count of losses)-122.74 (4)
Averageconsecutive wins8consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.550.001821.36
22020.12.02 10:36t/p10.011821.360.001821.366.811006.81
32020.12.04 14:15buy20.011842.700.001850.46
42020.12.04 16:15buy30.011843.500.001853.78
52020.12.07 16:49t/p20.011850.460.001850.467.371014.18
62020.12.07 16:52t/p30.011853.780.001853.789.891024.07
72020.12.18 01:00buy40.011884.900.001888.22
82020.12.18 14:09t/p40.011888.220.001888.223.321027.39
92021.01.05 05:45buy50.011942.140.001951.92
102021.01.05 16:16t/p50.011951.920.001951.929.781037.17
112021.02.09 03:15buy60.011835.680.001848.18
122021.02.09 11:54t/p60.011848.180.001848.1812.501049.67
132021.02.10 15:15buy70.011844.620.001851.17
142021.02.10 15:37t/p70.011851.170.001851.176.551056.22
152021.03.10 03:15buy80.011718.560.001729.52
162021.03.10 15:15buy90.011714.680.001724.00
172021.03.10 20:33t/p90.011724.000.001724.009.321065.54
182021.03.11 04:07t/p80.011729.520.001729.529.791075.33
192021.03.16 12:30buy100.011733.030.001737.93
202021.03.16 16:22t/p100.011737.930.001737.934.901080.23
212021.04.06 13:30buy110.011732.040.001734.84
222021.04.06 14:24t/p110.011734.840.001734.842.801083.03
232021.04.08 03:00buy120.011737.140.001740.08
242021.04.08 08:01t/p120.011740.080.001740.082.941085.97
252021.04.09 04:30buy130.011756.910.001760.30
262021.04.13 08:37close130.011726.910.001760.30-30.781055.19
272021.04.14 09:15buy140.011746.420.001751.73
282021.04.14 15:39buy150.011746.660.001755.92
292021.04.15 15:19t/p140.011751.730.001751.734.141059.33
302021.04.15 16:54t/p150.011755.920.001755.928.091067.42
312021.04.21 14:15buy160.011782.350.001790.95
322021.04.21 16:49t/p160.011790.950.001790.958.601076.02
332021.05.10 23:15buy170.011837.660.001843.16
342021.05.11 11:45buy180.011837.310.001845.95
352021.05.12 16:04t/p170.011843.160.001843.164.721080.74
362021.05.14 15:15close180.011837.820.001845.95-1.441079.30
372021.05.19 06:45buy190.011869.140.001874.18
382021.05.19 16:00t/p190.011874.180.001874.185.041084.34
392021.07.02 20:45buy200.011785.490.001792.81
402021.07.05 10:54t/p200.011792.810.001792.816.931091.27
412021.07.06 01:06buy210.011791.670.001794.29
422021.07.06 04:45t/p210.011794.290.001794.292.621093.89
432021.07.12 03:30buy220.011809.270.001816.13
442021.07.13 15:39t/p220.011816.130.001816.136.471100.36
452021.07.15 08:45buy230.011828.670.001834.47
462021.07.19 15:06close230.011798.670.001834.47-30.781069.58
472021.07.30 04:30buy240.011829.850.001835.43
482021.07.30 10:15buy250.011830.090.001836.53
492021.08.04 16:09close240.011830.360.001835.43-0.661068.92
502021.08.04 16:09close250.011830.600.001836.53-0.661068.26
512021.08.12 07:30buy260.011752.510.001758.49
522021.08.13 09:24t/p260.011758.490.001758.495.591073.85
532021.08.17 08:15buy270.011787.830.001791.87
542021.08.17 08:52t/p270.011791.870.001791.874.041077.89
552021.09.15 06:45buy280.011803.930.001806.31
562021.09.15 09:15buy290.011803.520.001806.26
572021.09.15 15:24t/p290.011806.260.001806.262.741080.63
582021.09.15 15:24t/p280.011806.310.001806.312.381083.01
592021.09.22 04:45buy300.011776.500.001780.35
602021.09.22 21:07t/p300.011780.350.001780.353.851086.86
612021.10.01 10:00buy310.011756.070.001765.61
622021.10.04 09:00buy320.011761.720.001765.52
632021.10.04 17:39t/p320.011765.520.001765.523.801090.66
642021.10.04 17:39t/p310.011765.610.001765.619.151099.81
652021.10.13 04:00buy330.011761.780.001765.06
662021.10.13 10:39t/p330.011765.060.001765.063.281103.09
672021.10.21 04:00buy340.011784.190.001789.47
682021.10.22 09:31t/p340.011789.470.001789.474.891107.98
692021.10.25 01:15buy350.011793.840.001796.90
702021.10.25 03:54t/p350.011796.900.001796.903.061111.04
712021.11.05 15:15buy360.011795.930.001806.49
722021.11.05 17:22t/p360.011806.490.001806.4910.561121.60
732021.11.08 12:15buy370.011818.030.001823.33
742021.11.08 15:24t/p370.011823.330.001823.335.301126.90
752021.11.18 09:49buy380.011867.450.001875.47
762021.11.22 12:39close380.011837.450.001875.47-30.781096.12
772021.12.07 08:00buy390.011781.310.001785.35
782021.12.07 18:24t/p390.011785.350.001785.354.041100.16
792021.12.14 03:00buy400.011788.160.001793.66
802021.12.14 08:15buy410.011788.420.001793.70
812021.12.15 21:00close410.011758.410.001793.70-30.401069.76
822021.12.15 21:00close400.011758.150.001793.66-30.401039.36
832021.12.23 15:30buy420.011808.430.001813.23
842021.12.27 17:54t/p420.011813.230.001813.234.021043.38
852021.12.28 06:45buy430.011810.840.001813.84
862021.12.28 08:36t/p430.011813.840.001813.843.001046.38
872022.01.11 15:30buy440.011808.430.001814.37
882022.01.11 18:22t/p440.011814.370.001814.375.941052.32
892022.01.12 07:34buy450.011820.520.001824.18
902022.01.12 15:39t/p450.011824.180.001824.183.661055.98
912022.01.13 05:22buy460.011825.520.001827.44
922022.01.13 07:37t/p460.011827.440.001827.441.921057.90
932022.01.26 04:00buy470.011848.220.001850.96
942022.01.26 21:54close470.011818.220.001850.96-30.001027.90
952022.02.01 18:30buy480.011806.970.001815.85
962022.02.04 06:37close480.011807.480.001815.85-1.441026.46
972022.02.09 03:45buy490.011826.740.001829.48
982022.02.09 14:30buy500.011827.470.001828.75
992022.02.09 15:02t/p500.011828.750.001828.751.281027.74
1002022.02.09 15:04t/p490.011829.480.001829.482.741030.48
1012022.02.18 15:00buy510.011894.270.001904.75
1022022.02.21 01:24t/p510.011904.750.001904.7510.091040.57
1032022.03.02 08:45buy520.011937.680.001948.62
1042022.03.04 02:39t/p520.011948.620.001948.629.381049.95
1052022.03.04 11:15buy530.011941.660.001956.40
1062022.03.04 16:37t/p530.011956.400.001956.4014.741064.69
1072022.03.07 17:45buy540.011989.420.002032.10
1082022.03.08 06:45buy550.011989.920.001999.74
1092022.03.08 08:25t/p550.011999.740.001999.749.821074.51
1102022.03.08 16:49t/p540.012032.100.002032.1042.291116.80
1112022.03.24 08:15buy560.011942.900.001947.97
1122022.03.24 13:31t/p560.011947.970.001947.975.071121.87
1132022.03.25 03:00buy570.011963.080.001972.98
1142022.03.28 08:54close570.011933.080.001972.98-30.391091.49
1152022.04.08 03:00buy580.011933.340.001938.28
1162022.04.08 15:09t/p580.011938.280.001938.284.941096.43
1172022.04.11 08:45buy590.011944.970.001949.67
1182022.04.11 11:19t/p590.011949.670.001949.674.701101.13
1192022.04.12 14:15buy600.011956.680.001966.46
1202022.04.12 15:39t/p600.011966.460.001966.469.781110.91
1212022.04.13 04:49buy610.011968.170.001977.53
1222022.04.13 12:39t/p610.011977.530.001977.539.361120.27
1232022.04.14 02:00buy620.011978.670.001982.69
1242022.04.14 05:00buy630.011980.050.001986.23
1252022.04.14 10:45buy640.011977.510.001984.20
1262022.04.18 02:37t/p620.011982.690.001982.693.241123.51
1272022.04.18 02:46t/p640.011984.200.001984.205.911129.42
1282022.04.18 02:49t/p630.011986.230.001986.235.401134.82
1292022.05.05 13:30buy650.011898.250.001907.69
1302022.05.05 15:49t/p650.011907.690.001907.699.441144.26
1312022.05.20 18:15buy660.011844.180.001855.68
1322022.05.23 08:08t/p660.011855.680.001855.6811.111155.37
1332022.05.24 06:30buy670.011854.920.001865.38
1342022.05.24 16:47t/p670.011865.380.001865.3810.461165.83
1352022.05.30 16:30buy680.011860.850.001873.75
1362022.06.01 08:17close680.011830.850.001873.75-30.781135.05
1372022.06.09 02:15buy690.011854.330.001859.11
1382022.06.10 17:56t/p690.011859.110.001859.114.391139.44
1392022.06.17 08:15buy700.011847.380.001852.76
1402022.06.17 15:53t/p700.011852.760.001852.765.381144.82
1412022.07.22 09:00buy710.011716.260.001721.96
1422022.07.22 12:27t/p710.011721.960.001721.965.701150.52
1432022.07.25 01:15buy720.011726.480.001733.02
1442022.07.25 12:25t/p720.011733.020.001733.026.541157.06
1452022.08.01 05:15buy730.011764.130.001769.45
1462022.08.01 09:45buy740.011764.250.001769.84
1472022.08.01 12:38t/p730.011769.450.001769.455.321162.38
1482022.08.01 12:42t/p740.011769.840.001769.845.591167.97
1492022.08.01 21:00buy750.011769.400.001770.06
1502022.08.01 22:13t/p750.011770.060.001770.060.661168.63
1512022.08.02 12:15buy760.011773.830.001780.03
1522022.08.02 15:15t/p760.011780.030.001780.036.201174.83
1532022.08.05 07:45buy770.011792.040.001793.26
1542022.08.09 13:13close770.011792.550.001793.26-0.271174.56
1552022.08.24 17:00buy780.011746.270.001752.35
1562022.08.24 17:53t/p780.011752.350.001752.356.081180.64
1572022.09.05 20:00buy790.011712.390.001716.49
1582022.09.06 03:22t/p790.011716.490.001716.493.711184.35
1592022.09.08 07:15buy800.011716.950.001722.63
1602022.09.08 13:37t/p800.011722.630.001722.635.681190.03
1612022.09.30 16:45buy810.011669.210.001683.07
1622022.10.03 17:22t/p810.011683.070.001683.0713.471203.50
1632022.10.04 06:45buy820.011700.470.001710.19
1642022.10.04 10:18t/p820.011710.190.001710.199.721213.22
1652022.10.24 07:45buy830.011658.440.001667.68
1662022.10.26 03:00buy840.011653.220.001656.72
1672022.10.26 06:27t/p840.011656.720.001656.723.501216.72
1682022.10.26 10:08t/p830.011667.680.001667.688.461225.18
1692022.10.26 18:15buy850.011672.150.001688.25
1702022.10.27 08:45buy860.011669.870.001682.99
1712022.10.27 11:16buy870.011665.590.001671.30
1722022.10.28 15:30close850.011642.140.001688.25-31.571193.61
1732022.10.28 18:16close860.011639.870.001682.99-30.391163.22
1742022.10.31 10:33close870.011635.590.001671.30-30.781132.44
1752022.11.02 20:15buy880.011664.550.001700.75
1762022.11.02 22:53close880.011634.550.001700.75-30.001102.44
1772022.11.07 05:32buy890.011673.440.001678.96
1782022.11.07 11:23t/p890.011678.960.001678.965.521107.96
1792022.11.10 13:00buy900.011708.650.001717.29
1802022.11.10 15:31t/p900.011717.290.001717.298.641116.60
1812022.11.11 06:45buy910.011752.150.001756.21
1822022.11.11 07:27t/p910.011756.210.001756.214.061120.66
1832022.11.14 05:15buy920.011765.290.001773.39
1842022.11.14 09:45buy930.011762.510.001767.31
1852022.11.14 16:40t/p930.011767.310.001767.314.801125.46
1862022.11.14 17:12t/p920.011773.390.001773.398.101133.56
1872022.11.25 13:15buy940.011753.960.001758.35
1882022.11.28 10:41t/p940.011758.350.001758.354.001137.56
1892022.12.08 13:45buy950.011784.860.001789.50
1902022.12.08 15:23t/p950.011789.500.001789.504.641142.20
1912022.12.09 13:00buy960.011794.910.001806.33
1922022.12.13 15:33t/p960.011806.330.001806.3310.641152.84
1932022.12.14 03:01buy970.011811.600.001816.36
1942022.12.15 10:13close970.011781.590.001816.36-31.181121.66
1952022.12.22 02:15buy980.011816.230.001821.17
1962022.12.22 20:22close980.011786.230.001821.17-30.001091.66
1972022.12.30 03:00buy990.011816.600.001821.40
1982022.12.30 09:01t/p990.011821.400.001821.404.801096.46
1992023.01.05 09:30buy1000.011854.480.001861.84
2002023.01.06 17:21t/p1000.011861.840.001861.846.971103.43
2012023.01.09 14:15buy1010.011875.480.001880.19
2022023.01.09 16:48t/p1010.011880.190.001880.194.711108.14
2032023.01.10 21:15buy1020.011876.190.001884.01
2042023.01.11 06:00buy1030.011878.060.001884.46
2052023.01.11 07:38t/p1020.011884.010.001884.017.431115.57
2062023.01.11 10:47t/p1030.011884.460.001884.466.401121.97
2072023.01.13 10:00buy1040.011899.980.001909.62
2082023.01.13 16:50t/p1040.011909.620.001909.629.641131.61
2092023.01.20 17:30buy1050.011930.400.001939.82
2102023.01.24 08:53t/p1050.011939.820.001939.828.641140.25
2112023.02.01 06:15buy1060.011928.390.001935.43
2122023.02.01 21:42t/p1060.011935.430.001935.437.041147.29
2132023.02.20 04:30buy1070.011842.620.001851.18
2142023.02.22 14:31close1070.011843.130.001851.18-0.271147.02
2152023.03.01 04:00buy1080.011829.430.001841.49
2162023.03.01 15:01t/p1080.011841.490.001841.4912.061159.08
2172023.03.13 11:00buy1090.011885.840.001910.24
2182023.03.13 16:46t/p1090.011910.240.001910.2424.401183.48
2192023.03.14 08:15buy1100.011911.270.001920.74
2202023.03.14 14:15buy1110.011907.600.001919.24
2212023.03.14 19:00buy1120.011909.010.001921.99
2222023.03.15 14:01t/p1110.011919.240.001919.2411.251194.73
2232023.03.15 14:02t/p1100.011920.740.001920.749.081203.81
2242023.03.15 14:03t/p1120.011921.990.001921.9912.591216.40
2252023.03.16 01:15buy1130.011921.480.001928.68
2262023.03.16 14:20t/p1130.011928.680.001928.687.201223.60
2272023.03.16 21:15buy1140.011920.000.001929.92
2282023.03.17 06:53t/p1140.011929.920.001929.929.531233.13
2292023.03.20 06:15buy1150.011974.860.001978.82
2302023.03.20 07:46t/p1150.011978.820.001978.823.961237.09
2312023.03.24 05:58buy1160.011993.650.001997.21
2322023.03.24 12:08t/p1160.011997.210.001997.213.561240.65
2332023.03.31 14:00buy1170.011979.710.001984.51
2342023.03.31 15:33t/p1170.011984.510.001984.514.801245.45
2352023.04.12 15:45buy1180.012022.510.002038.50
2362023.04.13 15:45t/p1180.012038.500.002038.5014.821260.27
2372023.04.26 09:45buy1190.011998.820.002007.08
2382023.04.26 16:26t/p1190.012007.080.002007.088.261268.53
2392023.05.03 11:40buy1200.012016.570.002019.99
2402023.05.03 14:00buy1210.012016.860.002019.56
2412023.05.03 16:30buy1220.012018.960.002029.50
2422023.05.03 16:35t/p1210.012019.560.002019.562.701271.23
2432023.05.03 17:52t/p1200.012019.990.002019.993.421274.65
2442023.05.03 21:00t/p1220.012029.500.002029.5010.541285.19
2452023.05.31 08:00buy1230.011960.380.001966.70
2462023.05.31 13:45buy1240.011958.810.001965.97
2472023.05.31 16:42t/p1240.011965.970.001965.977.161292.35
2482023.05.31 16:42t/p1230.011966.700.001966.706.321298.67
2492023.06.01 02:15buy1250.011966.140.001972.32
2502023.06.01 16:34t/p1250.011972.320.001972.326.181304.85
2512023.06.02 05:00buy1260.011977.670.001981.00
2522023.06.02 06:06t/p1260.011981.000.001981.003.331308.18
2532023.06.02 12:45buy1270.011980.960.001991.34
2542023.06.02 21:02close1270.011950.950.001991.34-30.011278.17
+
diff --git a/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif b/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.gif new file mode 100644 index 0000000000000000000000000000000000000000..47a7b8363beaee4fa936475cd799e566633787fb GIT binary patch literal 8393 zcmch5^;=ZW|Mr5^(jf?lf`D|0BC({1(g-RIf+*e6-LSjV(zSH$!qTvmbk|Z+ONw+O zA|>pX&-?iwo;h=_Yp&NFbI&=y%#4!CTM5a}qW1;>n*aa~hXVirBO@a?^e_na8*OQc zzAK?EL9hkD-HXF5z(98;wB;T1ZV13F%z*$^fV&Qw`+q##Zy4ym0$><@2ZH7n{v!ea zmgqa_ofrhLv;+YDv&7xOXv->4D-5?`3A*!#-9aGG9m%p402l^=T5)#(plabiQ_CuV z7TQ|=f_oeIr#r>vu^;md-q|h@|uJ+j~A0*KNU16p2&{ek6%+%rx&?h zIENOz3TBgoeq>BoSB`wDot>1Hu%Q|y__^%|V`6c?u6V)D;$UsbyAMplg!Q6z@3mEx zxSuB1iN5cEm*uiE%L6{(-OI1Y2L-K;2NRGIxWtI*PT&)T4yl5SAZ3OsPB=V7OeVSv zNrX3ki@HXjLWzBVHcM)aRqRNlv;vszRaaP57~)gD7G6y_8RK&+t-{Z*Ifh`8Zn>MU zrtn+LwW+=xP0N4pZxXt#&NkbnT9&ZMQL_q$CuNv_gBbW*KtIUD|0isop z0f9TyYc{AX>s2q&zW2+#TjA6Az$lf~5WJ6P7ry|)7uEoB5ecqt9Jwq*zJgas2RAFB z=vQgsS<{U$o!aW>nUzmtZ zw+$`Kfbx_|lTX~EQjGptRyaB0db;)kRBRS&Lmu~qC?>rn+%AHm6p7Y7%*^; zQ{*|`E->LaL72qxF@nlQ!GGERy@1$)(_`(topZI`5GgBACWZxr<{8|WGTLZE7y-%qN@z)d<;lAP|4U0i>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z8V9>noSk zzn!~rk*@q`D3N>>?&KJ9h?z$R%xuQ;d|%OsO-7ho9NJ*M<1yzLk8ua==@PXjlDQw3 zTa~6HuDnDD2kMs?TAW6-_iSra+RVoZJwDXT;y+9!{kKXMc+n%=b`lr&Z=FBza>S|a aG>7VDTP^VFM`hbtW!%mFsVFr->i+;qjr(o@ literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm b/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm new file mode 100644 index 0000000..fa1f1fb --- /dev/null +++ b/Docs/Reports/14020427/Whole StrategyTester 2 - 1 Max Trade.htm @@ -0,0 +1,273 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=1; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (57)
Total net profit247.67Gross profit616.97Gross loss-369.31
Profit factor1.67Expected payoff2.40
Absolute drawdown14.52Maximal drawdown102.26 (8.60%)Relative drawdown8.60% (102.26)
Total trades103Short positions (won %)0 (0.00%)Long positions (won %)103 (84.47%)
Profit trades (% of total)87 (84.47%)Loss trades (% of total)16 (15.53%)
Largestprofit trade42.29loss trade-31.58
Averageprofit trade7.09loss trade-23.08
Maximumconsecutive wins (profit in money)14 (116.92)consecutive losses (loss in money)2 (-61.58)
Maximalconsecutive profit (count of wins)116.92 (14)consecutive loss (count of losses)-61.58 (2)
Averageconsecutive wins7consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.620.001821.43
22020.12.02 10:36t/p10.011821.430.001821.436.811006.81
32020.12.04 14:15buy20.011842.770.001850.53
42020.12.07 16:49t/p20.011850.530.001850.537.371014.18
52020.12.18 01:00buy30.011884.970.001888.29
62020.12.18 14:09t/p30.011888.290.001888.293.321017.50
72021.01.05 05:45buy40.011942.210.001951.99
82021.01.05 16:16t/p40.011951.990.001951.999.781027.28
92021.02.09 03:15buy50.011835.750.001848.25
102021.02.09 11:54t/p50.011848.250.001848.2512.501039.78
112021.02.10 15:15buy60.011844.690.001851.24
122021.02.10 15:37t/p60.011851.240.001851.246.551046.33
132021.03.10 03:15buy70.011718.630.001729.59
142021.03.11 04:07t/p70.011729.590.001729.599.791056.12
152021.03.16 12:30buy80.011733.100.001738.00
162021.03.16 16:22t/p80.011738.000.001738.004.901061.02
172021.04.06 13:30buy90.011732.110.001734.91
182021.04.06 14:24t/p90.011734.910.001734.912.801063.82
192021.04.08 03:00buy100.011737.210.001740.15
202021.04.08 08:01t/p100.011740.150.001740.152.941066.76
212021.04.09 04:30buy110.011756.980.001760.37
222021.04.13 08:37close110.011726.980.001760.37-30.781035.98
232021.04.14 09:15buy120.011746.490.001751.80
242021.04.15 15:19t/p120.011751.800.001751.804.141040.12
252021.04.21 14:15buy130.011782.420.001791.02
262021.04.21 16:49t/p130.011791.020.001791.028.601048.72
272021.05.10 23:15buy140.011837.730.001843.23
282021.05.12 16:04t/p140.011843.230.001843.234.721053.44
292021.05.19 06:45buy150.011869.210.001874.25
302021.05.19 16:00t/p150.011874.250.001874.255.041058.48
312021.07.02 20:45buy160.011785.560.001792.88
322021.07.05 11:06t/p160.011792.880.001792.886.931065.41
332021.07.06 01:06buy170.011791.740.001794.36
342021.07.06 04:45t/p170.011794.360.001794.362.621068.03
352021.07.12 03:30buy180.011809.340.001816.20
362021.07.13 15:39t/p180.011816.200.001816.206.471074.50
372021.07.15 08:45buy190.011828.740.001834.54
382021.07.19 15:06close190.011798.740.001834.54-30.781043.72
392021.07.30 04:30buy200.011829.920.001835.50
402021.08.04 16:09close200.011830.430.001835.50-0.661043.06
412021.08.12 07:30buy210.011752.580.001758.56
422021.08.13 09:24t/p210.011758.560.001758.565.591048.65
432021.08.17 08:15buy220.011787.900.001791.94
442021.08.17 08:52t/p220.011791.940.001791.944.041052.69
452021.09.15 06:45buy230.011804.000.001806.38
462021.09.15 15:24t/p230.011806.380.001806.382.381055.07
472021.09.22 04:45buy240.011776.570.001780.42
482021.09.22 21:07t/p240.011780.420.001780.423.851058.92
492021.10.01 10:00buy250.011756.140.001765.68
502021.10.04 17:39t/p250.011765.680.001765.689.151068.07
512021.10.13 04:00buy260.011761.850.001765.13
522021.10.13 10:39t/p260.011765.130.001765.133.281071.35
532021.10.21 04:00buy270.011784.260.001789.54
542021.10.22 09:31t/p270.011789.540.001789.544.891076.24
552021.10.25 01:15buy280.011793.910.001796.97
562021.10.25 03:54t/p280.011796.970.001796.973.061079.30
572021.11.05 15:15buy290.011796.000.001806.56
582021.11.05 17:22t/p290.011806.560.001806.5610.561089.86
592021.11.08 12:15buy300.011818.100.001823.40
602021.11.08 15:24t/p300.011823.400.001823.405.301095.16
612021.11.18 09:49buy310.011867.520.001875.54
622021.11.22 12:39close310.011837.520.001875.54-30.781064.38
632021.12.07 08:00buy320.011781.380.001785.42
642021.12.07 18:24t/p320.011785.420.001785.424.041068.42
652021.12.14 03:00buy330.011788.230.001793.73
662021.12.15 21:00close330.011758.230.001793.73-30.391038.03
672021.12.23 15:30buy340.011808.500.001813.30
682021.12.28 07:54t/p340.011813.300.001813.303.631041.66
692022.01.11 15:30buy350.011808.500.001814.44
702022.01.11 18:22t/p350.011814.440.001814.445.941047.60
712022.01.12 07:34buy360.011820.590.001824.25
722022.01.12 15:39t/p360.011824.250.001824.253.661051.26
732022.01.13 05:22buy370.011825.590.001827.51
742022.01.13 07:39t/p370.011827.510.001827.511.921053.18
752022.01.26 04:00buy380.011848.290.001851.03
762022.01.26 21:54close380.011818.290.001851.03-30.001023.18
772022.02.01 18:30buy390.011807.040.001815.92
782022.02.04 06:39close390.011807.550.001815.92-1.441021.74
792022.02.09 03:45buy400.011826.810.001829.55
802022.02.09 15:04t/p400.011829.550.001829.552.741024.48
812022.02.18 15:00buy410.011894.340.001904.82
822022.02.21 01:24t/p410.011904.820.001904.8210.091034.57
832022.03.02 08:45buy420.011937.750.001948.69
842022.03.04 02:39t/p420.011948.690.001948.699.381043.95
852022.03.04 11:15buy430.011941.730.001956.47
862022.03.04 16:37t/p430.011956.470.001956.4714.741058.69
872022.03.07 17:45buy440.011989.490.002032.17
882022.03.08 16:49t/p440.012032.170.002032.1742.291100.98
892022.03.24 08:15buy450.011942.970.001948.04
902022.03.24 13:31t/p450.011948.040.001948.045.071106.05
912022.03.25 03:00buy460.011963.150.001973.05
922022.03.28 08:54close460.011933.150.001973.05-30.391075.66
932022.04.08 03:00buy470.011933.410.001938.35
942022.04.08 15:09t/p470.011938.350.001938.354.941080.60
952022.04.11 08:45buy480.011945.040.001949.74
962022.04.11 11:19t/p480.011949.740.001949.744.701085.30
972022.04.12 14:15buy490.011956.750.001966.53
982022.04.12 15:39t/p490.011966.530.001966.539.781095.08
992022.04.13 04:49buy500.011968.240.001977.60
1002022.04.13 12:39t/p500.011977.600.001977.609.361104.44
1012022.04.14 02:00buy510.011978.740.001982.76
1022022.04.18 02:37t/p510.011982.760.001982.763.241107.68
1032022.05.05 13:30buy520.011898.320.001907.76
1042022.05.05 15:49t/p520.011907.760.001907.769.441117.12
1052022.05.20 18:15buy530.011844.250.001855.75
1062022.05.23 08:08t/p530.011855.750.001855.7511.111128.23
1072022.05.24 06:30buy540.011854.990.001865.45
1082022.05.24 16:47t/p540.011865.450.001865.4510.461138.69
1092022.05.30 16:30buy550.011860.920.001873.82
1102022.06.01 08:16close550.011830.910.001873.82-30.791107.90
1112022.06.09 02:15buy560.011854.400.001859.18
1122022.06.10 17:56t/p560.011859.180.001859.184.391112.29
1132022.06.17 08:15buy570.011847.450.001852.83
1142022.06.17 15:53t/p570.011852.830.001852.835.381117.67
1152022.07.22 09:00buy580.011716.330.001722.03
1162022.07.22 12:28t/p580.011722.030.001722.035.701123.37
1172022.07.25 01:15buy590.011726.550.001733.09
1182022.07.25 12:25t/p590.011733.090.001733.096.541129.91
1192022.08.01 05:15buy600.011764.200.001769.52
1202022.08.01 12:41t/p600.011769.520.001769.525.321135.23
1212022.08.01 21:00buy610.011769.470.001770.13
1222022.08.01 22:13t/p610.011770.130.001770.130.661135.89
1232022.08.02 12:15buy620.011773.900.001780.10
1242022.08.02 15:15t/p620.011780.100.001780.106.201142.09
1252022.08.05 07:45buy630.011792.110.001793.33
1262022.08.09 13:13close630.011792.630.001793.33-0.261141.83
1272022.08.24 17:00buy640.011746.340.001752.42
1282022.08.24 17:53t/p640.011752.420.001752.426.081147.91
1292022.09.05 20:00buy650.011712.460.001716.56
1302022.09.06 03:22t/p650.011716.560.001716.563.711151.62
1312022.09.08 07:15buy660.011717.020.001722.70
1322022.09.08 13:37t/p660.011722.700.001722.705.681157.30
1332022.09.30 16:45buy670.011669.280.001683.14
1342022.10.03 17:22t/p670.011683.140.001683.1413.471170.77
1352022.10.04 06:45buy680.011700.540.001710.26
1362022.10.04 10:18t/p680.011710.260.001710.269.721180.49
1372022.10.24 07:45buy690.011658.510.001667.75
1382022.10.26 10:28t/p690.011667.750.001667.758.461188.96
1392022.10.26 18:15buy700.011672.220.001688.32
1402022.10.28 15:30close700.011642.200.001688.32-31.581157.38
1412022.11.02 20:15buy710.011664.620.001700.82
1422022.11.02 22:53close710.011634.620.001700.82-30.001127.38
1432022.11.07 05:32buy720.011673.510.001679.03
1442022.11.07 11:26t/p720.011679.030.001679.035.521132.90
1452022.11.10 13:00buy730.011708.720.001717.36
1462022.11.10 15:31t/p730.011717.360.001717.368.641141.54
1472022.11.11 06:45buy740.011752.220.001756.28
1482022.11.11 07:27t/p740.011756.280.001756.284.061145.60
1492022.11.14 05:15buy750.011765.360.001773.46
1502022.11.14 17:12t/p750.011773.460.001773.468.101153.70
1512022.11.25 13:15buy760.011754.030.001758.42
1522022.11.28 10:41t/p760.011758.420.001758.424.001157.70
1532022.12.08 13:45buy770.011784.930.001789.57
1542022.12.08 15:33t/p770.011789.570.001789.574.641162.34
1552022.12.09 13:00buy780.011794.980.001806.40
1562022.12.13 15:33t/p780.011806.400.001806.4010.641172.98
1572022.12.14 03:01buy790.011811.670.001816.43
1582022.12.15 10:13close790.011781.650.001816.43-31.191141.79
1592022.12.22 02:15buy800.011816.300.001821.24
1602022.12.22 20:22close800.011786.290.001821.24-30.011111.78
1612022.12.30 03:00buy810.011816.670.001821.47
1622022.12.30 09:01t/p810.011821.470.001821.474.801116.58
1632023.01.05 09:30buy820.011854.550.001861.91
1642023.01.06 17:32t/p820.011861.910.001861.916.971123.55
1652023.01.09 14:15buy830.011875.550.001880.26
1662023.01.09 16:48t/p830.011880.260.001880.264.711128.26
1672023.01.10 21:15buy840.011876.260.001884.08
1682023.01.11 07:38t/p840.011884.080.001884.087.431135.69
1692023.01.13 10:00buy850.011900.050.001909.69
1702023.01.13 16:50t/p850.011909.690.001909.699.641145.33
1712023.01.20 17:30buy860.011930.470.001939.89
1722023.01.24 09:02t/p860.011939.890.001939.898.641153.97
1732023.02.01 06:15buy870.011928.460.001935.50
1742023.02.01 21:42t/p870.011935.500.001935.507.041161.01
1752023.02.20 04:30buy880.011842.690.001851.25
1762023.02.22 14:31close880.011843.210.001851.25-0.261160.75
1772023.03.01 04:00buy890.011829.500.001841.56
1782023.03.01 16:38t/p890.011841.560.001841.5612.061172.81
1792023.03.13 11:00buy900.011885.910.001910.31
1802023.03.13 16:46t/p900.011910.310.001910.3124.401197.21
1812023.03.14 08:15buy910.011911.340.001920.81
1822023.03.15 14:02t/p910.011920.810.001920.819.081206.29
1832023.03.16 01:15buy920.011921.550.001928.75
1842023.03.16 14:21t/p920.011928.750.001928.757.201213.49
1852023.03.16 21:15buy930.011920.070.001929.99
1862023.03.17 06:54t/p930.011929.990.001929.999.531223.02
1872023.03.20 06:15buy940.011974.930.001978.89
1882023.03.20 07:46t/p940.011978.890.001978.893.961226.98
1892023.03.24 05:58buy950.011993.720.001997.28
1902023.03.24 12:08t/p950.011997.280.001997.283.561230.54
1912023.03.31 14:00buy960.011979.780.001984.58
1922023.03.31 15:33t/p960.011984.580.001984.584.801235.34
1932023.04.12 15:45buy970.012022.580.002038.57
1942023.04.13 15:46t/p970.012038.570.002038.5714.821250.16
1952023.04.26 09:45buy980.011998.890.002007.15
1962023.04.26 16:26t/p980.012007.150.002007.158.261258.42
1972023.05.03 11:40buy990.012016.640.002020.06
1982023.05.03 17:52t/p990.012020.060.002020.063.421261.84
1992023.05.31 08:00buy1000.011960.450.001966.77
2002023.05.31 16:42t/p1000.011966.770.001966.776.321268.16
2012023.06.01 02:15buy1010.011966.210.001972.39
2022023.06.01 16:35t/p1010.011972.390.001972.396.181274.34
2032023.06.02 05:00buy1020.011977.740.001981.07
2042023.06.02 06:06t/p1020.011981.070.001981.073.331277.67
2052023.06.02 12:45buy1030.011981.030.001991.41
2062023.06.02 21:01close1030.011951.030.001991.41-30.001247.67
+
diff --git a/Docs/Reports/14020427/Whole StrategyTester 3.gif b/Docs/Reports/14020427/Whole StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..83d01e790fbad21f2846148f445b80ba77a6aa39 GIT binary patch literal 8795 zcmch6_cz?n_x}^YYEdGhh9J5W-6|0gy(E!{P7={;L~pCF)mCS%UUt{&Wp&Y`6Lodb z2|^Mr$bP(E-~Zt|XXc!H?xWm0Gr!HKX{gG`zLOy712zGGKp+4BFf=qozzu@ozi`&p zxa$kuH!{D*Z%Np2n@a^S+@efAQ;?AxCVgA`TtC|9uWzR zfK-E5|ffsQq$5i5ShrV?3~=Z{DQ)wViX!vf-Nm8uc)l5uBolV)i*RYHMg|3 zeQEFL?CS36{o2<*FgP?kGCEdDG%-0fJ%gW}n_pO5T3-3Sy0*TtxwXBs`(tna;OF7d zuit-;PfiajiE@Z9|7BkR|9&vSSCn)~>F+Ki!@n!*(A-lTVoX?7(Z2oo-~1`8;At?| z6WD9!#C7$^`!BPT(-Su|qeb7fO)@7He>IRU*jebWLFwtUJS44?sD1TPQ;q+AO0C4J zb|f~Jn^g(WCnCu&&j&+R#)5B9-f)YRGWbSJ7CN8_Hi^O-Yq$`I(6N~~EQX9|>|f~x zx-^vBm%?sQtD%w`gOOK;ay{(~s|-V%=f5DT4yR%kvw2bY?itSjT=sMB=F>8nDzlnCA92d?dEtCX)1|KXe`iu5hcN2xZn~#j(L79Ri?%ljceMtjI?MqaW zmkZ}|aYGjAdE=tD!kJT68Q$sKVB(!kG^XO`l2-n1lwf>QaNPo-bE>pcRZ~Zb6asFl zgPe)PLfA|}ynRp?H0d_iJr^BAXn2ApG%6zMkMxR(kSUs#RJhU-5(G$8-UWhordI7r zvuszqC3;^i32uc?5mQ8Ktb`D~K0aFm9-i3()Q@HOx(L*YO!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OzL?OE!I~Z&Rn*0Fvs|GU*Tc zAffC`R-daMfMvo?_`@FCfK=5#*N}!(wTC`ore;40Yf>c^Y=A6VhkTC=dDaCOoZM zx2+Qmqe`Tu(CMF8#2@>~M8&v9I(kMP6-Pp(Y>?1sPs7M9oMbB~#&g@l2P6gYhN4^} zLk(kiH)BRYvEKw@C)8u7Y-4Ajv9svd`M%i2?bu~d+;@SvHTAd++qkVh>R + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit235.24Gross profit679.38Gross loss-444.14
Profit factor1.53Expected payoff1.85
Absolute drawdown40.51Maximal drawdown135.42 (12.37%)Relative drawdown12.37% (135.42)
Total trades127Short positions (won %)0 (0.00%)Long positions (won %)127 (81.89%)
Profit trades (% of total)104 (81.89%)Loss trades (% of total)23 (18.11%)
Largestprofit trade42.24loss trade-31.31
Averageprofit trade6.53loss trade-19.31
Maximumconsecutive wins (profit in money)21 (167.96)consecutive losses (loss in money)3 (-73.90)
Maximalconsecutive profit (count of wins)167.96 (21)consecutive loss (count of losses)-73.90 (3)
Averageconsecutive wins7consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.321014.13
62020.12.07 16:52t/p30.011853.880.001853.889.841023.98
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.30
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.08
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.58
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.13
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.45
182021.03.11 04:07t/p80.011729.620.001729.629.651075.10
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.00
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801082.80
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.74
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.871054.87
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.001058.88
302021.04.15 16:54t/p150.011756.020.001756.027.951066.83
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601075.43
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 15:51close180.011837.920.001846.050.071075.50
362021.05.12 15:52close170.011838.270.001843.26-0.361075.14
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041080.18
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.881087.07
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621089.69
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:04close220.011809.880.001816.230.071089.76
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.871058.89
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.03 21:30close240.011810.040.001835.53-20.781038.11
502021.08.04 04:15close250.011809.250.001836.63-22.251015.86
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.541021.41
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041025.45
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741028.19
582021.09.15 15:24t/p280.011806.410.001806.412.381030.57
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851034.42
612021.10.01 10:00buy310.011756.170.001765.71
622021.10.04 09:00buy320.011761.820.001765.62
632021.10.04 17:39t/p320.011765.620.001765.623.801038.22
642021.10.04 17:39t/p310.011765.710.001765.719.101047.32
652021.10.13 04:00buy330.011761.880.001765.16
662021.10.13 10:39t/p330.011765.160.001765.163.281050.60
672021.10.21 04:00buy340.011784.290.001789.57
682021.10.22 09:31t/p340.011789.570.001789.574.841055.45
692021.10.25 01:15buy350.011793.940.001797.00
702021.10.25 03:54t/p350.011797.000.001797.003.061058.51
712021.11.05 15:15buy360.011796.030.001806.59
722021.11.05 17:22t/p360.011806.590.001806.5910.561069.07
732021.11.08 12:15buy370.011818.130.001823.43
742021.11.08 15:24t/p370.011823.430.001823.435.301074.37
752021.11.18 09:49buy380.011867.550.001875.57
762021.11.22 12:39close380.011837.550.001875.57-30.871043.50
772021.12.07 08:00buy390.011781.410.001785.45
782021.12.07 18:24t/p390.011785.450.001785.454.041047.54
792021.12.14 03:00buy400.011788.260.001793.76
802021.12.14 08:15buy410.011788.520.001793.80
812021.12.15 21:00close410.011758.510.001793.80-30.451017.09
822021.12.15 21:00close400.011758.250.001793.76-30.45986.65
832021.12.23 15:30buy420.011808.530.001813.33
842021.12.28 01:00close420.011811.350.001813.331.51988.16
852021.12.28 06:45buy430.011810.940.001813.94
862021.12.28 08:36t/p430.011813.940.001813.943.00991.16
872022.01.11 15:30buy440.011808.530.001814.47
882022.01.11 18:22t/p440.011814.470.001814.475.94997.10
892022.01.12 07:34buy450.011820.620.001824.28
902022.01.12 15:39t/p450.011824.280.001824.283.661000.76
912022.01.13 05:22buy460.011825.620.001827.54
922022.01.13 07:39t/p460.011827.540.001827.541.921002.68
932022.01.26 04:00buy470.011848.320.001851.06
942022.01.26 21:54close470.011818.320.001851.06-30.00972.68
952022.02.01 18:30buy480.011807.070.001815.95
962022.02.03 04:00close480.011808.370.001815.95-0.44972.24
972022.02.09 03:45buy490.011826.840.001829.58
982022.02.09 14:30buy500.011827.570.001828.85
992022.02.09 15:04t/p500.011828.850.001828.851.28973.52
1002022.02.09 15:04t/p490.011829.580.001829.582.74976.26
1012022.02.18 15:00buy510.011894.370.001904.85
1022022.02.21 01:24t/p510.011904.850.001904.8510.04986.30
1032022.03.02 08:45buy520.011937.780.001948.72
1042022.03.03 22:19close520.011938.290.001948.72-0.80985.51
1052022.03.04 11:15buy530.011941.760.001956.50
1062022.03.04 16:37t/p530.011956.500.001956.5014.741000.25
1072022.03.07 17:45buy540.011989.520.002032.20
1082022.03.08 06:45buy550.011990.020.001999.84
1092022.03.08 08:30t/p550.011999.840.001999.849.821010.07
1102022.03.08 16:49t/p540.012032.200.002032.2042.241052.31
1112022.03.24 08:15buy560.011943.000.001948.07
1122022.03.24 13:31t/p560.011948.070.001948.075.071057.38
1132022.03.25 03:00buy570.011963.180.001973.08
1142022.03.28 08:54close570.011933.170.001973.08-30.451026.94
1152022.04.08 03:00buy580.011933.440.001938.38
1162022.04.08 15:09t/p580.011938.380.001938.384.941031.88
1172022.04.11 08:45buy590.011945.070.001949.77
1182022.04.11 11:19t/p590.011949.770.001949.774.701036.58
1192022.04.12 14:15buy600.011956.780.001966.56
1202022.04.12 15:39t/p600.011966.560.001966.569.781046.36
1212022.04.13 04:49buy610.011968.270.001977.63
1222022.04.13 12:39t/p610.011977.630.001977.639.361055.72
1232022.04.14 02:00buy620.011978.770.001982.79
1242022.04.14 05:00buy630.011980.150.001986.33
1252022.04.14 10:45buy640.011977.610.001984.30
1262022.04.18 02:37t/p620.011982.790.001982.793.151058.87
1272022.04.18 02:46t/p640.011984.300.001984.305.821064.69
1282022.04.18 02:49t/p630.011986.330.001986.335.311069.99
1292022.05.05 13:30buy650.011898.350.001907.79
1302022.05.05 15:49t/p650.011907.790.001907.799.441079.43
1312022.05.20 18:15buy660.011844.280.001855.78
1322022.05.23 08:08t/p660.011855.780.001855.7811.061090.50
1332022.05.24 06:30buy670.011855.020.001865.48
1342022.05.24 16:47t/p670.011865.480.001865.4810.461100.96
1352022.05.30 16:30buy680.011860.950.001873.85
1362022.06.01 08:16close680.011830.950.001873.85-30.871070.09
1372022.06.09 02:15buy690.011854.430.001859.21
1382022.06.10 17:51close690.011854.940.001859.210.071070.16
1392022.06.17 08:15buy700.011847.480.001852.86
1402022.06.22 04:45close700.011828.420.001852.86-20.371049.80
1412022.07.22 09:00buy710.011716.360.001722.06
1422022.07.22 12:28t/p710.011722.060.001722.065.701055.50
1432022.07.25 01:15buy720.011726.580.001733.12
1442022.07.25 12:25t/p720.011733.120.001733.126.541062.04
1452022.08.01 05:15buy730.011764.230.001769.55
1462022.08.01 09:45buy740.011764.350.001769.94
1472022.08.01 12:41t/p730.011769.550.001769.555.321067.36
1482022.08.01 12:42t/p740.011769.940.001769.945.591072.95
1492022.08.01 21:00buy750.011769.500.001770.16
1502022.08.01 22:13t/p750.011770.160.001770.160.661073.61
1512022.08.02 12:15buy760.011773.930.001780.13
1522022.08.02 15:15t/p760.011780.130.001780.136.201079.81
1532022.08.05 07:45buy770.011792.140.001793.36
1542022.08.09 11:25close770.011792.660.001793.36-0.351079.46
1552022.08.24 17:00buy780.011746.370.001752.45
1562022.08.24 17:53t/p780.011752.450.001752.456.081085.54
1572022.09.05 20:00buy790.011712.490.001716.59
1582022.09.06 03:22t/p790.011716.590.001716.593.661089.20
1592022.09.08 07:15buy800.011717.050.001722.73
1602022.09.08 13:37t/p800.011722.730.001722.735.681094.88
1612022.09.30 16:45buy810.011669.310.001683.17
1622022.10.03 17:22t/p810.011683.170.001683.1713.421108.31
1632022.10.04 06:45buy820.011700.570.001710.29
1642022.10.04 10:18t/p820.011710.290.001710.299.721118.03
1652022.10.24 07:45buy830.011658.540.001667.78
1662022.10.25 16:48close830.011659.050.001667.780.071118.10
1672022.10.26 03:00buy840.011653.320.001656.82
1682022.10.26 06:27t/p840.011656.820.001656.823.501121.60
1692022.10.26 18:15buy850.011672.250.001688.35
1702022.10.27 08:45buy860.011669.970.001683.09
1712022.10.27 11:16buy870.011665.690.001671.40
1722022.10.28 04:58close870.011666.210.001671.400.081121.68
1732022.10.28 04:58close860.011666.210.001683.09-4.201117.49
1742022.10.28 04:58close850.011666.210.001688.35-7.781109.71
1752022.11.02 20:15buy880.011664.650.001682.75
1762022.11.02 22:53close880.011634.640.001682.75-30.011079.70
1772022.11.07 05:32buy890.011673.540.001679.06
1782022.11.07 11:26t/p890.011679.060.001679.065.521085.22
1792022.11.10 13:00buy900.011708.750.001717.39
1802022.11.10 15:31t/p900.011717.390.001717.398.641093.86
1812022.11.11 06:45buy910.011752.250.001756.31
1822022.11.11 07:27t/p910.011756.310.001756.314.061097.92
1832022.11.14 05:15buy920.011765.390.001773.49
1842022.11.14 09:45buy930.011762.610.001767.41
1852022.11.14 16:40t/p930.011767.410.001767.414.801102.72
1862022.11.14 17:12t/p920.011773.490.001773.498.101110.82
1872022.11.25 13:15buy940.011754.060.001758.45
1882022.11.28 10:41t/p940.011758.450.001758.453.951114.77
1892022.12.08 13:45buy950.011784.960.001789.60
1902022.12.08 15:33t/p950.011789.600.001789.604.641119.41
1912022.12.09 13:00buy960.011795.010.001806.43
1922022.12.13 15:31close960.011795.560.001806.43-0.321119.09
1932022.12.14 03:01buy970.011811.700.001816.46
1942022.12.15 10:13close970.011781.700.001816.46-31.311087.78
1952022.12.22 02:15buy980.011816.330.001821.27
1962022.12.22 20:22close980.011786.320.001821.27-30.011057.77
1972022.12.30 03:00buy990.011816.700.001821.50
1982022.12.30 09:01t/p990.011821.500.001821.504.801062.57
1992023.01.05 09:30buy1000.011854.580.001861.94
2002023.01.06 17:42t/p1000.011861.940.001861.946.921069.50
2012023.01.09 14:15buy1010.011875.580.001880.29
2022023.01.09 16:48t/p1010.011880.290.001880.294.711074.21
2032023.01.10 21:15buy1020.011876.290.001884.11
2042023.01.11 06:00buy1030.011878.160.001884.56
2052023.01.11 07:38t/p1020.011884.110.001884.117.381081.59
2062023.01.11 10:48t/p1030.011884.560.001884.566.401087.99
2072023.01.13 10:00buy1040.011900.080.001909.72
2082023.01.13 16:50t/p1040.011909.720.001909.729.641097.63
2092023.01.20 17:30buy1050.011930.500.001939.92
2102023.01.24 03:00close1050.011931.020.001939.92-0.351097.28
2112023.02.01 06:15buy1060.011928.490.001935.53
2122023.02.01 21:42t/p1060.011935.530.001935.537.041104.32
2132023.02.20 04:30buy1070.011842.720.001851.28
2142023.02.21 16:35close1070.011843.230.001851.280.071104.40
2152023.03.01 04:00buy1080.011829.530.001841.59
2162023.03.01 16:38t/p1080.011841.590.001841.5912.061116.46
2172023.03.13 11:00buy1090.011885.940.001910.34
2182023.03.13 16:46t/p1090.011910.340.001910.3424.401140.86
2192023.03.14 08:15buy1100.011911.370.001920.84
2202023.03.14 14:15buy1110.011907.700.001919.34
2212023.03.14 19:00buy1120.011909.110.001922.09
2222023.03.15 14:01t/p1110.011919.340.001919.3411.201152.06
2232023.03.15 14:02t/p1100.011920.840.001920.849.031161.10
2242023.03.15 14:03t/p1120.011922.090.001922.0912.541173.64
2252023.03.16 01:15buy1130.011921.580.001928.78
2262023.03.16 14:21t/p1130.011928.780.001928.787.201180.84
2272023.03.16 21:15buy1140.011920.100.001930.02
2282023.03.17 06:54t/p1140.011930.020.001930.029.481190.33
2292023.03.20 06:15buy1150.011974.960.001978.92
2302023.03.20 07:46t/p1150.011978.920.001978.923.961194.29
2312023.03.24 05:58buy1160.011993.750.001997.31
2322023.03.24 12:08t/p1160.011997.310.001997.313.561197.85
2332023.03.31 14:00buy1170.011979.810.001984.61
2342023.03.31 15:33t/p1170.011984.610.001984.614.801202.65
2352023.04.12 15:45buy1180.012022.610.002038.60
2362023.04.13 15:46t/p1180.012038.600.002038.6014.681217.33
2372023.04.26 09:45buy1190.011998.920.002007.18
2382023.04.26 16:26t/p1190.012007.180.002007.188.261225.59
2392023.05.03 11:40buy1200.012016.670.002020.09
2402023.05.03 14:00buy1210.012016.960.002019.66
2412023.05.03 16:30buy1220.012019.060.002029.60
2422023.05.03 16:35t/p1210.012019.660.002019.662.701228.29
2432023.05.03 17:52t/p1200.012020.090.002020.093.421231.71
2442023.05.03 21:00t/p1220.012029.600.002029.6010.541242.25
2452023.05.31 08:00buy1230.011960.480.001966.80
2462023.05.31 13:45buy1240.011958.910.001966.07
2472023.05.31 16:42t/p1240.011966.070.001966.077.161249.41
2482023.05.31 16:42t/p1230.011966.800.001966.806.321255.73
2492023.06.01 02:15buy1250.011966.240.001972.42
2502023.06.01 16:35t/p1250.011972.420.001972.426.181261.91
2512023.06.02 05:00buy1260.011977.770.001981.10
2522023.06.02 06:06t/p1260.011981.100.001981.103.331265.24
2532023.06.02 12:45buy1270.011981.060.001991.44
2542023.06.02 20:51close1270.011951.060.001991.44-30.001235.24
+
diff --git a/Docs/Reports/14020427/Whole StrategyTester.gif b/Docs/Reports/14020427/Whole StrategyTester.gif new file mode 100644 index 0000000000000000000000000000000000000000..84c508ef5e1c261aa4dc69f25dce0b05c66534a3 GIT binary patch literal 9194 zcmch+^juWD-#UfCF6J3dH}9NB)IW_&)$J*l?9p zAd>!%2mshNT$NrGUqKDFIE7XudEHjwN)u_@VB2~n4FC)(D72EVPymkfe=4>(fbBZ@ zijHi(>Ts33azsWdC|qeN{BKogxbg=8kgnX=A{(ySAQc)&SHacNdR2+M0tW#KgIBDp zKFBN5)tUZh;wt|?q=7_2l89H4?NttdvsD0Gsa+W&DFCj9?bZJ3=>I=oVpmTe@V|Ef zpe2U@!l2<1kx?)>B045EE*_bXn3SB7nwFlCnU$TBo0nfuSX5ksLYHE&W#tu>Rk-S! z+PeCNMm(XZxuvzOy`!`1%h&Fn-oE~U!J*-ABctUM6O&WZGsM|B()_~W((=mc+V}O1 zADdg-JG*=P2Zuj@{XY8h_xKP;k$3IiW$p#wa)%AMtg1)Nd~-e-x$;z(K|pzkEn)S! z4*R1^(lMe)EtFpc@gG;>ca5lfhPlbu@QrAn@ z85wG+3*AeplQuHepzx?nMA!o;bg1cJ1Bh)v*fUxdVW#gg=4LPGxabu`@4MWqawgyF zrta|GpQ}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000000..31e957c --- /dev/null +++ b/Docs/Reports/14020427/Whole StrategyTester.htm @@ -0,0 +1,333 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.19 23:45 (2020.01.01 - 2023.07.20)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test62525Ticks modelled71468432Modelling qualityn/a
Mismatched charts errors753
Initial deposit1000.00SpreadCurrent (60)
Total net profit225.21Gross profit749.40Gross loss-524.19
Profit factor1.43Expected payoff1.69
Absolute drawdown36.70Maximal drawdown158.55 (13.22%)Relative drawdown13.22% (158.55)
Total trades133Short positions (won %)0 (0.00%)Long positions (won %)133 (81.95%)
Profit trades (% of total)109 (81.95%)Loss trades (% of total)24 (18.05%)
Largestprofit trade42.29loss trade-32.32
Averageprofit trade6.88loss trade-21.84
Maximumconsecutive wins (profit in money)19 (161.19)consecutive losses (loss in money)4 (-122.72)
Maximalconsecutive profit (count of wins)161.19 (19)consecutive loss (count of losses)-122.72 (4)
Averageconsecutive wins8consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 08:30buy10.011814.650.001821.46
22020.12.02 10:36t/p10.011821.460.001821.466.811006.81
32020.12.04 14:15buy20.011842.800.001850.56
42020.12.04 16:15buy30.011843.600.001853.88
52020.12.07 16:49t/p20.011850.560.001850.567.371014.18
62020.12.07 16:52t/p30.011853.880.001853.889.891024.08
72020.12.18 01:00buy40.011885.000.001888.32
82020.12.18 14:09t/p40.011888.320.001888.323.321027.40
92021.01.05 05:45buy50.011942.240.001952.02
102021.01.05 16:16t/p50.011952.020.001952.029.781037.18
112021.02.09 03:15buy60.011835.780.001848.28
122021.02.09 11:54t/p60.011848.280.001848.2812.501049.68
132021.02.10 15:15buy70.011844.720.001851.27
142021.02.10 15:37t/p70.011851.270.001851.276.551056.23
152021.03.10 03:15buy80.011718.660.001729.62
162021.03.10 15:15buy90.011714.780.001724.10
172021.03.10 21:06t/p90.011724.100.001724.109.321065.55
182021.03.11 04:07t/p80.011729.620.001729.629.801075.35
192021.03.16 12:30buy100.011733.130.001738.03
202021.03.16 16:24t/p100.011738.030.001738.034.901080.25
212021.04.06 13:30buy110.011732.140.001734.94
222021.04.06 14:24t/p110.011734.940.001734.942.801083.05
232021.04.08 03:00buy120.011737.240.001740.18
242021.04.08 08:03t/p120.011740.180.001740.182.941085.99
252021.04.09 04:30buy130.011757.010.001760.40
262021.04.13 08:36close130.011727.010.001760.40-30.771055.22
272021.04.14 09:15buy140.011746.520.001751.83
282021.04.14 15:39buy150.011746.760.001756.02
292021.04.15 15:19t/p140.011751.830.001751.834.151059.38
302021.04.15 16:54t/p150.011756.020.001756.028.101067.48
312021.04.21 14:15buy160.011782.450.001791.05
322021.04.21 16:49t/p160.011791.050.001791.058.601076.08
332021.05.10 23:15buy170.011837.760.001843.26
342021.05.11 11:45buy180.011837.410.001846.05
352021.05.12 16:04t/p170.011843.260.001843.264.731080.81
362021.05.14 15:16close180.011837.920.001846.05-1.421079.40
372021.05.19 06:45buy190.011869.240.001874.28
382021.05.19 16:00t/p190.011874.280.001874.285.041084.44
392021.07.02 20:45buy200.011785.590.001792.91
402021.07.05 11:06t/p200.011792.910.001792.916.931091.37
412021.07.06 01:06buy210.011791.770.001794.39
422021.07.06 04:45t/p210.011794.390.001794.392.621093.99
432021.07.12 03:30buy220.011809.370.001816.23
442021.07.13 15:39t/p220.011816.230.001816.236.471100.47
452021.07.15 08:45buy230.011828.770.001834.57
462021.07.19 15:06close230.011798.770.001834.57-30.771069.70
472021.07.30 04:30buy240.011829.950.001835.53
482021.07.30 10:15buy250.011830.190.001836.63
492021.08.04 16:09close240.011830.460.001835.53-0.651069.05
502021.08.04 16:22close250.011830.700.001836.63-0.651068.41
512021.08.12 07:30buy260.011752.610.001758.59
522021.08.13 09:24t/p260.011758.590.001758.595.591074.00
532021.08.17 08:15buy270.011787.930.001791.97
542021.08.17 08:52t/p270.011791.970.001791.974.041078.04
552021.09.15 06:45buy280.011804.030.001806.41
562021.09.15 09:15buy290.011803.620.001806.36
572021.09.15 15:24t/p290.011806.360.001806.362.741080.78
582021.09.15 15:24t/p280.011806.410.001806.412.381083.16
592021.09.22 04:45buy300.011776.600.001780.45
602021.09.22 21:07t/p300.011780.450.001780.453.851087.01
612021.10.01 10:00buy310.011756.170.001765.71
622021.10.04 09:00buy320.011761.820.001765.62
632021.10.04 17:39t/p320.011765.620.001765.623.801090.81
642021.10.04 17:39t/p310.011765.710.001765.719.151099.97
652021.10.13 04:00buy330.011761.880.001765.16
662021.10.13 10:39t/p330.011765.160.001765.163.281103.25
672021.10.21 04:00buy340.011784.290.001789.57
682021.10.22 09:31t/p340.011789.570.001789.574.891108.14
692021.10.25 01:15buy350.011793.940.001797.00
702021.10.25 03:54t/p350.011797.000.001797.003.061111.20
712021.11.05 15:15buy360.011796.030.001806.59
722021.11.05 17:22t/p360.011806.590.001806.5910.561121.76
732021.11.08 12:15buy370.011818.130.001823.43
742021.11.08 15:24t/p370.011823.430.001823.435.301127.06
752021.11.18 09:49buy380.011867.550.001875.57
762021.11.22 12:39close380.011837.550.001875.57-30.771096.29
772021.12.07 08:00buy390.011781.410.001785.45
782021.12.07 18:24t/p390.011785.450.001785.454.041100.33
792021.12.14 03:00buy400.011788.260.001793.76
802021.12.14 08:15buy410.011788.520.001793.80
812021.12.15 21:00close410.011758.510.001793.80-30.401069.94
822021.12.15 21:00close400.011758.250.001793.76-30.401039.54
832021.12.23 15:30buy420.011808.530.001813.33
842021.12.28 06:45buy430.011810.940.001813.94
852021.12.28 07:54t/p420.011813.330.001813.333.641043.19
862021.12.28 08:36t/p430.011813.940.001813.943.001046.19
872022.01.11 15:30buy440.011808.530.001814.47
882022.01.11 18:22t/p440.011814.470.001814.475.941052.13
892022.01.12 07:34buy450.011820.620.001824.28
902022.01.12 15:39t/p450.011824.280.001824.283.661055.79
912022.01.13 05:22buy460.011825.620.001827.54
922022.01.13 07:39t/p460.011827.540.001827.541.921057.71
932022.01.26 04:00buy470.011848.320.001851.06
942022.01.26 21:54close470.011818.320.001851.06-30.001027.71
952022.02.01 18:30buy480.011807.070.001815.95
962022.02.04 17:30close480.011807.580.001815.95-1.421026.29
972022.02.09 03:45buy490.011826.840.001829.58
982022.02.09 14:30buy500.011827.570.001828.85
992022.02.09 15:04t/p500.011828.850.001828.851.281027.57
1002022.02.09 15:04t/p490.011829.580.001829.582.741030.31
1012022.02.18 15:00buy510.011894.370.001904.85
1022022.02.21 01:24t/p510.011904.850.001904.8510.091040.41
1032022.03.02 08:45buy520.011937.780.001948.72
1042022.03.04 02:39t/p520.011948.720.001948.729.401049.81
1052022.03.04 11:15buy530.011941.760.001956.50
1062022.03.04 16:37t/p530.011956.500.001956.5014.741064.55
1072022.03.07 17:45buy540.011989.520.002032.20
1082022.03.08 06:45buy550.011990.020.001999.84
1092022.03.08 08:30t/p550.011999.840.001999.849.821074.37
1102022.03.08 16:49t/p540.012032.200.002032.2042.291116.66
1112022.03.24 08:15buy560.011943.000.001948.07
1122022.03.24 13:31t/p560.011948.070.001948.075.071121.73
1132022.03.25 03:00buy570.011963.180.001973.08
1142022.03.28 08:54close570.011933.170.001973.08-30.401091.33
1152022.04.08 03:00buy580.011933.440.001938.38
1162022.04.08 15:09t/p580.011938.380.001938.384.941096.27
1172022.04.11 08:45buy590.011945.070.001949.77
1182022.04.11 11:19t/p590.011949.770.001949.774.701100.97
1192022.04.12 14:15buy600.011956.780.001966.56
1202022.04.12 15:39t/p600.011966.560.001966.569.781110.75
1212022.04.13 04:49buy610.011968.270.001977.63
1222022.04.13 12:39t/p610.011977.630.001977.639.361120.11
1232022.04.14 02:00buy620.011978.770.001982.79
1242022.04.14 05:00buy630.011980.150.001986.33
1252022.04.14 10:45buy640.011977.610.001984.30
1262022.04.18 02:37t/p620.011982.790.001982.793.251123.36
1272022.04.18 02:46t/p640.011984.300.001984.305.921129.28
1282022.04.18 02:49t/p630.011986.330.001986.335.411134.69
1292022.05.05 13:30buy650.011898.350.001907.79
1302022.05.05 15:49t/p650.011907.790.001907.799.441144.13
1312022.05.20 18:15buy660.011844.280.001855.78
1322022.05.23 08:08t/p660.011855.780.001855.7811.111155.25
1332022.05.24 06:30buy670.011855.020.001865.48
1342022.05.24 16:47t/p670.011865.480.001865.4810.461165.71
1352022.05.30 16:30buy680.011860.950.001873.85
1362022.06.01 08:16close680.011830.950.001873.85-30.771134.94
1372022.06.09 02:15buy690.011854.430.001859.21
1382022.06.10 17:56t/p690.011859.210.001859.214.391139.33
1392022.06.17 08:15buy700.011847.480.001852.86
1402022.06.23 20:45close700.011828.540.001852.86-21.251118.08
1412022.07.22 09:00buy710.011716.360.001722.06
1422022.07.22 12:28t/p710.011722.060.001722.065.701123.78
1432022.07.25 01:15buy720.011726.580.001733.12
1442022.07.25 12:25t/p720.011733.120.001733.126.541130.32
1452022.08.01 05:15buy730.011764.230.001769.55
1462022.08.01 09:45buy740.011764.350.001769.94
1472022.08.01 12:41t/p730.011769.550.001769.555.321135.64
1482022.08.01 12:42t/p740.011769.940.001769.945.591141.23
1492022.08.01 21:00buy750.011769.500.001770.16
1502022.08.01 22:13t/p750.011770.160.001770.160.661141.89
1512022.08.02 12:15buy760.011773.930.001780.13
1522022.08.02 15:15t/p760.011780.130.001780.136.201148.09
1532022.08.05 07:45buy770.011792.140.001793.36
1542022.08.09 13:42t/p770.011793.360.001793.360.451148.54
1552022.08.24 17:00buy780.011746.370.001752.45
1562022.08.24 17:53t/p780.011752.450.001752.456.081154.62
1572022.09.05 20:00buy790.011712.490.001716.59
1582022.09.06 03:22t/p790.011716.590.001716.593.711158.34
1592022.09.08 07:15buy800.011717.050.001722.73
1602022.09.08 13:37t/p800.011722.730.001722.735.681164.02
1612022.09.30 16:45buy810.011669.310.001683.17
1622022.10.03 17:22t/p810.011683.170.001683.1713.471177.49
1632022.10.04 06:45buy820.011700.570.001710.29
1642022.10.04 10:18t/p820.011710.290.001710.299.721187.21
1652022.10.24 07:45buy830.011658.540.001667.78
1662022.10.26 03:00buy840.011653.320.001656.82
1672022.10.26 06:27t/p840.011656.820.001656.823.501190.71
1682022.10.26 10:28t/p830.011667.780.001667.788.471199.18
1692022.10.26 18:15buy850.011672.250.001688.35
1702022.10.27 08:45buy860.011669.970.001683.09
1712022.10.27 11:16buy870.011665.690.001671.40
1722022.10.28 15:30close850.011642.250.001688.35-31.541167.64
1732022.10.28 18:16close860.011639.970.001683.09-30.391137.26
1742022.10.31 10:33close870.011635.680.001671.40-30.781106.48
1752022.11.02 20:15buy880.011664.650.001700.85
1762022.11.02 22:53close880.011634.640.001700.85-30.011076.47
1772022.11.07 05:32buy890.011673.540.001679.06
1782022.11.07 11:26t/p890.011679.060.001679.065.521081.99
1792022.11.10 13:00buy900.011708.750.001717.39
1802022.11.10 15:31t/p900.011717.390.001717.398.641090.63
1812022.11.11 06:45buy910.011752.250.001756.31
1822022.11.11 07:27t/p910.011756.310.001756.314.061094.69
1832022.11.14 05:15buy920.011765.390.001773.49
1842022.11.14 09:45buy930.011762.610.001767.41
1852022.11.14 16:40t/p930.011767.410.001767.414.801099.49
1862022.11.14 17:12t/p920.011773.490.001773.498.101107.59
1872022.11.25 13:15buy940.011754.060.001758.45
1882022.11.28 10:41t/p940.011758.450.001758.454.001111.59
1892022.12.08 13:45buy950.011784.960.001789.60
1902022.12.08 15:33t/p950.011789.600.001789.604.641116.23
1912022.12.09 13:00buy960.011795.010.001806.43
1922022.12.13 15:33t/p960.011806.430.001806.4310.651126.88
1932022.12.14 03:01buy970.011811.700.001816.46
1942022.12.15 10:13close970.011781.700.001816.46-31.161095.73
1952022.12.22 02:15buy980.011816.330.001821.27
1962022.12.22 20:22close980.011786.320.001821.27-30.011065.72
1972022.12.30 03:00buy990.011816.700.001821.50
1982022.12.30 09:01t/p990.011821.500.001821.504.801070.52
1992023.01.05 09:30buy1000.011854.580.001861.94
2002023.01.06 17:42t/p1000.011861.940.001861.946.971077.49
2012023.01.09 14:15buy1010.011875.580.001880.29
2022023.01.09 16:48t/p1010.011880.290.001880.294.711082.20
2032023.01.10 21:15buy1020.011876.290.001884.11
2042023.01.11 06:00buy1030.011878.160.001884.56
2052023.01.11 07:38t/p1020.011884.110.001884.117.431089.64
2062023.01.11 10:48t/p1030.011884.560.001884.566.401096.04
2072023.01.13 10:00buy1040.011900.080.001909.72
2082023.01.13 16:50t/p1040.011909.720.001909.729.641105.68
2092023.01.20 17:30buy1050.011930.500.001939.92
2102023.01.24 09:02t/p1050.011939.920.001939.928.651114.33
2112023.02.01 06:15buy1060.011928.490.001935.53
2122023.02.01 21:42t/p1060.011935.530.001935.537.041121.37
2132023.02.20 04:30buy1070.011842.720.001851.28
2142023.02.24 15:33close1070.011812.710.001851.28-32.321089.05
2152023.03.01 04:00buy1080.011829.530.001841.59
2162023.03.01 16:38t/p1080.011841.590.001841.5912.061101.11
2172023.03.13 11:00buy1090.011885.940.001910.34
2182023.03.13 16:46t/p1090.011910.340.001910.3424.401125.51
2192023.03.14 08:15buy1100.011911.370.001920.84
2202023.03.14 14:15buy1110.011907.700.001919.34
2212023.03.14 19:00buy1120.011909.110.001922.09
2222023.03.15 14:01t/p1110.011919.340.001919.3411.251136.76
2232023.03.15 14:02t/p1100.011920.840.001920.849.081145.85
2242023.03.15 14:03t/p1120.011922.090.001922.0912.591158.44
2252023.03.16 01:15buy1130.011921.580.001928.78
2262023.03.16 14:21t/p1130.011928.780.001928.787.201165.64
2272023.03.16 21:15buy1140.011920.100.001930.02
2282023.03.17 06:54t/p1140.011930.020.001930.029.531175.17
2292023.03.20 06:15buy1150.011974.960.001978.92
2302023.03.20 07:46t/p1150.011978.920.001978.923.961179.13
2312023.03.24 05:58buy1160.011993.750.001997.31
2322023.03.24 12:08t/p1160.011997.310.001997.313.561182.69
2332023.03.31 14:00buy1170.011979.810.001984.61
2342023.03.31 15:33t/p1170.011984.610.001984.614.801187.49
2352023.04.12 15:45buy1180.012022.610.002038.60
2362023.04.13 15:46t/p1180.012038.600.002038.6014.831202.33
2372023.04.26 09:45buy1190.011998.920.002007.18
2382023.04.26 16:26t/p1190.012007.180.002007.188.261210.59
2392023.05.03 11:40buy1200.012016.670.002020.09
2402023.05.03 14:00buy1210.012016.960.002019.66
2412023.05.03 16:30buy1220.012019.060.002029.60
2422023.05.03 16:35t/p1210.012019.660.002019.662.701213.29
2432023.05.03 17:52t/p1200.012020.090.002020.093.421216.71
2442023.05.03 21:00t/p1220.012029.600.002029.6010.541227.25
2452023.05.31 08:00buy1230.011960.480.001966.80
2462023.05.31 13:45buy1240.011958.910.001966.07
2472023.05.31 16:42t/p1240.011966.070.001966.077.161234.41
2482023.05.31 16:42t/p1230.011966.800.001966.806.321240.73
2492023.06.01 02:15buy1250.011966.240.001972.42
2502023.06.01 16:35t/p1250.011972.420.001972.426.181246.91
2512023.06.02 05:00buy1260.011977.770.001981.10
2522023.06.02 06:06t/p1260.011981.100.001981.103.331250.24
2532023.06.02 12:45buy1270.011981.060.001991.44
2542023.06.02 20:51close1270.011951.060.001991.44-30.001220.24
2552023.07.03 07:00buy1280.011918.700.001922.42
2562023.07.03 16:16t/p1280.011922.420.001922.423.721223.96
2572023.07.11 19:45buy1290.011932.790.001935.57
2582023.07.12 03:35t/p1290.011935.570.001935.572.391226.35
2592023.07.13 16:15buy1300.011961.140.001969.50
2602023.07.18 14:16t/p1300.011969.500.001969.507.201233.56
2612023.07.19 10:15buy1310.011980.120.001986.85
2622023.07.19 15:30buy1320.011978.550.001984.68
2632023.07.19 20:08buy1330.011979.090.001989.95
2642023.07.19 23:54close at stop1330.011976.470.001989.95-2.621230.94
2652023.07.19 23:54close at stop1320.011976.470.001984.68-2.081228.86
2662023.07.19 23:54close at stop1310.011976.470.001986.85-3.651225.21
+
diff --git a/Docs/Reports/14020427/XR Strategy Test 1.gif b/Docs/Reports/14020427/XR Strategy Test 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..d3f1e22e0cac0b9c78b9dd3aced40b0193082034 GIT binary patch literal 7402 zcmch5^`V1d4o z-iW~f3kv|?KTE<5jJ7BTH^T{Q7T_Cy_zeUG-;gYt0RSu*+)TIu0Oh#+udE5P;kUHFoM78yO;TpWB^Nt61K+`!%F6=jWkPp@$&uv|qyc6r!4 zhL}~A5Uw{FaY-?2YGFd3TgDk;3wre=ayRGts|vN>GK!GZh*j&pQG3n96<;l;+m?pP z;$Tt$yd@&ZDa`@E`1Ahud8K^oCh!7E}XcY1m(a3f21)?~B z+#O^!uU=QqfketELD>~M0?Pvt#yL7fl|hsYqTh7#KEHU3flK|!T2~w+Zv66w*6D!A zX6s|2)Gwi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eD&_OlAj_~ zf=)oK(xVd@eI>d{T0hP}GCwVSSisA2dP=x|!F@}Z5*OYjn~o!0$EAps%|D2uZCSST zm6!%%gb73PIwvbzS@ja@$#F?{_fbzft!A_n%k75?EWxkv6FL!q=`U1^y)Td59Ky?U zKi})^MWX2ccvfLKI12DRS!8{oTGA8uuzEdoYF~8Ri%q$1kv-SvnMFYhJwc9=4a~6jz~P&S%HK zL5d%ZOIqR-bY>V(_8)y$`;L<~pkLiAWh)V@{UcEjh0NBmck-(~QZDKl)3DW|NF6^i zoC-ce{3vox-?1%}UIYz8FwPlA#f7r_p~IeA&Y71xh4KW@h%d#DEK(taA}wqrkpD+^ J9EcPk{eP8ZSAPHi literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/XR Strategy Test 1.htm b/Docs/Reports/14020427/XR Strategy Test 1.htm new file mode 100644 index 0000000..98bc578 --- /dev/null +++ b/Docs/Reports/14020427/XR Strategy Test 1.htm @@ -0,0 +1,138 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit2337.40Gross profit2533.14Gross loss-195.74
Profit factor12.94Expected payoff57.01
Absolute drawdown600.00Maximal drawdown1787.50 (55.97%)Relative drawdown69.29% (1556.27)
Total trades41Short positions (won %)0 (0.00%)Long positions (won %)41 (95.12%)
Profit trades (% of total)39 (95.12%)Loss trades (% of total)2 (4.88%)
Largestprofit trade75.00loss trade-107.85
Averageprofit trade64.95loss trade-97.87
Maximumconsecutive wins (profit in money)17 (1231.46)consecutive losses (loss in money)1 (-107.85)
Maximalconsecutive profit (count of wins)1231.46 (17)consecutive loss (count of losses)-107.85 (1)
Averageconsecutive wins13consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.02 15:15buy10.501824.660.001826.16
22020.12.02 17:39t/p10.501826.160.001826.1675.001075.00
32021.01.11 04:00buy20.501829.260.001830.76
42021.01.11 04:31t/p20.501830.760.001830.7675.001150.00
52021.02.12 14:00buy30.501819.170.001820.67
62021.02.12 17:46t/p30.501820.670.001820.6775.001225.00
72021.02.15 10:30buy40.501819.510.001821.01
82021.02.15 13:39t/p40.501821.010.001821.0175.001300.00
92021.02.15 18:15buy50.501819.540.001821.04
102021.02.16 02:24t/p50.501821.040.001821.0453.231353.23
112021.05.07 06:15buy60.501819.850.001821.35
122021.05.07 06:24t/p60.501821.350.001821.3575.001428.23
132021.05.07 10:30buy70.501820.000.001821.50
142021.05.07 11:34t/p70.501821.500.001821.5075.001503.23
152021.05.07 16:00buy80.501839.160.001840.66
162021.05.07 16:03t/p80.501840.660.001840.6675.001578.23
172021.05.13 04:30buy90.501822.150.001823.65
182021.05.13 17:51t/p90.501823.650.001823.6575.001653.23
192021.06.17 02:45buy100.501820.030.001821.53
202021.06.17 04:54t/p100.501821.530.001821.5375.001728.23
212021.07.14 15:30buy110.501824.340.001825.84
222021.07.14 15:34t/p110.501825.840.001825.8475.001803.23
232021.07.16 15:45buy120.501823.910.001825.41
242021.07.16 16:39t/p120.501825.410.001825.4175.001878.23
252021.07.29 10:15buy130.501819.440.001820.94
262021.07.29 11:39t/p130.501820.940.001820.9475.001953.23
272021.08.27 22:30buy140.501818.730.001820.23
282021.08.30 03:37t/p140.501820.230.001820.2353.232006.46
292021.08.30 03:45buy150.501820.450.001821.95
302021.08.30 04:06t/p150.501821.950.001821.9575.002081.46
312021.09.03 16:00buy160.501823.920.001825.42
322021.09.03 16:09t/p160.501825.420.001825.4275.002156.46
332021.11.08 15:45buy170.501819.340.001820.84
342021.11.08 15:54t/p170.501820.840.001820.8475.002231.46
352021.12.28 15:45buy180.501819.710.001821.21
362021.12.31 11:09close180.501819.730.001821.21-107.852123.61
372022.01.05 15:15buy190.501820.490.001821.99
382022.01.05 15:24t/p190.501821.990.001821.9975.002198.61
392022.01.12 16:00buy200.501821.690.001823.19
402022.01.12 16:37t/p200.501823.190.001823.1975.002273.61
412022.01.18 18:00buy210.501820.250.001821.75
422022.01.19 15:21t/p210.501821.750.001821.7553.232326.84
432022.01.19 15:21buy220.501822.350.001823.85
442022.01.19 15:24t/p220.501823.850.001823.8575.002401.84
452022.02.08 10:45buy230.501820.380.001821.88
462022.02.08 15:39t/p230.501821.880.001821.8875.002476.84
472022.05.13 02:15buy240.501820.070.001821.57
482022.05.13 02:47t/p240.501821.570.001821.5775.002551.84
492022.05.13 14:15buy250.501818.840.001820.34
502022.05.16 21:56t/p250.501820.340.001820.3453.232605.07
512022.05.18 13:00buy260.501819.810.001821.31
522022.05.18 18:41t/p260.501821.310.001821.3175.002680.07
532022.05.18 19:00buy270.501823.970.001825.47
542022.05.19 12:08t/p270.501825.470.001825.479.692689.76
552022.06.14 16:15buy280.501820.010.001821.51
562022.06.15 09:37t/p280.501821.510.001821.5153.232742.99
572022.06.15 09:37buy290.501822.110.001823.61
582022.06.15 10:42t/p290.501823.610.001823.6175.002817.99
592022.06.16 15:15buy300.501823.900.001825.40
602022.06.16 15:31t/p300.501825.400.001825.4075.002892.99
612022.06.24 16:30buy310.501826.410.001827.91
622022.06.24 17:09t/p310.501827.910.001827.9175.002967.99
632022.06.29 19:15buy320.501818.970.001820.47
642022.06.30 03:49t/p320.501820.470.001820.479.692977.68
652022.12.13 17:00buy330.501822.380.001823.88
662022.12.13 17:00t/p330.501823.880.001823.8875.003052.68
672022.12.21 15:45buy340.501819.140.001820.64
682022.12.21 17:08t/p340.501820.640.001820.6475.003127.68
692022.12.22 05:15buy350.501818.900.001820.40
702022.12.27 17:26t/p350.501820.400.001820.409.693137.37
712022.12.27 17:45buy360.501827.790.001829.29
722023.01.03 01:05close360.501829.080.001829.29-87.893049.48
732023.01.03 01:05buy370.501829.670.001831.17
742023.01.03 02:12t/p370.501831.170.001831.1775.003124.48
752023.02.23 16:00buy380.501825.940.001827.44
762023.02.23 16:17t/p380.501827.440.001827.4475.003199.48
772023.02.27 20:15buy390.501819.340.001820.84
782023.02.28 17:00t/p390.501820.840.001820.8453.233252.71
792023.03.07 18:45buy400.501819.710.001821.21
802023.03.07 19:13t/p400.501821.210.001821.2175.003327.71
812023.03.08 17:45buy410.501820.430.001821.93
822023.03.09 15:33t/p410.501821.930.001821.939.693337.40
+
diff --git a/Docs/Reports/14020427/XR Strategy Test 2.gif b/Docs/Reports/14020427/XR Strategy Test 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..bbc122207b234d1a72ab01f331f2759077e52c65 GIT binary patch literal 8409 zcmch5^;;9(`}YWi(V!q5iqfcn0;5ssP(%a-0Z}?tx<(AP0i$a)QloQp3ycP(M>nI9 zu6_Bupa0=Gah-GBuek4X&TmIqRY^k9OpFKvSOWm?csu|A=&=$AM+bsZ(odf~O0Jj4)`TuzM!${D70YD%676eUV|04nb7U)~) ztr!HbumAx5v&7%RXp1sXQzU-X0(9#ic?*F+wRhzuYX{0Xt;>r@95b0#N^a8c4l^NeqnKGd1ZBNePa{1wY{^u zw|{W>@96mCbia%so$%@=?HX{ibw6@JUh57m`%G-)qM{}xmu&z2sHN8$^v`dwr|@42 z{+x1fUB>7Ym5|5p(qa>%SJgs=%$i3TV{*Io#D8th^i<|)zh`=Sr&_E^=bf4|&*Qi% zF`d?w!iQQf`m`e&Yq5$De(OX+MSv87V5P4O%P;;4GDgfXGAK-Ma4yNMG1Jh zBUVOIB9OuP5IjrEjR;+bFvcy>nQ0O;a8E@WlJjtiD=r#D8B+1Bm>@MzcnFYStREOLTR%yY9n-;DF#QyoVkr(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YH(B)UbkYtt7ao77aZ_qz9Si`$#3ah;F{4)&?+p34o$BMtlJf9cfM8|r=+ iqovKqr4iTLwtkm0d(EdU)HnN~epf3`jX41Tss97(xHrTA literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/XR Strategy Test 2.htm b/Docs/Reports/14020427/XR Strategy Test 2.htm new file mode 100644 index 0000000..1997074 --- /dev/null +++ b/Docs/Reports/14020427/XR Strategy Test 2.htm @@ -0,0 +1,241 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.xr.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=35; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=2; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=96; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (60)
Total net profit-22.73Gross profit140.12Gross loss-162.85
Profit factor0.86Expected payoff-0.26
Absolute drawdown35.59Maximal drawdown110.15 (10.25%)Relative drawdown10.25% (110.15)
Total trades87Short positions (won %)0 (0.00%)Long positions (won %)87 (88.51%)
Profit trades (% of total)77 (88.51%)Loss trades (% of total)10 (11.49%)
Largestprofit trade9.07loss trade-31.31
Averageprofit trade1.82loss trade-16.29
Maximumconsecutive wins (profit in money)33 (47.60)consecutive losses (loss in money)3 (-67.46)
Maximalconsecutive profit (count of wins)60.79 (24)consecutive loss (count of losses)-67.46 (3)
Averageconsecutive wins10consecutive losses1
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
1652022.07.20 16:45buy830.011710.780.001713.22
1662022.07.21 14:37close830.011680.780.001713.22-31.31967.80
1472022.05.10 14:45buy740.011863.420.001865.19
1482022.05.11 02:53close740.011833.400.001865.19-30.461038.94
792021.10.14 15:45buy400.011799.210.001800.37
802021.10.15 15:52close400.011769.200.001800.37-30.451021.80
1612022.07.05 02:15buy810.011810.010.001813.25
1622022.07.05 17:03close810.011779.990.001813.25-30.021005.24
492021.06.09 06:15buy250.011896.400.001903.47
502021.06.10 07:15close250.011886.580.001903.47-11.131049.67
1532022.06.14 10:00buy770.011830.310.001843.30
1542022.06.15 11:00close770.011820.620.001843.30-10.131031.93
512021.06.15 16:00buy260.011866.010.001868.96
522021.06.16 17:00close260.011858.760.001868.96-7.691041.98
1632022.07.12 13:00buy820.011735.390.001743.99
1642022.07.13 14:00close820.011729.690.001743.99-6.14999.10
732021.10.07 14:15buy370.011764.680.001764.87
762021.10.08 13:54close370.011760.360.001764.87-4.761052.17
672021.09.01 19:00buy340.011815.860.001816.89
682021.09.02 12:39close340.011816.370.001816.89-0.801054.22
692021.09.02 14:45buy350.011815.870.001815.87
702021.09.02 14:54t/p350.011815.870.001815.870.001054.22
1092021.12.22 17:15buy550.011792.860.001792.86
1102021.12.22 17:24t/p550.011792.860.001792.860.001044.70
392021.05.11 12:45buy200.011838.500.001838.54
402021.05.11 13:04t/p200.011838.540.001838.540.041052.35
1412022.03.10 12:15buy710.011995.580.001995.62
1422022.03.10 12:15t/p710.011995.620.001995.620.041066.30
192021.03.22 18:00buy100.011738.750.001742.92
202021.03.23 08:33close100.011739.260.001742.920.071036.18
352021.04.30 14:30buy180.011772.700.001773.44
362021.05.03 05:22close180.011773.210.001773.440.071049.31
592021.07.02 21:15buy300.011791.110.001794.84
602021.07.05 10:37close300.011791.620.001794.840.071051.48
772021.10.11 18:15buy390.011758.580.001760.18
782021.10.12 08:04close390.011759.090.001760.180.071052.24
912021.11.11 19:00buy460.011862.510.001865.78
922021.11.12 17:21close460.011863.020.001865.780.071032.55
1052021.12.10 06:30buy530.011779.380.001779.47
1062021.12.10 15:37t/p530.011779.470.001779.470.091043.66
1292022.02.04 09:00buy650.011807.450.001807.70
1302022.02.04 09:05t/p650.011807.700.001807.700.251057.24
1552022.06.17 15:45buy780.011850.980.001851.29
1562022.06.17 15:46t/p780.011851.290.001851.290.311032.24
972021.11.26 05:00buy490.011794.490.001794.82
982021.11.26 05:04t/p490.011794.820.001794.820.331039.16
332021.04.27 17:00buy170.011783.470.001783.89
342021.04.27 17:09t/p170.011783.890.001783.890.421049.24
132021.02.15 02:45buy70.011822.670.001830.54
142021.02.15 14:46close70.011823.180.001830.540.511023.20
412021.05.19 03:00buy210.011870.540.001874.85
422021.05.19 15:54close210.011871.050.001874.850.511052.86
532021.06.30 05:15buy270.011764.210.001765.55
542021.06.30 17:49close270.011764.720.001765.550.511042.49
742021.10.08 09:30buy380.011759.850.001762.96
752021.10.08 13:54close380.011760.360.001762.960.511056.92
1452022.04.26 06:15buy730.011905.400.001911.36
1462022.04.26 23:23close730.011905.910.001911.360.511069.40
1572022.06.21 05:00buy790.011841.920.001843.00
1582022.06.21 17:39close790.011842.430.001843.000.511032.75
1132021.12.27 07:15buy570.011810.970.001811.49
1142021.12.27 17:19t/p570.011811.490.001811.490.521045.84
1212022.01.07 16:30buy610.011792.620.001793.14
1222022.01.07 16:43t/p610.011793.140.001793.140.521051.06
1112021.12.23 10:15buy560.011807.640.001808.26
1122021.12.23 15:30t/p560.011808.260.001808.260.621045.32
1152022.01.04 11:45buy580.011806.180.001806.85
1162022.01.04 12:24t/p580.011806.850.001806.850.671046.51
252021.04.15 08:30buy130.011741.610.001742.31
262021.04.15 08:45t/p130.011742.310.001742.310.701041.75
892021.11.05 06:30buy450.011795.050.001795.76
902021.11.05 07:04t/p450.011795.760.001795.760.711032.48
1492022.05.12 03:30buy750.011855.500.001856.26
1502022.05.12 03:38t/p750.011856.260.001856.260.761039.70
872021.10.28 05:00buy440.011798.040.001798.85
882021.10.28 05:09t/p440.011798.850.001798.850.811031.77
1172022.01.05 04:00buy590.011815.740.001816.60
1182022.01.05 08:22t/p590.011816.600.001816.600.861047.37
1272022.01.31 01:30buy640.011790.370.001797.78
1282022.01.31 13:30close640.011791.330.001797.780.961056.99
1072021.12.13 10:15buy540.011787.030.001788.07
1082021.12.13 13:39t/p540.011788.070.001788.071.041044.70
1352022.02.11 14:45buy680.011830.390.001831.47
1362022.02.11 15:04t/p680.011831.470.001831.471.081061.35
112021.02.05 07:15buy60.011796.630.001797.72
122021.02.05 07:36t/p60.011797.720.001797.721.091022.69
1032021.12.07 17:45buy520.011783.270.001784.36
1042021.12.07 18:22t/p520.011784.360.001784.361.091043.57
1012021.12.03 18:30buy510.011777.270.001778.37
1022021.12.03 18:51t/p510.011778.370.001778.371.101042.48
632021.08.18 09:00buy320.011791.060.001792.18
642021.08.18 09:09t/p320.011792.180.001792.181.121053.80
1712022.08.23 11:00buy860.011738.700.001739.84
1722022.08.23 11:13t/p860.011739.840.001739.841.14975.10
1252022.01.25 08:30buy630.011842.670.001843.84
1262022.01.25 16:49t/p630.011843.840.001843.841.171056.03
612021.08.03 20:15buy310.011811.680.001813.32
622021.08.04 05:22t/p310.011813.320.001813.321.201052.68
652021.08.26 17:45buy330.011790.620.001791.84
662021.08.26 17:54t/p330.011791.840.001791.841.221055.02
1332022.02.09 12:15buy670.011827.680.001829.06
1342022.02.09 15:04t/p670.011829.060.001829.061.381060.27
832021.10.25 11:00buy420.011799.510.001800.90
842021.10.25 11:15t/p420.011800.900.001800.901.391025.44
92021.02.01 08:15buy50.011863.750.001875.61
102021.02.01 20:15close50.011865.280.001875.611.531021.60
472021.06.07 16:30buy240.011890.190.001891.73
482021.06.07 17:24t/p240.011891.730.001891.731.541060.79
1312022.02.07 11:00buy660.011813.460.001815.11
1322022.02.07 15:09t/p660.011815.110.001815.111.651058.89
272021.04.16 11:45buy140.011765.210.001767.00
282021.04.16 12:09t/p140.011767.000.001767.001.791043.54
1372022.02.18 23:00buy690.011897.400.001899.76
1382022.02.21 01:00t/p690.011899.760.001899.761.921063.28
212021.03.24 21:15buy110.011734.950.001738.29
222021.03.25 05:15t/p110.011738.290.001738.292.031038.21
452021.05.25 12:00buy230.011883.100.001885.26
462021.05.25 16:52t/p230.011885.260.001885.262.161059.25
1732022.08.24 21:00buy870.011749.940.001753.42
1742022.08.25 03:50t/p870.011753.420.001753.422.17977.27
712021.09.08 13:45buy360.011798.650.001800.84
722021.09.08 15:09t/p360.011800.840.001800.842.191056.41
992021.11.30 16:00buy500.011796.060.001798.28
1002021.11.30 16:49t/p500.011798.280.001798.282.221041.38
812021.10.19 16:00buy410.011782.030.001784.28
822021.10.19 16:01t/p410.011784.280.001784.282.251024.05
1512022.06.07 10:30buy760.011846.180.001848.53
1522022.06.07 12:20t/p760.011848.530.001848.532.351042.05
952021.11.16 03:30buy480.011865.160.001867.64
962021.11.16 04:37t/p480.011867.640.001867.642.481038.83
1592022.06.24 20:30buy800.011828.550.001831.50
1602022.06.27 01:00t/p800.011831.500.001831.502.511035.26
1432022.03.21 13:30buy720.011926.050.001928.64
1442022.03.21 15:52t/p720.011928.640.001928.642.591068.89
312021.04.26 21:45buy160.011780.270.001783.33
322021.04.27 04:01t/p160.011783.330.001783.332.621048.82
292021.04.19 09:45buy150.011780.760.001783.41
302021.04.19 10:39t/p150.011783.410.001783.412.651046.19
1672022.07.25 10:30buy840.011728.350.001731.02
1682022.07.25 12:18t/p840.011731.020.001731.022.67970.47
12020.12.03 16:15buy10.011840.090.001843.27
22020.12.04 04:52t/p10.011843.270.001843.272.741002.74
232021.03.31 12:15buy120.011685.800.001688.64
242021.03.31 13:39t/p120.011688.640.001688.642.841041.05
1392022.03.03 12:15buy700.011931.410.001934.39
1402022.03.03 12:30t/p700.011934.390.001934.392.981066.26
552021.07.01 16:45buy280.011779.550.001782.54
562021.07.01 17:03t/p280.011782.540.001782.542.991045.48
372021.05.10 09:00buy190.011839.010.001842.01
382021.05.10 15:09t/p190.011842.010.001842.013.001052.31
1192022.01.07 05:15buy600.011792.220.001795.39
1202022.01.07 15:39t/p600.011795.390.001795.393.171050.54
1692022.08.08 05:30buy850.011775.410.001778.90
1702022.08.08 10:48t/p850.011778.900.001778.903.49973.96
932021.11.15 13:15buy470.011863.840.001867.64
942021.11.15 15:09t/p470.011867.640.001867.643.801036.35
1232022.01.19 11:30buy620.011816.070.001819.87
1242022.01.19 15:17t/p620.011819.870.001819.873.801054.86
172021.03.16 15:30buy90.011733.170.001737.00
182021.03.16 16:21t/p90.011737.000.001737.003.831036.10
52020.12.08 04:00buy30.011864.270.001868.35
62020.12.08 04:54t/p30.011868.350.001868.354.081015.21
432021.05.21 12:30buy220.011877.800.001882.03
442021.05.21 15:19t/p220.011882.030.001882.034.231057.09
72020.12.31 13:45buy40.011894.880.001899.74
82020.12.31 17:31t/p40.011899.740.001899.744.861020.07
852021.10.27 18:00buy430.011792.490.001798.01
862021.10.27 21:27t/p430.011798.010.001798.015.521030.96
572021.07.02 03:30buy290.011776.660.001782.58
582021.07.02 11:22t/p290.011782.580.001782.585.921051.40
32020.12.07 07:15buy20.011839.630.001848.02
42020.12.07 16:49t/p20.011848.020.001848.028.391011.13
152021.03.02 12:30buy80.011727.470.001736.54
162021.03.02 19:36t/p80.011736.540.001736.549.071032.27
+
diff --git a/Docs/Reports/14020427/test 1.gif b/Docs/Reports/14020427/test 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..39e88dd89f9f3d9622723144d1d04db27aedb24c GIT binary patch literal 9949 zcmch+^JbB%4d-D+QD zCiMfL{Uj(Bdr7)H-~T0aN&3H?Ntdiy%4Nbfml%L(0|i_@HkZ@o>Hq(1_b%T);Qwj? zpreEU!onlq2qY>JjfskmiN(gnCnP2%<5E)7(lau%vU76tKIIn_7U7Fa2&HA^6~xM_ z>Y7?oU427iQ*%peTYE?6=PzB|J>=fL{(-@v;gM3R@vq+|Ca0!nX6NP?7MGU4udJ@E zZ)|RD@BG-^+dnw``Rn)5pT7r0s%+}>i>!Zui=FG(C1stfth{rH*kzTMi~>pn*W1inc6ZC)J_*D($-Pc)(De-Gs7zy*%ui%8jo_BJew&r@Pi*(;|+`n2Y zUGwI(mb&oWq#Efr?HPoe+nmaPw^THF<$2JMrIFAp^jAJc%f1_>rVa1Yf*M5<3^iRT zRQTw05}}xuYUHBy3||^f=LfQ%e^F1oU0kf7g5rPL89|J|o8-Nss)AnwOWD54H-C1g z4-4_gS${fC-DL5a+3kSJaoeB>GAi-q&r$wN!dyv^2Xt?4K0u<&<_lGX`79D~r^py6 zEx;teaLx#j-IXTNm5b-_-wv5)6^y}bz`;r1+00*FxhXguZ+K0ZUruG&AkL6Ubk#KN z_sr#b4dz7jS(EL&4+BP?3np-*QVvV#avRtKvkn zkYIo`krxoW_3gWTX{Ozhk97B&1y0|49)zu&aAj3I-luMsArdj__<}{MRg?Y`Dtj85(S1)8fMj~KX$b)h|^+z=bIfR_&RixBR<6oBTSk?ZZE(&r(PEc8ulfqfcx)2ruON`XKQGCFU5kaxiS0lf$nhGXTx>TL>hxrwuLVRot zHFN+njo?Ems%=ob)RhSNg9Cn?HKK!7%Sw|k*>FOcFAxADM(}IZoLBKz>x|#<=_)|I z`&fCmOxo1ASmY-AOBB6wCm`7??W<0ILG1*C#;$3nTXC|dlW{n|=d@K(=ENi*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zRNtqc2jlhcrD*<*{ak7*`Poh6FM%{SB|VrIPgXw2WxT7@d}SNT1{Wf`5~qB_tBy zdadqT2*B5|?lHYBa4BJ<0jIcA^KQ$grMLQ-c)6foeQ;_$c9uEJG39$-;xmDIw#J5x z8GUd1)HkPmAH~!2(;M9S8{o4kx&6iYjs#cQ`pO-m+bo}IZ=JV)lc&E*<@vP!zlX5) zvnH()rjC9T!RKcTUmT!(NlbDuiLd$G_%luBu;~ literal 0 HcmV?d00001 diff --git a/Docs/Reports/14020427/test 1.htm b/Docs/Reports/14020427/test 1.htm new file mode 100644 index 0000000..afc9bc5 --- /dev/null +++ b/Docs/Reports/14020427/test 1.htm @@ -0,0 +1,299 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolXAUUSD (Gold (Spot))
Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.29 23:45 (2020.01.01 - 2023.06.30)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=408; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +step=0.01; maximum=0.1; shortCycleMultiplier=2; mediumCycleMultiplier=6; longCycleMultiplier=36;
Bars in test61247Ticks modelled69753529Modelling quality40.22%
Mismatched charts errors33
Initial deposit1000.00SpreadCurrent (50)
Total net profit-1.93Gross profit395.60Gross loss-397.53
Profit factor1.00Expected payoff-0.02
Absolute drawdown93.42Maximal drawdown137.71 (13.19%)Relative drawdown13.19% (137.71)
Total trades116Short positions (won %)0 (0.00%)Long positions (won %)116 (36.21%)
Profit trades (% of total)42 (36.21%)Loss trades (% of total)74 (63.79%)
Largestprofit trade24.00loss trade-15.43
Averageprofit trade9.42loss trade-5.37
Maximumconsecutive wins (profit in money)4 (59.73)consecutive losses (loss in money)9 (-44.59)
Maximalconsecutive profit (count of wins)59.73 (4)consecutive loss (count of losses)-60.13 (8)
Averageconsecutive wins2consecutive losses3
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12020.12.01 02:45buy10.011779.481775.151786.48
22020.12.01 06:24t/p10.011786.481775.151786.487.001007.00
32020.12.02 01:30buy20.011812.601812.081813.44
42020.12.02 01:31s/l20.011812.081812.081813.44-0.521006.48
52020.12.02 08:30buy30.011814.551806.131821.36
62020.12.02 10:36t/p30.011821.361806.131821.366.811013.29
72020.12.02 17:45buy40.011825.371811.451847.89
82020.12.03 04:45buy50.011829.931825.741836.71
92020.12.03 05:39t/p50.011836.711825.741836.716.781020.07
102020.12.03 14:00buy60.011842.771833.331858.05
112020.12.03 16:49s/l60.011833.331833.331858.05-9.441010.63
122020.12.03 20:15buy70.011839.001828.731855.62
132020.12.04 04:47buy80.011841.651838.241847.17
142020.12.04 08:00s/l80.011838.241838.241847.17-3.411007.22
152020.12.04 09:00buy90.011843.921836.891849.61
162020.12.04 14:15buy100.011842.701837.901850.46
172020.12.04 15:39s/l100.011837.901837.901850.46-4.801002.42
182020.12.04 15:39s/l90.011836.891836.891849.61-7.03995.39
192020.12.04 16:15buy110.011843.501830.791853.78
202020.12.04 16:18t/p40.011847.891811.451847.8920.781016.17
212020.12.04 17:54s/l110.011830.791830.791853.78-12.711003.46
222020.12.04 21:00buy120.011835.851833.561839.55
232020.12.07 01:23s/l120.011833.561833.561839.55-2.731000.73
242020.12.07 10:34s/l70.011828.731828.731855.62-11.14989.59
252020.12.07 14:15buy130.011832.091826.761840.71
262020.12.07 16:24t/p130.011840.711826.761840.718.62998.21
272020.12.07 23:45buy140.011864.891857.241877.27
282020.12.08 04:15buy150.011866.521860.091876.92
292020.12.08 13:08s/l150.011860.091860.091876.92-6.43991.78
302020.12.08 15:00buy160.011866.011859.711876.21
312020.12.09 02:30buy170.011870.041869.251871.32
322020.12.09 02:31s/l170.011869.251869.251871.32-0.79990.99
332020.12.09 05:39s/l160.011859.711859.711876.21-6.74984.26
342020.12.09 06:07s/l140.011857.241857.241877.27-8.52975.74
352020.12.09 09:45buy180.011861.181857.811866.64
362020.12.09 12:22s/l180.011857.811857.811866.64-3.37972.37
372020.12.09 13:30buy190.011860.241855.381868.10
382020.12.09 13:37s/l190.011855.381855.381868.10-4.86967.51
392020.12.09 15:45buy200.011861.661853.511874.84
402020.12.09 16:24s/l200.011853.511853.511874.84-8.15959.36
412020.12.09 23:45buy210.011839.361831.441852.18
422020.12.10 11:06s/l210.011831.441831.441852.18-9.23950.13
432020.12.10 14:30buy220.011837.621831.881846.90
442020.12.10 16:03t/p220.011846.901831.881846.909.28959.41
452020.12.11 03:30buy230.011838.871835.731843.95
462020.12.11 05:13s/l230.011835.731835.731843.95-3.14956.27
472020.12.11 06:15buy240.011837.261834.581841.60
482020.12.11 07:54s/l240.011834.581834.581841.60-2.68953.59
492020.12.11 08:45buy250.011836.931833.061843.19
502020.12.11 09:45s/l250.011833.061833.061843.19-3.87949.72
512020.12.11 11:30buy260.011836.171830.691845.03
522020.12.11 13:01s/l260.011830.691830.691845.03-5.48944.24
532020.12.11 14:00buy270.011833.331822.081851.53
542020.12.11 15:45buy280.011838.181829.271852.60
552020.12.14 04:45buy290.011837.461833.951843.14
562020.12.14 07:24s/l290.011833.951833.951843.14-3.51940.73
572020.12.14 10:24s/l280.011829.271829.271852.60-9.35931.38
582020.12.14 12:24s/l270.011822.081822.081851.53-11.69919.70
592020.12.14 16:00buy300.011833.081820.001854.24
602020.12.14 20:45buy310.011828.351825.321833.25
612020.12.14 21:54s/l310.011825.321825.321833.25-3.03916.67
622020.12.15 01:15buy320.011829.221827.371832.22
632020.12.15 01:39s/l320.011827.371827.371832.22-1.85914.82
642020.12.15 04:00buy330.011829.931824.801838.23
652020.12.15 07:37t/p330.011838.231824.801838.238.30923.12
662020.12.15 15:37t/p300.011854.241820.001854.2420.72943.84
672020.12.16 04:30buy340.011854.801850.781861.30
682020.12.16 10:45buy350.011860.661851.831874.94
692020.12.16 10:51t/p340.011861.301850.781861.306.50950.34
702020.12.16 15:22s/l350.011851.831851.831874.94-8.83941.51
712020.12.16 19:00buy360.011854.871851.871859.73
722020.12.16 19:25s/l360.011851.871851.871859.73-3.00938.51
732020.12.16 22:00buy370.011861.681841.081878.35
742020.12.17 05:15buy380.011864.961861.721870.20
752020.12.17 07:54t/p380.011870.201861.721870.205.24943.75
762020.12.17 10:24t/p370.011878.351841.081878.3515.36959.12
772020.12.18 01:00buy390.011884.901882.851888.22
782020.12.18 02:39s/l390.011882.851882.851888.22-2.05957.07
792020.12.18 06:15buy400.011883.041878.541890.32
802020.12.18 10:09s/l400.011878.541878.541890.32-4.50952.57
812020.12.18 13:45buy410.011880.781877.751885.68
822020.12.18 14:06t/p410.011885.681877.751885.684.90957.47
832020.12.18 20:00buy420.011884.341881.781888.48
842020.12.18 20:51s/l420.011881.781881.781888.48-2.56954.91
852020.12.21 01:30buy430.011884.501879.311892.90
862020.12.21 03:09t/p430.011892.901879.311892.908.40963.31
872020.12.21 15:45buy440.011883.161868.171907.42
882020.12.21 18:45buy450.011880.781873.551892.48
892020.12.22 01:15buy460.011881.401873.811893.68
902020.12.22 03:30buy470.011881.191874.821891.49
912020.12.22 07:45s/l470.011874.821874.821891.49-6.37956.94
922020.12.22 08:09s/l460.011873.811873.811893.68-7.59949.35
932020.12.22 08:09s/l450.011873.551873.551892.48-7.67941.68
942020.12.22 08:54s/l440.011868.171868.171907.42-15.43926.26
952020.12.22 12:15buy480.011874.671868.761884.23
962020.12.22 17:49s/l480.011868.761868.761884.23-5.91920.35
972020.12.22 21:33buy490.011864.301859.941871.36
982020.12.22 22:39s/l490.011859.941859.941871.36-4.36915.99
992020.12.23 03:00buy500.011864.321861.211869.36
1002020.12.23 09:04buy510.011866.311863.131871.45
1012020.12.23 10:54t/p500.011869.361861.211869.365.04921.03
1022020.12.23 11:09t/p510.011871.451863.131871.455.14926.17
1032020.12.23 15:45buy520.011869.151856.731889.25
1042020.12.24 02:00buy530.011873.011870.881876.45
1052020.12.24 03:24t/p530.011876.451870.881876.453.44929.61
1062020.12.24 08:45buy540.011876.601874.811879.50
1072020.12.24 10:19t/p540.011879.501874.811879.502.90932.51
1082020.12.24 16:00buy550.011874.511872.621877.57
1092020.12.24 16:09s/l550.011872.621872.621877.57-1.89930.62
1102020.12.28 03:00t/p520.011889.251856.731889.2517.92948.54
1112020.12.28 12:00buy560.011885.701880.681893.82
1122020.12.28 12:24s/l560.011880.681880.681893.82-5.02943.52
1132020.12.28 15:45buy570.011885.821872.031908.14
1142020.12.28 23:45s/l570.011872.031872.031908.14-13.79929.73
1152020.12.29 02:04buy580.011877.891871.171888.77
1162020.12.29 10:00buy590.011879.951874.881888.15
1172020.12.29 12:39s/l590.011874.881874.881888.15-5.07924.66
1182020.12.29 16:00buy600.011880.191873.451891.09
1192020.12.29 17:09s/l600.011873.451873.451891.09-6.74917.92
1202020.12.29 17:45buy610.011878.721870.361892.24
1212020.12.30 01:15buy620.011878.371877.131880.37
1222020.12.30 01:34s/l620.011877.131877.131880.37-1.24916.68
1232020.12.30 13:30buy630.011880.591877.181886.11
1242020.12.30 13:54s/l630.011877.181877.181886.11-3.41913.27
1252020.12.30 19:54t/p580.011888.771871.171888.7710.44923.71
1262020.12.30 22:51t/p610.011892.241870.361892.2413.08936.80
1272020.12.31 09:30buy640.011889.801885.361896.98
1282020.12.31 15:22t/p640.011896.981885.361896.987.18943.98
1292020.12.31 15:30buy650.011897.531892.301905.99
1302020.12.31 16:54s/l650.011892.301892.301905.99-5.23938.75
1312021.01.04 01:45buy660.011914.531884.871938.53
1322021.01.04 15:31t/p660.011938.531884.871938.5324.00962.75
1332021.01.04 20:15buy670.011942.881930.611962.74
1342021.01.05 05:45buy680.011942.141936.101951.92
1352021.01.05 16:16t/p680.011951.921936.101951.929.78972.53
1362021.01.05 18:45buy690.011949.061939.151965.10
1372021.01.06 01:22buy700.011951.581947.551958.10
1382021.01.06 03:24s/l700.011947.551947.551958.10-4.03968.50
1392021.01.06 08:30buy710.011944.911943.011947.99
1402021.01.06 09:09t/p710.011947.991943.011947.993.08971.58
1412021.01.06 14:36s/l690.011939.151939.151965.10-10.35961.23
1422021.01.06 14:39s/l670.011930.611930.611962.74-13.14948.09
1432021.01.06 21:30buy720.011914.031904.591929.31
1442021.01.07 07:30buy730.011918.341916.611921.14
1452021.01.07 07:30s/l730.011916.611916.611921.14-1.73946.36
1462021.01.07 15:30buy740.011918.691913.921926.41
1472021.01.07 15:46s/l740.011913.921913.921926.41-4.77941.59
1482021.01.07 20:15buy750.011914.051908.311923.33
1492021.01.08 06:37s/l750.011908.311908.311923.33-6.18935.42
1502021.01.08 09:54s/l720.011904.591904.591929.31-11.18924.24
1512021.01.08 13:45buy760.011894.341889.171902.70
1522021.01.08 14:34s/l760.011889.171889.171902.70-5.17919.07
1532021.01.08 23:00buy770.011848.061840.881859.68
1542021.01.11 03:00s/l770.011840.881840.881859.68-7.62911.45
1552021.01.11 07:00buy780.011834.441825.711848.56
1562021.01.11 08:33t/p780.011848.561825.711848.5614.12925.57
1572021.01.11 18:00buy790.011849.261830.631879.40
1582021.01.12 04:30buy800.011848.811839.871863.27
1592021.01.12 12:09t/p800.011863.271839.871863.2714.46940.03
1602021.01.12 20:15buy810.011844.121836.421856.58
1612021.01.12 21:31t/p810.011856.581836.421856.5812.46952.49
1622021.01.13 08:15buy820.011860.211856.961865.47
1632021.01.13 10:04s/l820.011856.961856.961865.47-3.25949.24
1642021.01.13 14:45buy830.011855.181851.341861.40
1652021.01.13 15:09s/l830.011851.341851.341861.40-3.84945.40
1662021.01.13 20:00buy840.011856.151852.421862.19
1672021.01.13 22:18s/l840.011852.421852.421862.19-3.73941.67
1682021.01.14 03:07close790.011849.771830.631879.40-1.67940.00
1692021.01.14 08:00buy850.011844.821837.821856.14
1702021.01.14 09:37s/l850.011837.821837.821856.14-7.00933.00
1712021.01.14 14:04buy860.011844.011837.041855.29
1722021.01.14 19:53t/p860.011855.291837.041855.2911.28944.28
1732021.01.14 23:04buy870.011848.091843.571855.41
1742021.01.15 02:15buy880.011848.991844.971855.49
1752021.01.15 10:45buy890.011852.821848.581859.68
1762021.01.15 11:39t/p870.011855.411843.571855.416.88951.17
1772021.01.15 11:39t/p880.011855.491844.971855.496.50957.67
1782021.01.15 13:52s/l890.011848.581848.581859.68-4.24953.43
1792021.01.15 21:45buy900.011829.491826.991833.53
1802021.01.15 22:07s/l900.011826.991826.991833.53-2.50950.93
1812021.01.18 04:45buy910.011829.611817.481849.23
1822021.01.18 13:15buy920.011837.471828.661851.73
1832021.01.18 15:00buy930.011835.971828.531848.01
1842021.01.19 08:30buy940.011839.951835.701846.83
1852021.01.19 14:55s/l940.011835.701835.701846.83-4.25946.68
1862021.01.19 18:15buy950.011842.161831.741859.02
1872021.01.20 04:08t/p930.011848.011828.531848.0111.17957.85
1882021.01.20 04:49t/p910.011849.231817.481849.2318.75976.60
1892021.01.20 08:06t/p920.011851.731828.661851.7313.39989.99
1902021.01.20 16:22t/p950.011859.021831.741859.0216.421006.41
1912021.01.20 16:30buy960.011860.281826.301887.77
1922021.01.21 05:00buy970.011872.001867.191879.78
1932021.01.21 09:39s/l970.011867.191867.191879.78-4.811001.60
1942021.01.21 13:00buy980.011870.471866.771876.45
1952021.01.21 14:54s/l980.011866.771866.771876.45-3.70997.90
1962021.01.21 19:39buy990.011864.711863.381866.87
1972021.01.21 20:52t/p990.011866.871863.381866.872.161000.06
1982021.01.22 11:15buy1000.011863.031858.371870.57
1992021.01.22 11:52s/l1000.011858.371858.371870.57-4.66995.40
2002021.01.22 17:00buy1010.011850.661834.621863.64
2012021.01.22 21:30close1010.011856.441834.621863.645.781001.18
2022021.01.22 21:30close960.011856.441826.301887.77-5.58995.60
2032021.01.25 02:45buy1020.011860.211854.601869.29
2042021.01.25 03:24s/l1020.011854.601854.601869.29-5.61989.99
2052021.01.25 07:15buy1030.011855.681853.281859.56
2062021.01.25 07:37s/l1030.011853.281853.281859.56-2.40987.59
2072021.01.25 11:21buy1040.011853.481851.441856.78
2082021.01.25 12:34t/p1040.011856.781851.441856.783.30990.89
2092021.01.25 20:30buy1050.011856.711854.551860.21
2102021.01.25 21:24s/l1050.011854.551854.551860.21-2.16988.73
2112021.01.26 01:30buy1060.011857.191854.101862.19
2122021.01.26 02:07s/l1060.011854.101854.101862.19-3.09985.64
2132021.01.26 13:19buy1070.011851.601848.211857.08
2142021.01.26 15:24t/p1070.011857.081848.211857.085.48991.12
2152021.01.26 22:45buy1080.011853.271849.031860.13
2162021.01.27 01:16s/l1080.011849.031849.031860.13-4.68986.44
2172021.01.27 02:00buy1090.011851.631848.691856.39
2182021.01.27 02:47s/l1090.011848.691848.691856.39-2.94983.50
2192021.01.27 07:15buy1100.011847.881845.011852.52
2202021.01.27 10:01t/p1100.011852.521845.011852.524.64988.14
2212021.01.27 17:15buy1110.011843.871828.841856.03
2222021.01.28 06:45buy1120.011838.361836.231841.80
2232021.01.28 07:53s/l1120.011836.231836.231841.80-2.13986.01
2242021.01.28 08:45buy1130.011838.361834.801844.12
2252021.01.28 09:09s/l1130.011834.801834.801844.12-3.56982.45
2262021.01.28 15:52t/p1110.011856.031828.841856.0310.85993.31
2272021.01.28 22:45buy1140.011843.301840.821847.32
2282021.01.28 23:01s/l1140.011840.821840.821847.32-2.48990.83
2292021.01.29 03:37buy1150.011843.901840.011850.20
2302021.01.29 06:15buy1160.011841.821841.241842.76
2312021.01.29 06:52t/p1160.011842.761841.241842.760.94991.77
2322021.01.29 08:54t/p1150.011850.201840.011850.206.30998.07
+
diff --git a/Docs/Reports/EURUSD-15M/StrategyTester 1.gif b/Docs/Reports/EURUSD-15M/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..08325b4751efa075795e1a47f66bae733c26142f GIT binary patch literal 8736 zcmch*_di?j|34nIBvw`RX=_@wY1JrF6s1;atF5g@?M>~yMeN#puf!fPB6bNeYlYY~ zViZ+Ht$e&+-~ZuzZr3@t>+!hXANT8Vzs?Wmx*cWJ*OF4EVq_S=CICPr5&;0f@bEAZ ziG?H_AuTPDHz}kgBmob&xrs!40^}xzw7g;7OaVkZ4g#nJ+zbfr|Kkyl5+MIe0IiY)3@CYHnIzVf^2MNId?=(M^*#fn~yt0N}=oB?NFIdQ*Ah*YYN~asU74C3v&@fd6|J z019FdAS5&_JR%Yr1&fY}jf+o6{FaoQlA4yDk(rg9lbe@cP*_x4Qd(AC0Y_9;RoB$k z)i*RYA)8xT+feQ3j?S*`p5DIi{R5c6A?)zT=-7BA$>h}Z%q(th9>1`-w7jyq_H%t> zbBnOOv%B|e|KRZV(VyeLC#Q$CBzdHl*SS}K>s^L~6*i zB}lpDZ^}=SqRigkaXlol+tDkNnh@$c`CB}nv;YrqgX}LX`U!ov>>~*?#YaYPmKg#Y z!4s2omoxwmx^TLw`+{J9nINOPoN>`x;Y=xJ^rq^!{(C(4O`nPzECE^7OVp?3T{q6u zIF;M3YiPQi%@3ee0XmY1gs>U{A7h|S<+lmohfW&0(C|bPXjDYhvBZi2pCMG=#U^D& z&V=00BrqR#~bl5!XEwWq6;3*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YbedA?<4#^+0+&Zm+-++T=aUfADb3p(Y_M*y}zD>%9~DE6{y zM!~0jSILxHdMYX#g00pD>1q_Sxiu|z;&7{E2VQ;bGs1#?CiCBL%otT!(!?agjeDZr zkF`2nvl}k&LYg!CEIV8?bP87@=#EQP7ylHnvYEZCQACr-9;vo35Qf3-T|6!gs8V%{X^&$iVNs;)+IrDv~4N3>bVabO1q#>_PiW#jT3KeVBXE2z1;GT zX-ZQjJ$NSJviz|7Tx#rUIj;@E^)V2%@Rk@d^+?+nCr*2!m4Vu@@a9@=@t`RhKzA21q;` z#r-}w`ukv_VIw;4V*kO_ub1M1DZ>8mPQCie0)GnI_MUjH4|r3z_~y9=#&kK)d%6y! z2%9i|nc4z=Dst34^&>O`DOBufalrGm;E63`=U)3f(vT!i{A%DipiOYd4fl?v z(~mBaq{P@7r&}NJfQ+oYWoF!)w8MEiOT$wWYzmIT9ic`*;fRmA;qD;-`P2w4iAYGQ zuZ3lVtFE~)!OfyH(f|W=Cq$x=uEEx!y04%zKz)q?D0wY3oLAq87aH(ilpn7?iArF( zL^y3^1bKec^9Wc)IShe;RS{q{!00;O=mwSOChO>CXmo3NGzt@qCPa4vV-)FufEWJ{ DpDL^f literal 0 HcmV?d00001 diff --git a/Docs/Reports/EURUSD-15M/StrategyTester 1.htm b/Docs/Reports/EURUSD-15M/StrategyTester 1.htm new file mode 100644 index 0000000..50fbf12 --- /dev/null +++ b/Docs/Reports/EURUSD-15M/StrategyTester 1.htm @@ -0,0 +1,199 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
+
Strategy Tester Report
+
x-saherelm.ea
+
Alpari-Demo (Build 1382)

+ + + + + + + + + + + + + + + + + + + + + + +
SymbolEURUSD (Euro vs US Dollar)
Period15 Minutes (M15) 2022.03.09 01:45 - 2023.09.14 23:45 (2020.01.01 - 2023.09.15)
ModelEvery tick (the most precise method based on all available least timeframes)
ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.04; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.04; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.015; xRMaximumCandlesPerTrade=96; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.03; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.03; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
Bars in test37897Ticks modelled33978857Modelling quality50.97%
Mismatched charts errors4
Initial deposit1000.00SpreadCurrent (17)
Total net profit-76.97Gross profit125.93Gross loss-202.90
Profit factor0.62Expected payoff-1.24
Absolute drawdown108.07Maximal drawdown109.59 (10.94%)Relative drawdown10.94% (109.59)
Total trades62Short positions (won %)0 (0.00%)Long positions (won %)62 (53.23%)
Profit trades (% of total)33 (53.23%)Loss trades (% of total)29 (46.77%)
Largestprofit trade17.33loss trade-19.07
Averageprofit trade3.82loss trade-7.00
Maximumconsecutive wins (profit in money)5 (19.17)consecutive losses (loss in money)4 (-16.84)
Maximalconsecutive profit (count of wins)19.17 (5)consecutive loss (count of losses)-34.75 (3)
Averageconsecutive wins2consecutive losses2
+Graph
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#TimeTypeOrderSizePriceS / LT / PProfitBalance
12022.04.01 12:15buy10.011.105380.000001.10670
22022.04.01 19:45buy20.011.104500.000001.10804
32022.04.01 22:15buy30.011.104290.000001.10522
42022.04.04 03:48t/p30.011.105220.000001.105220.851000.85
52022.04.05 15:45close10.011.096450.000001.10670-9.10991.75
62022.04.05 23:15close20.011.090350.000001.10804-14.32977.43
72022.04.14 05:30buy40.011.090530.000001.09689
82022.04.18 09:00close40.011.079360.000001.09689-11.34966.09
92022.04.18 13:15buy50.011.079540.000001.08104
102022.04.18 14:52t/p50.011.081040.000001.081041.50967.59
112022.04.19 02:00buy60.011.078180.000001.07989
122022.04.19 08:00buy70.011.077310.000001.07872
132022.04.19 09:48t/p70.011.078720.000001.078721.41969.00
142022.04.19 10:54t/p60.011.079890.000001.079891.71970.71
152022.04.27 05:30buy80.011.064820.000001.06824
162022.04.27 13:45buy90.011.061520.000001.06701
172022.04.29 09:00close80.011.053600.000001.06824-11.56959.16
182022.04.29 17:15close90.011.053140.000001.06701-8.72950.44
192022.05.11 06:00buy100.011.053550.000001.05622
202022.05.11 11:09t/p100.011.056220.000001.056222.67953.11
212022.05.23 17:45buy110.011.066850.000001.07384
222022.05.24 17:00t/p110.011.073840.000001.073846.91960.02
232022.05.30 12:45buy120.011.076530.000001.08367
242022.05.30 17:30buy130.011.077150.000001.08318
252022.05.31 17:45buy140.011.071720.000001.07979
262022.06.01 16:15close120.011.072900.000001.08367-3.80956.22
272022.06.01 21:00close130.011.065050.000001.08318-12.27943.95
282022.06.03 15:37close140.011.071710.000001.07979-0.43943.52
292022.06.07 10:30buy150.011.068980.000001.07600
302022.06.09 14:54close150.011.068970.000001.07600-0.35943.18
312022.06.13 19:45buy160.011.044400.000001.04998
322022.06.15 11:39t/p160.011.049980.000001.049985.41948.59
332022.06.20 12:45buy170.011.053650.000001.06073
342022.06.21 17:00buy180.011.055960.000001.05986
352022.06.22 16:33close170.011.053640.000001.06073-0.18948.41
362022.06.22 17:52t/p180.011.059860.000001.059863.82952.23
372022.06.29 11:30buy190.011.051610.000001.05923
382022.07.01 15:00close190.011.043520.000001.05923-8.43943.80
392022.07.11 18:30buy200.011.008320.000001.01438
402022.07.12 13:30buy210.011.001420.000001.00553
412022.07.12 14:19t/p210.011.005530.000001.005534.11947.91
422022.07.13 22:00close200.011.006220.000001.01438-2.27945.64
432022.07.19 18:00buy220.011.024640.000001.02971
442022.07.20 10:45buy230.011.024060.000001.02736
452022.07.21 15:39t/p230.011.027360.000001.027363.05948.69
462022.07.21 21:30close220.011.019380.000001.02971-5.60943.10
472022.08.01 10:30buy240.011.022900.000001.02728
482022.08.01 17:54t/p240.011.027280.000001.027284.38947.48
492022.08.19 16:45buy250.011.005790.000001.00861
502022.08.19 21:30buy260.011.004280.000001.00665
512022.08.23 11:30buy270.010.993030.000001.00182
522022.08.23 20:15close250.010.997290.000001.00861-8.67938.81
532022.08.24 01:00close260.010.996830.000001.00665-7.70931.11
542022.08.25 09:24t/p270.011.001820.000001.001828.45939.56
552022.09.05 10:30buy280.010.991250.000001.00139
562022.09.06 09:00buy290.010.996040.000001.00048
572022.09.07 14:00close280.010.989650.000001.00139-1.77937.79
582022.09.07 22:49t/p290.011.000480.000001.000484.36942.15
592022.09.23 16:30buy300.010.976900.000000.98317
602022.09.26 02:15buy310.010.969430.000000.97699
612022.09.27 20:00close300.010.958000.000000.98317-19.07923.08
622022.09.28 05:45close310.010.955280.000000.97699-14.32908.76
632022.09.29 17:00buy320.010.974260.000000.99184
642022.10.04 15:24t/p320.010.991840.000000.9918417.33926.09
652022.10.07 18:30buy330.010.978850.000000.99184
662022.10.11 22:00close330.010.970810.000000.99184-8.21917.88
672022.10.26 17:45buy340.011.003080.000001.01061
682022.10.28 13:15buy350.010.995700.000001.00035
692022.10.28 21:15close340.010.994430.000001.01061-8.99908.90
702022.11.01 16:45close350.010.988270.000001.00035-7.60901.30
712022.11.10 06:15buy360.011.002840.000001.00782
722022.11.10 15:32t/p360.011.007820.000001.007824.98906.28
732022.12.07 10:45buy370.011.045810.000001.05004
742022.12.07 12:43t/p370.011.050040.000001.050044.23910.51
752023.01.04 16:30buy380.011.061310.000001.06650
762023.01.09 02:02t/p380.011.066500.000001.066504.77915.28
772023.01.31 13:00buy390.011.082370.000001.08312
782023.01.31 13:36t/p390.011.083120.000001.083120.75916.03
792023.03.01 19:15buy400.011.067590.000001.07227
802023.03.02 22:00buy410.011.059120.000001.06311
812023.03.03 21:52t/p410.011.063110.000001.063113.91919.94
822023.03.03 23:15close400.011.063330.000001.07227-4.60915.34
832023.03.06 03:00buy420.011.062830.000001.06409
842023.03.06 04:38t/p420.011.064090.000001.064091.26916.60
852023.03.10 10:00buy430.011.059580.000001.06366
862023.03.10 15:42t/p430.011.063660.000001.063664.08920.68
872023.03.22 17:45buy440.011.078900.000001.08190
882023.03.22 20:02t/p440.011.081900.000001.081903.00923.68
892023.03.28 14:00buy450.011.082360.000001.08587
902023.03.28 19:00buy460.011.084380.000001.09212
912023.03.29 12:57t/p450.011.085870.000001.085873.43927.11
922023.03.30 16:25t/p460.011.092120.000001.092127.40934.51
932023.05.03 17:30buy470.011.104660.000001.10976
942023.05.03 21:30buy480.011.106380.000001.11271
952023.05.05 21:30close470.011.101830.000001.10976-3.17931.35
962023.05.08 01:45close480.011.101430.000001.11271-5.37925.98
972023.05.09 18:15buy490.011.095750.000001.09674
982023.05.09 21:21t/p490.011.096740.000001.096740.99926.97
992023.05.25 21:30buy500.011.072660.000001.07692
1002023.05.29 19:30buy510.011.071320.000001.07252
1012023.05.30 01:45close500.011.070920.000001.07692-1.99924.98
1022023.05.30 04:36t/p510.011.072520.000001.072521.12926.09
1032023.06.13 16:15buy520.011.080210.000001.08543
1042023.06.14 17:53t/p520.011.085430.000001.085435.14931.23
1052023.06.19 19:00buy530.011.092290.000001.09376
1062023.06.20 10:32t/p530.011.093760.000001.093761.39932.61
1072023.07.14 12:00buy540.011.123230.000001.13100
1082023.07.18 16:09close540.011.123220.000001.13100-0.18932.44
1092023.07.24 00:15buy550.011.112680.000001.11394
1102023.07.24 09:52t/p550.011.113940.000001.113941.26933.70
1112023.08.03 09:45buy560.011.093050.000001.09503
1122023.08.03 12:45buy570.011.092700.000001.09681
1132023.08.03 15:39t/p560.011.095030.000001.095031.98935.68
1142023.08.04 15:37t/p570.011.096810.000001.096814.03939.70
1152023.08.22 10:00buy580.011.091880.000001.09584
1162023.08.24 14:00close580.011.085400.000001.09584-6.82932.89
1172023.09.05 20:00buy590.011.073060.000001.07921
1182023.09.07 18:45buy600.011.070740.000001.07473
1192023.09.08 00:15close590.011.069590.000001.07921-3.89929.00
1202023.09.11 13:45buy610.011.073270.000001.07573
1212023.09.11 17:09t/p600.011.074730.000001.074733.82932.82
1222023.09.11 17:24t/p610.011.075730.000001.075732.46935.28
1232023.09.13 03:45buy620.011.076230.000001.07896
1242023.09.14 23:54close at stop620.011.064230.000001.07896-12.25923.03
+
diff --git a/Docs/Reports/Screenshot 2023-08-03 202922.png b/Docs/Reports/Screenshot 2023-08-03 202922.png new file mode 100644 index 0000000000000000000000000000000000000000..98f6bb02157df48ff0190316325ab2ca2f3c938a GIT binary patch literal 107106 zcmeFYcTm$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-zixW_oWD!59JD*+a0Q(IAf z-}A^SeqW_7K9FxK+&>$V1S?I|mI zUkks7FU`EP!;TYsYb zsIQ|rp@nDj>-V+14{qgOX64oY?|3O+<^}=)01T(m{~-bZ0Qi4whyVb9Vc8G?006_X zAp!sZhGjzp000cjh6n%v7?uqY001y78zKMzU|2Rp006+SY={5=fI&^u4~@%Z^6iE9 QPyhe`07*qoM6N<$f_AR^mjD0& literal 0 HcmV?d00001 diff --git a/Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.gif b/Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.gif new file mode 100644 index 0000000000000000000000000000000000000000..dcdca949254e1e78cd765f700a9080864de17735 GIT binary patch literal 8569 zcmc(D^;?wP_w^t(Gc;1tC@o0WASEabf=Y*i(k0y;!_eK`Lk-f6(jC&>!qDB!m*?~T z5$}DS`&|24d+oK?Ip?QyWaU2yi+tlp?*nWD04Nj+000aP4Wa4=Abx);F z#ZOS32?Ej@joLDSJZVOo)S0wCNdo|b5J)TP2?Zb){-J$A$dRo(eCZ6*D zA$1E2(F?Ork;zjIfG~jop46UnpFBM+^#9Mt@wEGZ|IPw{jq(Nf2LuKMhd@JNVc`*x zQPDB6aq$U>Ny#axY3Ui6S=l+cdHDr}Ma3oX(z5c3N<`JK>YCcR`i91)=9bpB_Kx3w zI=i}idi(kZ28V`6M#sv~{!UI!&&Yo}FJ@ zUL7OQvYy>PWtqXcyz7*WM}PF^CV5#H`CGk@7q)T*30B{OBcMpDAKD zVM?gsSN|l3=1>s} zGXtP0Vd6puU`T+!G&V6S;iiC&_In%(T*zxSYo^T6_Y2}6a2%&zM~6tjOFSw{{mh{pbOC}?vQ?&L_viou z9qm!|;eH#2`d=(-nHcpKucjRKZZ9oE1z+LQ6F-;u{#M9$FzCap*ov0hk?vy35Q^7E zi0pyHSsexE2(| zipy)@M$*zTheg=|kc?vNqDRN#8~YeQPd22LhoawGgQlPhW)o@wgeVXIe34be_c(x( zTL3=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HehMGy-<@0T%87V2&Dgd*;6}Y4hHYjYt%t^ z99h9I`vC>fUNDC~W;6IVGNH1T-U_7`U;)c&`|``ayxWi{4A#3`Tao9wZ`2qB8>RI9 zWk%C&)Ga@w_SUi5AIi$AamT&`)u_cdwJb2Rr0F3ht50^aW}$`8wys~)W7u<)(U*pX z#3t4>)Z#mFE9wEv1nbgUyQIaMHOD?^)(koIBXA)wtZaGZoFz18ER1kpvK`4Ffgq_V z%P_@I&87kYPLI|mFuw0s!rNg?_ZgXwy6L;k&q%rTdUaP+ig%SBBDnlRDDaMDBXiU^kW_+qf2=(-d;v_%ERqoRbBbn7JRE=4%v7|K{VQ9mf3LI|e(A=cLgh2G>}p?N)cOdx&mpZqi6ayyGNi;@ zo&6gZ^m;U9)Q#D(3d_q_R+)GG#p7;U@F*6hzlkVS)W8P-WLrYm%QK`Qb7ul6whyK{Q3t~(zx#-?M^lfz( z|I}W;Dtmhft;d+IHEZbF#XIT|N9vStiljEQ!l=?(rYmzxOZ^zm@D1N>a98rV$kFPk z7g?Yk1b2-wh&o{A3GChl*W_&B9lt9@?p%4hWdGCunaC%I4E*?fl161b{khKGFQ$va z%JA^ndtmC9MF8QTPuihI3`JF#pN)g~JW~^RT(d;`*R+1mv z&XD{SHEuZAzqtk=CM5J;hE=;Vsg;B_40yOrp--U(C%2C2zW`vCx={|6RZKK=jz literal 0 HcmV?d00001 diff --git a/Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.htm b/Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.htm new file mode 100644 index 0000000..342d0e7 --- /dev/null +++ b/Docs/Reports/StrategyTester X (XR and XXX and XTPW) - 0.2 - Full.htm @@ -0,0 +1,445 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.08 12:30 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.0002; xShortMaxDrawdownPerTradePercent=0.4; xLongR2R=3; xLongLotsPerTradePercent=0.0002; xLongMaxDrawdownPerTradePercent=0.4; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.0002; xRShortMaxDrawdownPerTradePercent=0.15; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.0002; xRLongMaxDrawdownPerTradePercent=0.15; xRMaximumCandlesPerTrade=96; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.0002; xTPWShortMaxDrawdownPerTradePercent=0.3; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.0002; xTPWLongMaxDrawdownPerTradePercent=0.3; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63768Ticks modelled73089409Modelling qualityn/a
    Mismatched charts errors905
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit11549.05Gross profit21988.17Gross loss-10439.12
    Profit factor2.11Expected payoff62.43
    Absolute drawdown79.00Maximal drawdown2410.03 (23.15%)Relative drawdown52.81% (1054.29)
    Total trades185Short positions (won %)105 (59.05%)Long positions (won %)80 (58.75%)
    Profit trades (% of total)109 (58.92%)Loss trades (% of total)76 (41.08%)
    Largestprofit trade929.92loss trade-408.85
    Averageprofit trade201.73loss trade-137.36
    Maximumconsecutive wins (profit in money)15 (3323.80)consecutive losses (loss in money)8 (-643.55)
    Maximalconsecutive profit (count of wins)4023.21 (12)consecutive loss (count of losses)-1081.46 (7)
    Averageconsecutive wins4consecutive losses3
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 06:45sell10.201807.850.001797.08
    22020.11.27 15:09t/p10.201797.080.001797.08215.401215.40
    32020.11.27 15:09sell20.201796.570.001788.89
    42020.11.27 15:36t/p20.201788.890.001788.89153.601369.00
    52020.12.01 19:30buy30.201812.580.001853.94
    62020.12.02 10:39buy40.201824.820.001839.43
    72020.12.02 14:45close40.201817.320.001839.43-150.001219.00
    82020.12.04 09:30buy50.201842.380.001854.80
    92020.12.07 10:38close50.201822.380.001854.80-408.85810.15
    102020.12.07 16:52t/p30.201853.940.001853.94774.121584.28
    112021.01.06 02:00buy60.201950.710.001958.51
    122021.01.06 12:00t/p60.201958.510.001958.51156.001740.28
    132021.01.29 16:54sell70.201865.800.001855.99
    142021.01.29 17:39t/p70.201855.990.001855.99196.201936.48
    152021.02.04 16:00sell80.201808.190.001779.92
    162021.02.05 17:24close80.201808.200.001779.923.921940.40
    172021.02.05 19:15buy90.201814.780.001846.22
    182021.02.08 14:49buy100.201824.180.001843.47
    192021.02.09 09:54t/p100.201843.470.001843.47376.952317.35
    202021.02.09 11:24t/p90.201846.220.001846.22611.112928.46
    212021.02.09 17:45sell110.201841.990.001838.33
    222021.02.09 18:09t/p110.201838.330.001838.3373.203001.66
    232021.02.10 17:00sell120.201841.300.001827.41
    242021.02.11 19:09t/p120.201827.410.001827.41290.173291.83
    252021.02.16 15:15sell130.201811.040.001788.17
    262021.02.16 17:09sell140.201804.040.001801.47
    272021.02.16 18:49t/p140.201801.470.001801.4751.403343.23
    282021.02.16 18:49sell150.201800.960.001767.09
    292021.02.17 01:09t/p130.201788.170.001788.17461.523804.75
    302021.02.19 02:39t/p150.201767.090.001767.09698.014502.76
    312021.02.19 05:15buy160.201769.850.001786.38
    322021.02.19 16:09t/p160.201786.380.001786.38330.604833.36
    332021.02.23 04:00buy170.201813.570.001842.72
    342021.02.23 05:45buy180.201813.260.001827.74
    352021.02.23 11:24close170.201806.070.001842.72-150.004683.36
    362021.02.23 11:24close180.201805.760.001827.74-150.004533.36
    372021.02.23 11:24buy190.201806.260.001820.62
    382021.02.23 16:37close190.201798.760.001820.62-150.004383.36
    392021.03.03 16:51sell200.201712.530.001708.07
    402021.03.03 17:36t/p200.201708.070.001708.0789.204472.56
    412021.03.11 16:48buy210.201719.840.001727.97
    422021.03.11 20:09t/p210.201727.970.001727.97162.604635.16
    432021.03.17 13:48buy220.201728.280.001737.00
    442021.03.17 20:06t/p220.201737.000.001737.00174.404809.56
    452021.04.08 14:00buy230.201746.240.001756.38
    462021.04.08 16:39t/p230.201756.380.001756.38202.805012.36
    472021.04.19 15:15buy240.201775.840.001781.87
    482021.04.21 04:30buy250.201779.820.001788.61
    492021.04.21 04:39t/p240.201781.870.001781.87102.915115.27
    502021.04.21 16:39t/p250.201788.610.001788.61175.805291.07
    512021.04.27 18:24buy260.201778.360.001784.35
    522021.04.28 12:24close260.201763.360.001784.35-308.854982.22
    532021.05.04 23:15sell270.201779.150.001777.35
    542021.05.05 03:24t/p270.201777.350.001777.3540.125022.34
    552021.05.06 18:00buy280.201815.870.001857.41
    562021.05.10 17:45sell290.201839.580.001833.85
    572021.05.11 03:39t/p290.201833.850.001833.85118.725141.07
    582021.05.12 23:21close280.201815.850.001857.41-35.785105.28
    592021.05.13 13:15sell300.201810.390.001791.73
    602021.05.13 15:07close300.201817.890.001791.73-150.004955.28
    612021.05.19 22:00buy310.201863.400.001881.95
    622021.05.20 19:49t/p310.201881.950.001881.95344.465299.74
    632021.06.17 10:30sell320.201809.210.001762.92
    642021.06.18 08:45sell330.201784.490.001777.35
    652021.06.18 15:52t/p330.201777.350.001777.35142.805442.54
    662021.06.18 22:54t/p320.201762.920.001762.92929.926372.47
    672021.07.01 05:00buy340.201771.700.001788.95
    682021.07.02 15:39t/p340.201788.950.001788.95336.156708.62
    692021.07.06 19:07buy350.201794.020.001807.68
    702021.07.07 13:24t/p350.201807.680.001807.68264.356972.97
    712021.07.08 14:00buy360.201817.710.001849.35
    722021.07.08 16:39close360.201810.210.001849.35-150.006822.97
    732021.07.08 18:04buy370.201801.870.001814.59
    742021.07.13 15:30buy380.201813.520.001824.52
    752021.07.13 15:30close380.201806.020.001824.52-150.006672.97
    762021.07.13 15:39t/p370.201814.590.001814.59227.866900.84
    772021.07.13 17:21sell390.201811.750.001808.46
    782021.07.13 20:34t/p390.201808.460.001808.4665.806966.64
    792021.07.14 06:30buy400.201813.380.001826.10
    802021.07.14 08:30buy410.201813.760.001827.05
    812021.07.14 11:30buy420.201814.800.001828.95
    822021.07.14 15:04buy430.201821.020.001839.02
    832021.07.14 15:09t/p400.201826.100.001826.10254.407221.04
    842021.07.14 15:37t/p410.201827.050.001827.05265.807486.84
    852021.07.14 15:39t/p420.201828.950.001828.95283.007769.84
    862021.07.15 17:09close430.201821.010.001839.02-26.747743.10
    872021.07.16 22:30sell440.201810.350.001786.20
    882021.07.19 09:15sell450.201806.190.001789.75
    892021.07.19 16:09close450.201813.690.001789.75-150.007593.10
    902021.07.19 18:15sell460.201807.210.001794.99
    912021.07.19 23:30close440.201811.980.001786.20-28.487564.62
    922021.07.19 23:30sell470.201811.480.001805.66
    932021.07.20 04:04close460.201814.710.001794.99-145.887418.74
    942021.07.20 04:04sell480.201814.210.001812.49
    952021.07.20 05:07close470.201818.980.001805.66-145.887272.86
    962021.07.20 11:09t/p480.201812.490.001812.4934.407307.26
    972021.07.20 18:15sell490.201810.140.001788.26
    982021.07.20 20:30sell500.201810.840.001790.01
    992021.07.21 10:30sell510.201808.770.001801.56
    1002021.07.21 14:03t/p510.201801.560.001801.56144.207451.46
    1012021.07.23 10:54close490.201810.150.001788.2620.417471.87
    1022021.07.23 14:34t/p500.201790.010.001790.01437.217909.08
    1032021.07.29 04:30buy520.201816.130.001850.99
    1042021.07.30 19:52close520.201816.120.001850.99-9.057900.04
    1052021.07.30 21:45sell530.201810.450.001779.33
    1062021.08.02 04:45sell540.201809.440.001783.03
    1072021.08.02 06:30sell550.201811.180.001792.46
    1082021.08.02 19:24close540.201816.940.001783.03-150.007750.04
    1092021.08.02 19:39close530.201817.950.001779.33-145.887604.16
    1102021.08.02 19:39sell560.201817.450.001799.74
    1112021.08.02 19:54close550.201818.680.001792.46-150.007454.16
    1122021.08.03 04:30sell570.201809.740.001795.34
    1132021.08.03 06:15sell580.201810.010.001796.02
    1142021.08.04 05:30close570.201813.380.001795.34-68.687385.48
    1152021.08.04 05:30sell590.201812.880.001810.08
    1162021.08.04 07:15close580.201812.750.001796.02-50.687334.80
    1172021.08.04 14:36close560.201817.460.001799.748.047342.85
    1182021.08.04 15:07close590.201820.380.001810.08-150.007192.85
    1192021.08.04 18:30sell600.201806.630.001769.34
    1202021.08.04 21:45sell610.201810.860.001779.92
    1212021.08.05 08:54sell620.201808.740.001803.00
    1222021.08.05 10:52close600.201814.130.001769.34-137.637055.21
    1232021.08.05 11:37sell630.201809.130.001802.26
    1242021.08.05 16:39sell640.201802.930.001795.96
    1252021.08.05 16:39t/p620.201803.000.001803.00114.807170.01
    1262021.08.05 16:39t/p630.201802.260.001802.26137.407307.41
    1272021.08.06 10:18t/p640.201795.960.001795.96143.527450.94
    1282021.08.06 15:39t/p610.201779.920.001779.92635.298086.22
    1292021.08.17 17:15buy650.201782.620.001787.73
    1302021.08.18 04:09t/p650.201787.730.001787.7393.358179.58
    1312021.08.20 17:39sell660.201781.750.001777.75
    1322021.08.23 02:18t/p660.201777.750.001777.7584.128263.70
    1332021.08.26 13:45buy670.201787.170.001795.30
    1342021.08.26 18:04t/p670.201795.300.001795.30162.608426.30
    1352021.08.27 19:15buy680.201814.880.001860.66
    1362021.08.30 20:15close680.201810.010.001860.66-106.258320.05
    1372021.08.31 04:30buy690.201813.980.001822.79
    1382021.08.31 14:15buy700.201814.230.001820.43
    1392021.08.31 16:06close700.201806.730.001820.43-150.008170.05
    1402021.08.31 16:06close690.201806.480.001822.79-150.008020.05
    1412021.08.31 20:00buy710.201814.290.001832.64
    1422021.09.01 04:30buy720.201812.910.001829.19
    1432021.09.01 11:23sell730.201811.910.001804.44
    1442021.09.01 15:52close730.201819.410.001804.44-150.007870.05
    1452021.09.01 18:19sell740.201812.290.001800.92
    1462021.09.01 21:00close710.201812.490.001832.64-44.857825.21
    1472021.09.02 06:04close720.201812.900.001829.19-26.747798.47
    1482021.09.02 07:30sell750.201811.430.001804.14
    1492021.09.02 17:30sell760.201807.760.001793.92
    1502021.09.03 04:06close740.201812.300.001800.9216.297814.76
    1512021.09.03 04:37sell770.201810.730.001806.97
    1522021.09.03 08:30close750.201811.800.001804.14-3.287811.48
    1532021.09.03 14:07close760.201815.260.001793.92-145.887665.60
    1542021.09.03 14:07sell780.201814.760.001805.79
    1552021.09.03 15:34close770.201818.240.001806.97-150.207515.40
    1562021.09.03 15:36close780.201822.260.001805.79-150.007365.40
    1572021.09.07 13:15sell790.201810.900.001786.66
    1582021.09.07 16:15sell800.201810.490.001785.77
    1592021.09.08 16:54t/p790.201786.660.001786.66488.927854.32
    1602021.09.08 16:54t/p800.201785.770.001785.77498.528352.85
    1612021.10.21 09:45buy810.201786.670.001797.59
    1622021.10.22 15:22t/p810.201797.590.001797.59209.558562.40
    1632021.10.27 18:09sell820.201793.560.001789.11
    1642021.10.28 16:30close820.201808.560.001789.11-287.638274.77
    1652021.11.03 04:00sell830.201783.060.001779.26
    1662021.11.03 08:15t/p830.201779.260.001779.2676.008350.77
    1672021.11.05 18:45buy840.201814.330.001857.76
    1682021.11.10 16:24t/p840.201857.760.001857.76842.069192.83
    1692021.11.22 19:45sell850.201810.200.001755.21
    1702021.11.23 04:15sell860.201807.780.001757.35
    1712021.11.26 09:54close860.201807.790.001757.3520.419213.24
    1722021.11.26 12:03close850.201810.210.001755.2124.539237.77
    1732021.11.30 17:48sell870.201794.770.001781.02
    1742021.11.30 18:04t/p870.201781.020.001781.02275.009512.77
    1752021.12.13 16:49sell880.201785.140.001782.99
    1762021.12.14 10:24t/p880.201782.990.001782.9947.129559.89
    1772021.12.15 04:45sell890.201771.980.001768.80
    1782021.12.15 07:39t/p890.201768.800.001768.8063.609623.49
    1792021.12.15 16:54sell900.201769.740.001766.01
    1802021.12.15 17:39t/p900.201766.010.001766.0174.609698.09
    1812021.12.20 17:01sell910.201793.800.001789.41
    1822021.12.20 22:09t/p910.201789.410.001789.4187.809785.89
    1832021.12.21 16:52buy920.201793.730.001796.76
    1842021.12.22 18:04t/p920.201796.760.001796.7651.759837.65
    1852021.12.27 18:00buy930.201812.980.001827.61
    1862021.12.28 08:00buy940.201813.200.001822.49
    1872021.12.28 17:00buy950.201814.150.001821.35
    1882021.12.28 19:00close930.201810.530.001827.61-57.859779.80
    1892021.12.28 19:00buy960.201811.050.001813.05
    1902021.12.28 20:51close950.201806.650.001821.35-150.009629.80
    1912021.12.28 20:54close940.201805.700.001822.49-150.009479.80
    1922021.12.29 10:07close960.201803.550.001813.05-158.859320.95
    1932021.12.30 19:00buy970.201813.820.001839.85
    1942022.01.03 15:09close970.201813.810.001839.85-17.899303.06
    1952022.01.03 16:00sell980.201806.970.001776.15
    1962022.01.04 17:00close980.201811.720.001776.15-90.889212.18
    1972022.01.04 17:45buy990.201817.010.001844.22
    1982022.01.04 19:30buy1000.201814.590.001838.17
    1992022.01.05 21:09close990.201817.000.001844.22-9.059203.14
    2002022.01.05 21:09close1000.201814.580.001838.17-9.059194.09
    2012022.01.05 22:30sell1010.201810.000.001780.84
    2022022.01.11 08:16close1010.201810.010.001780.8424.539218.62
    2032022.01.11 18:30buy1020.201815.670.001836.03
    2042022.01.13 17:51close1020.201815.660.001836.03-35.589183.04
    2052022.01.18 12:00sell1030.201810.270.001791.81
    2062022.01.18 15:30sell1040.201806.890.001783.36
    2072022.01.18 15:34close1040.201814.390.001783.36-150.009033.04
    2082022.01.18 15:37close1030.201817.770.001791.81-150.008883.04
    2092022.01.18 18:19sell1050.201813.030.001806.19
    2102022.01.19 05:15sell1060.201810.740.001797.05
    2112022.01.19 07:00sell1070.201811.540.001805.36
    2122022.01.19 12:34close1060.201818.240.001797.05-150.008733.04
    2132022.01.19 12:37close1070.201819.040.001805.36-150.008583.04
    2142022.01.19 12:37sell1080.201818.540.001805.81
    2152022.01.19 16:37close1080.201826.040.001805.81-150.008433.04
    2162022.01.19 16:52close1050.201828.030.001806.19-295.888137.16
    2172022.01.27 09:00sell1090.201810.600.001776.66
    2182022.01.27 13:15sell1100.201810.700.001793.86
    2192022.01.27 18:24t/p1100.201793.860.001793.86336.808473.96
    2202022.02.02 17:24close1090.201810.610.001776.6616.298490.25
    2212022.02.04 12:30buy1110.201814.020.001827.67
    2222022.02.04 15:30buy1120.201813.290.001824.06
    2232022.02.04 15:36close1110.201806.520.001827.67-150.008340.25
    2242022.02.04 15:36close1120.201805.780.001824.06-150.208190.05
    2252022.02.07 02:45buy1130.201812.800.001843.33
    2262022.02.07 11:00buy1140.201813.370.001822.93
    2272022.02.07 14:00buy1150.201813.930.001821.18
    2282022.02.07 18:37buy1160.201818.370.001830.55
    2292022.02.07 21:06t/p1150.201821.180.001821.18145.008335.05
    2302022.02.07 21:37t/p1140.201822.930.001822.93191.208526.25
    2312022.02.09 11:30buy1170.201827.790.001831.60
    2322022.02.09 15:07t/p1160.201830.550.001830.55225.918752.16
    2332022.02.09 15:09t/p1170.201831.600.001831.6076.208828.36
    2342022.02.11 20:34t/p1130.201843.330.001843.33557.529385.88
    2352022.02.15 11:19buy1180.201856.870.001866.96
    2362022.02.16 19:19t/p1180.201866.960.001866.96192.959578.84
    2372022.02.18 17:33sell1190.201895.770.001893.21
    2382022.02.18 17:37t/p1190.201893.210.001893.2151.209630.04
    2392022.03.02 18:16sell1200.201921.470.001907.56
    2402022.03.03 13:34close1200.201936.480.001907.56-287.839342.20
    2412022.03.14 08:45sell1210.201975.330.001973.05
    2422022.03.14 09:54t/p1210.201973.050.001973.0545.609387.80
    2432022.04.22 19:22sell1220.201936.790.001932.93
    2442022.04.22 20:28t/p1220.201932.930.001932.9377.209465.00
    2452022.04.26 16:08sell1230.201905.800.001905.21
    2462022.04.26 16:57t/p1230.201905.210.001905.2111.809476.80
    2472022.05.13 16:15sell1240.201802.800.001764.16
    2482022.05.13 17:01close1240.201810.300.001764.16-150.009326.80
    2492022.05.13 19:00sell1250.201808.990.001779.64
    2502022.05.16 02:00sell1260.201810.840.001796.49
    2512022.05.16 03:58close1250.201816.490.001779.64-145.889180.92
    2522022.05.16 06:45sell1270.201809.830.001798.46
    2532022.05.16 10:42t/p1270.201798.460.001798.46227.409408.32
    2542022.05.16 10:43t/p1260.201796.490.001796.49287.009695.32
    2552022.05.18 06:30sell1280.201808.180.001785.79
    2562022.05.18 10:00sell1290.201809.610.001794.63
    2572022.05.18 10:28close1280.201815.680.001785.79-150.009545.32
    2582022.05.18 11:12close1290.201817.110.001794.63-150.009395.32
    2592022.05.18 15:15sell1300.201808.580.001791.15
    2602022.05.18 16:43close1300.201816.090.001791.15-150.209245.12
    2612022.06.10 16:01sell1310.201839.900.001834.17
    2622022.06.10 16:18t/p1310.201834.170.001834.17114.609359.72
    2632022.06.14 19:00sell1320.201810.290.001778.72
    2642022.06.14 21:30sell1330.201810.070.001778.17
    2652022.06.15 04:38close1330.201817.570.001778.17-145.889213.85
    2662022.06.15 05:20close1320.201817.790.001778.72-145.889067.97
    2672022.06.24 05:00sell1340.201823.760.001819.89
    2682022.06.24 16:00t/p1340.201819.890.001819.8977.409145.37
    2692022.06.30 13:45sell1350.201810.240.001792.95
    2702022.06.30 15:37close1350.201817.750.001792.95-150.208995.17
    2712022.06.30 18:00sell1360.201808.930.001784.98
    2722022.06.30 20:00sell1370.201809.760.001787.05
    2732022.07.01 14:39t/p1370.201787.050.001787.05458.329453.49
    2742022.07.01 15:24t/p1360.201784.980.001784.98483.129936.61
    2752022.07.20 16:52sell1380.201708.520.001702.79
    2762022.07.20 19:48t/p1380.201702.790.001702.79114.6010051.21
    2772022.08.01 01:30buy1390.201764.460.001772.38
    2782022.08.01 12:57t/p1390.201772.380.001772.38158.4010209.61
    2792022.08.02 18:02sell1400.201776.930.001767.92
    2802022.08.02 21:02t/p1400.201767.920.001767.92180.2010389.81
    2812022.08.22 14:15buy1410.201735.800.001742.64
    2822022.08.23 11:42t/p1410.201742.640.001742.64127.9510517.77
    2832022.09.05 04:45buy1420.201711.690.001722.31
    2842022.09.06 03:46t/p1420.201722.310.001722.31203.5510721.32
    2852022.09.30 20:35buy1430.201663.070.001667.31
    2862022.10.03 04:30t/p1430.201667.310.001667.3175.9510797.27
    2872022.11.02 21:03sell1440.201647.760.001626.40
    2882022.11.03 10:26t/p1440.201626.400.001626.40439.5711236.84
    2892022.11.15 04:45buy1450.201771.800.001782.63
    2902022.11.15 09:47t/p1450.201782.630.001782.63216.6011453.44
    2912022.11.21 20:30buy1460.201738.320.001753.50
    2922022.11.21 23:45buy1470.201738.430.001742.36
    2932022.11.22 03:06t/p1470.201742.360.001742.3669.7511523.19
    2942022.11.24 02:26t/p1460.201753.500.001753.50259.3711782.56
    2952022.11.30 10:00buy1480.201755.420.001761.93
    2962022.11.30 11:36t/p1480.201761.930.001761.93130.2011912.76
    2972022.11.30 17:18buy1490.201751.830.001763.12
    2982022.11.30 21:20t/p1490.201763.120.001763.12225.8012138.56
    2992022.12.09 17:23buy1500.201791.170.001800.19
    3002022.12.09 18:20t/p1500.201800.190.001800.19180.4012318.96
    3012022.12.13 16:30buy1510.201818.890.001875.11
    3022022.12.13 17:47close1510.201811.390.001875.11-150.0012168.96
    3032022.12.13 18:45buy1520.201813.270.001859.04
    3042022.12.13 19:25close1520.201805.770.001859.04-150.0012018.96
    3052022.12.20 17:15buy1530.201820.840.001871.26
    3062022.12.21 06:43close1530.201813.340.001871.26-158.8511860.12
    3072022.12.21 09:30buy1540.201815.350.001820.14
    3082022.12.21 14:00buy1550.201814.060.001816.91
    3092022.12.21 15:13t/p1550.201816.910.001816.9157.0011917.12
    3102022.12.21 17:07t/p1540.201820.140.001820.1495.8012012.92
    3112022.12.22 16:15sell1560.201807.890.001789.40
    3122022.12.22 20:02t/p1560.201789.400.001789.40369.8012382.72
    3132022.12.27 17:30buy1570.201821.700.001850.34
    3142022.12.27 19:56close1570.201814.190.001850.34-150.2012232.52
    3152022.12.27 20:15buy1580.201814.990.001833.56
    3162022.12.28 03:30buy1590.201814.650.001832.71
    3172022.12.28 09:03close1580.201807.490.001833.56-158.8512073.67
    3182022.12.28 10:08close1590.201807.130.001832.71-150.4011923.27
    3192022.12.29 17:00buy1600.201814.310.001828.76
    3202022.12.29 18:45buy1610.201814.680.001829.68
    3212022.12.30 18:38close1600.201814.300.001828.76-9.0511914.23
    3222023.01.03 01:07t/p1610.201829.680.001829.68273.4612187.69
    3232023.01.11 17:38buy1620.201870.920.001874.91
    3242023.01.11 19:21t/p1620.201874.910.001874.9179.8012267.49
    3252023.01.12 17:10sell1630.201884.680.001867.96
    3262023.01.12 21:05close1630.201899.680.001867.96-300.0011967.49
    3272023.01.20 09:00buy1640.201926.850.001936.66
    3282023.01.20 10:08t/p1640.201936.660.001936.66196.2012163.69
    3292023.02.07 16:32sell1650.201869.860.001868.93
    3302023.02.07 16:45t/p1650.201868.930.001868.9318.6012182.29
    3312023.02.09 17:00sell1660.201879.160.001868.22
    3322023.02.09 18:03t/p1660.201868.220.001868.22218.8012401.09
    3332023.02.24 18:15sell1670.201809.460.001784.47
    3342023.02.24 20:00sell1680.201809.720.001785.12
    3352023.02.24 23:15sell1690.201811.200.001791.97
    3362023.02.27 05:30sell1700.201810.190.001802.03
    3372023.02.27 16:00close1670.201816.960.001784.47-145.8812255.21
    3382023.02.27 16:22close1680.201817.220.001785.12-145.8812109.33
    3392023.02.27 16:22sell1710.201816.720.001801.36
    3402023.02.27 16:23close1700.201817.690.001802.03-150.0011959.33
    3412023.02.27 16:57close1690.201818.700.001791.97-145.8811813.45
    3422023.02.28 10:00sell1720.201810.360.001797.04
    3432023.02.28 12:00sell1730.201810.170.001796.57
    3442023.02.28 16:46close1730.201817.670.001796.57-150.0011663.45
    3452023.02.28 16:47close1720.201817.860.001797.04-150.0011513.45
    3462023.02.28 17:03close1710.201824.220.001801.36-145.8811367.58
    3472023.03.01 04:30buy1740.201829.010.001845.24
    3482023.03.02 20:35sell1750.201835.870.001834.86
    3492023.03.02 20:43t/p1750.201834.860.001834.8620.2011387.78
    3502023.03.03 10:41t/p1740.201845.240.001845.24289.2211676.99
    3512023.03.08 05:15sell1760.201809.930.001774.74
    3522023.03.08 16:32close1760.201817.430.001774.74-150.0011526.99
    3532023.04.25 09:30buy1770.201995.350.002008.13
    3542023.04.26 16:27t/p1770.202008.130.002008.13246.7511773.75
    3552023.04.26 19:17buy1780.201988.980.001995.09
    3562023.04.27 05:12t/p1780.201995.090.001995.0995.6611869.41
    3572023.05.15 17:34sell1790.202016.660.002011.32
    3582023.05.16 09:04t/p1790.202011.320.002011.32110.9211980.33
    3592023.05.26 17:09sell1800.201951.200.001949.72
    3602023.05.26 17:19t/p1800.201949.720.001949.7229.6012009.93
    3612023.06.07 17:32sell1810.201958.950.001947.93
    3622023.06.07 18:50t/p1810.201947.930.001947.93220.4012230.33
    3632023.07.04 17:45buy1820.201928.500.001932.73
    3642023.07.05 16:17t/p1820.201932.730.001932.7375.7512306.08
    3652023.07.13 18:04sell1830.201959.610.001957.54
    3662023.07.13 18:51t/p1830.201957.540.001957.5441.4012347.48
    3672023.07.19 18:12sell1840.201974.940.001970.18
    3682023.07.20 17:35t/p1840.201970.180.001970.18107.5712455.05
    3692023.07.25 15:30sell1850.201958.580.001953.88
    3702023.07.25 17:00t/p1850.201953.880.001953.8894.0012549.05
    +
    diff --git a/Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.gif b/Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.gif new file mode 100644 index 0000000000000000000000000000000000000000..6b9c0a9ffd945c23533c09da80afe7b492c4bd66 GIT binary patch literal 7548 zcmc(Dg;!MH`}H7-3^5XdluAm7NXGzzh)S11gCJcBNO#YWLwENK3?My2cQ;5gbi)9G z^!)gI-#_BL>)f-RwV(a$XPvWX~N8E%o^{c0f2rmxDj`U0?Oz9r(#wPFk8pn(P52u z9qy8Mj&LwA_)ZJ_-wdv~^9KOT-MKM?)!em#fotaOg1f2lt`c?!_5;BEcdWZUushP- zn*K9!m;Vo`nVW;nP2WXkcR4`085nS4GWKmjDkhS#Ky%ZBqk-Nq^6~3WM*aOwRQC< zbVFlPb4zPmdq-zicTaC$|G?nT@JI>X_{8MYpXr&|x%q{~CCu{5>e~9o=GOMk?%w{v zA@=C_qWz;l56I;;zRU~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Q`E>( z(XzLqDyZzqGXv)tNS&4R3BsWvx$Ddz^G+?4Vo>(7#RiX`WrJ>Tbl`6iePJ)lz7G=0 zsRoMLBEx2UKfjLaw^cn64ci`4%NVDyMJEe!ia{(Cm~AI)m3T`L_gsMt$pf06!5MLbRv zN&hoCNqd;B!)=MWr5$5S{+v6N!>O7mJIc!(CPN!Pt7fz_HvW_<&oEB&Es&^7JsPI@ zxfK4TEOfHO$_b&j57%ranko-jw*s)9R}+Snp=mx%t<^*JGbm0GLa!vl!_ EA60XC@c;k- literal 0 HcmV?d00001 diff --git a/Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.htm b/Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.htm new file mode 100644 index 0000000..0f86f87 --- /dev/null +++ b/Docs/Reports/StrategyTester X (XXX and XTPW) Full - 0.2.htm @@ -0,0 +1,223 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.0002; xShortMaxDrawdownPerTradePercent=0.4; xLongR2R=3; xLongLotsPerTradePercent=0.0002; xLongMaxDrawdownPerTradePercent=0.4; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.0002; xTPWShortMaxDrawdownPerTradePercent=0.3; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.0002; xTPWLongMaxDrawdownPerTradePercent=0.3; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit7795.40Gross profit9684.44Gross loss-1889.04
    Profit factor5.13Expected payoff105.34
    Absolute drawdown601.05Maximal drawdown714.05 (64.16%)Relative drawdown64.16% (714.05)
    Total trades74Short positions (won %)39 (89.74%)Long positions (won %)35 (94.29%)
    Profit trades (% of total)68 (91.89%)Loss trades (% of total)6 (8.11%)
    Largestprofit trade439.57loss trade-409.05
    Averageprofit trade142.42loss trade-314.84
    Maximumconsecutive wins (profit in money)19 (2789.35)consecutive losses (loss in money)1 (-409.05)
    Maximalconsecutive profit (count of wins)2789.35 (19)consecutive loss (count of losses)-409.05 (1)
    Averageconsecutive wins11consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.201842.370.001854.79
    22020.12.07 10:38close10.201822.360.001854.79-409.05590.95
    32021.01.06 02:00buy20.201950.700.001958.50
    42021.01.06 12:00t/p20.201958.500.001958.50156.00746.95
    52021.01.29 16:54sell30.201865.800.001855.99
    62021.01.29 17:39t/p30.201855.990.001855.99196.20943.15
    72021.02.09 17:45sell40.201841.990.001838.33
    82021.02.09 18:09t/p40.201838.330.001838.3373.201016.35
    92021.02.10 17:00sell50.201841.300.001827.41
    102021.02.11 19:09t/p50.201827.410.001827.41290.171306.52
    112021.02.16 17:09sell60.201804.040.001801.47
    122021.02.16 18:49t/p60.201801.470.001801.4751.401357.92
    132021.02.19 05:15buy70.201769.840.001786.37
    142021.02.19 16:09t/p70.201786.370.001786.37330.601688.52
    152021.03.03 16:51sell80.201712.530.001708.07
    162021.03.03 17:36t/p80.201708.070.001708.0789.201777.72
    172021.03.11 16:48buy90.201719.830.001727.97
    182021.03.11 20:09t/p90.201727.970.001727.97162.801940.52
    192021.03.17 13:48buy100.201728.270.001737.00
    202021.03.17 20:06t/p100.201737.000.001737.00174.602115.12
    212021.04.08 14:00buy110.201746.230.001756.37
    222021.04.08 16:39t/p110.201756.370.001756.37202.802317.92
    232021.04.19 15:15buy120.201775.830.001781.86
    242021.04.21 04:39t/p120.201781.860.001781.86102.912420.83
    252021.04.27 18:24buy130.201778.350.001784.35
    262021.04.28 12:24close130.201763.350.001784.35-308.852111.98
    272021.05.04 23:15sell140.201779.150.001777.35
    282021.05.05 03:24t/p140.201777.350.001777.3540.122152.10
    292021.05.10 17:45sell150.201839.580.001833.85
    302021.05.11 03:39t/p150.201833.850.001833.85118.722270.83
    312021.05.19 22:00buy160.201863.390.001881.95
    322021.05.20 19:49t/p160.201881.950.001881.95344.662615.49
    332021.06.18 08:45sell170.201784.490.001777.35
    342021.06.18 15:52t/p170.201777.350.001777.35142.802758.29
    352021.07.01 05:00buy180.201771.690.001788.94
    362021.07.02 15:39t/p180.201788.940.001788.94336.153094.44
    372021.07.06 19:07buy190.201794.010.001807.68
    382021.07.07 13:24t/p190.201807.680.001807.68264.553359.00
    392021.07.08 18:04buy200.201801.860.001814.59
    402021.07.13 15:39t/p200.201814.590.001814.59228.063587.06
    412021.07.13 17:21sell210.201811.750.001808.46
    422021.07.13 20:34t/p210.201808.460.001808.4665.803652.86
    432021.07.14 12:00buy220.201814.410.001822.33
    442021.07.14 15:06t/p220.201822.330.001822.33158.403811.26
    452021.08.17 17:15buy230.201782.610.001787.72
    462021.08.18 04:09t/p230.201787.720.001787.7293.353904.61
    472021.08.20 17:39sell240.201781.750.001777.75
    482021.08.23 02:18t/p240.201777.750.001777.7584.123988.73
    492021.08.26 13:45buy250.201787.160.001795.29
    502021.08.26 18:04t/p250.201795.290.001795.29162.604151.33
    512021.08.31 15:30sell260.201811.860.001809.11
    522021.08.31 16:04t/p260.201809.110.001809.1155.004206.33
    532021.10.21 09:45buy270.201786.660.001797.58
    542021.10.22 15:22t/p270.201797.580.001797.58209.554415.89
    552021.10.27 18:09sell280.201793.560.001789.11
    562021.10.28 16:30close280.201808.560.001789.11-287.634128.25
    572021.11.03 04:00sell290.201783.060.001779.26
    582021.11.03 08:15t/p290.201779.260.001779.2676.004204.25
    592021.11.30 17:48sell300.201794.770.001781.02
    602021.11.30 18:04t/p300.201781.020.001781.02275.004479.25
    612021.12.13 16:49sell310.201785.140.001782.99
    622021.12.14 10:24t/p310.201782.990.001782.9947.124526.38
    632021.12.15 04:45sell320.201771.980.001768.80
    642021.12.15 07:39t/p320.201768.800.001768.8063.604589.98
    652021.12.15 16:54sell330.201769.740.001766.01
    662021.12.15 17:39t/p330.201766.010.001766.0174.604664.58
    672021.12.20 17:01sell340.201793.800.001789.41
    682021.12.20 22:09t/p340.201789.410.001789.4187.804752.38
    692021.12.21 16:52buy350.201793.720.001796.76
    702021.12.22 18:04t/p350.201796.760.001796.7651.954804.33
    712022.01.18 18:19sell360.201813.030.001806.19
    722022.01.19 16:52close360.201828.030.001806.19-295.884508.45
    732022.02.09 11:30buy370.201827.780.001831.59
    742022.02.09 15:09t/p370.201831.590.001831.5976.204584.65
    752022.02.15 11:19buy380.201856.860.001866.95
    762022.02.16 19:19t/p380.201866.950.001866.95192.954777.61
    772022.02.18 17:33sell390.201895.770.001893.21
    782022.02.18 17:37t/p390.201893.210.001893.2151.204828.81
    792022.03.02 18:16sell400.201921.470.001907.56
    802022.03.03 13:34close400.201936.470.001907.56-287.634541.17
    812022.03.14 08:45sell410.201975.330.001973.05
    822022.03.14 09:54t/p410.201973.050.001973.0545.604586.77
    832022.04.22 19:22sell420.201936.790.001932.93
    842022.04.22 20:28t/p420.201932.930.001932.9377.204663.97
    852022.04.26 16:08sell430.201905.800.001905.21
    862022.04.26 16:57t/p430.201905.210.001905.2111.804675.77
    872022.06.10 16:01sell440.201839.900.001834.17
    882022.06.10 16:18t/p440.201834.170.001834.17114.604790.37
    892022.06.24 05:00sell450.201823.760.001819.89
    902022.06.24 16:00t/p450.201819.890.001819.8977.404867.77
    912022.07.20 16:52sell460.201708.520.001702.79
    922022.07.20 19:48t/p460.201702.790.001702.79114.604982.37
    932022.08.01 01:30buy470.201764.450.001772.37
    942022.08.01 12:57t/p470.201772.370.001772.37158.405140.77
    952022.08.02 18:02sell480.201776.930.001767.92
    962022.08.02 21:02t/p480.201767.920.001767.92180.205320.97
    972022.08.22 14:15buy490.201735.790.001742.63
    982022.08.23 11:42t/p490.201742.630.001742.63127.955448.93
    992022.09.05 04:45buy500.201711.680.001722.30
    1002022.09.06 03:46t/p500.201722.300.001722.30203.555652.48
    1012022.09.30 20:35buy510.201663.060.001667.30
    1022022.10.03 04:30t/p510.201667.300.001667.3075.955728.43
    1032022.11.02 21:03sell520.201647.760.001626.40
    1042022.11.03 10:26t/p520.201626.400.001626.40439.576168.00
    1052022.11.15 04:45buy530.201771.790.001782.62
    1062022.11.15 09:47t/p530.201782.620.001782.62216.606384.60
    1072022.11.21 20:30buy540.201738.310.001753.49
    1082022.11.21 23:45buy550.201738.420.001742.35
    1092022.11.22 03:06t/p550.201742.350.001742.3569.756454.35
    1102022.11.24 02:26t/p540.201753.490.001753.49259.376713.72
    1112022.11.30 10:00buy560.201755.410.001761.92
    1122022.11.30 11:36t/p560.201761.920.001761.92130.206843.92
    1132022.11.30 17:18buy570.201751.820.001763.12
    1142022.11.30 21:20t/p570.201763.120.001763.12226.007069.92
    1152022.12.09 17:23buy580.201791.160.001800.19
    1162022.12.09 18:20t/p580.201800.190.001800.19180.607250.52
    1172023.01.11 17:38buy590.201870.910.001874.91
    1182023.01.11 19:21t/p590.201874.910.001874.9180.007330.52
    1192023.01.12 17:10sell600.201884.680.001867.96
    1202023.01.12 21:05close600.201899.680.001867.96-300.007030.52
    1212023.01.20 09:00buy610.201926.840.001936.65
    1222023.01.20 10:08t/p610.201936.650.001936.65196.207226.72
    1232023.02.07 16:32sell620.201869.860.001868.93
    1242023.02.07 16:45t/p620.201868.930.001868.9318.607245.32
    1252023.02.09 17:00sell630.201879.160.001868.22
    1262023.02.09 18:03t/p630.201868.220.001868.22218.807464.12
    1272023.03.01 04:30buy640.201829.000.001845.23
    1282023.03.02 20:35sell650.201835.870.001834.87
    1292023.03.02 20:43t/p650.201834.870.001834.8720.007484.12
    1302023.03.03 10:41t/p640.201845.230.001845.23289.227773.34
    1312023.04.25 09:30buy660.201995.340.002008.12
    1322023.04.26 16:27t/p660.202008.120.002008.12246.758020.09
    1332023.04.26 19:17buy670.201988.970.001995.08
    1342023.04.27 05:12t/p670.201995.080.001995.0895.668115.76
    1352023.05.15 17:34sell680.202016.660.002011.32
    1362023.05.16 09:04t/p680.202011.320.002011.32110.928226.68
    1372023.05.26 17:09sell690.201951.200.001949.72
    1382023.05.26 17:19t/p690.201949.720.001949.7229.608256.28
    1392023.06.07 17:32sell700.201958.950.001947.93
    1402023.06.07 18:50t/p700.201947.930.001947.93220.408476.68
    1412023.07.04 17:45buy710.201928.490.001932.72
    1422023.07.05 16:17t/p710.201932.720.001932.7275.758552.43
    1432023.07.13 18:04sell720.201959.610.001957.54
    1442023.07.13 18:51t/p720.201957.540.001957.5441.408593.83
    1452023.07.19 18:12sell730.201974.940.001970.18
    1462023.07.20 17:35t/p730.201970.180.001970.18107.578701.40
    1472023.07.25 15:30sell740.201958.580.001953.88
    1482023.07.25 17:00t/p740.201953.880.001953.8894.008795.40
    +
    diff --git a/Docs/Reports/StrategyTester X (XXX and XTPW) Full.gif b/Docs/Reports/StrategyTester X (XXX and XTPW) Full.gif new file mode 100644 index 0000000000000000000000000000000000000000..b8382b5fa0995ec36ea3c57da9a6d2bafe6f10c5 GIT binary patch literal 7566 zcmch(g;yKh_dOh>l;F@pkwS5|77tp-txsE=mbSPQS~Qg6B*9YLU4vU7Xeb_nLy_R_ zQlxl(`F!91;hi;e*SY)bv(G+v)|xf1HD1Xpe3T~X1*`)Acsw2e0AR6LJhC4I|BJM? zMiL;TH3*Ia5FR`p2L}-#q&0y_2myH96bMiWAl#s-|Br|N3kUrl0O&^&lAtNv{}BNI zYb2qRP)vZ3)|H?ZIDX9u|`v1?DDB<)0|9cmJyLf*l;vwP0cN> zZRqyj9i3g>J-vOHe(b>D&~Pcy*!aYs$*JiX-0a-^!s62M%Iezs#^%=c&hFm+!Qs*0 z{e$H`4d7IT z{l^@$svgE?kP(*@v!)p?_OW%GIkuqZom}qLY+p^G-g6d-J9W~vh6b9i1^D7?r48Sx z6MZX>f!P9xwC_+sFtBYv;Pbl-f^@4gCdMx*nW;b`LQZ@Yj(EPVJ7|ynnTi5dQvIvr z{oEQFjzhjqMuVkR$d#ea8vQd;AOn8{-{(_?5Q2-i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-5lYL)rtoCcPQGKxYzSBx>``(pP zR}!`OCBrGGrW{WN-Vg2E_Yy*@USSVEw2D(=0D_rH6uBK>rGplm0bddH`>3WtUU78o zY4sQl`q1U4p4YrX>`(OBT%u!ZeXGr^-)_z1E%0nE#u-&P8vdm59Kqw(RuXULIoObi zPmx7;Zmk;jigd+21hl#+(K2@D8j=W|t7z=$;k{ZN&`>H_6`PliK`@c_CixG~Y_jx; zIJ8+&+Vaob+&@^0#C?pbb$`r8%=z&kg^h%hyp*JTIiR+K>qhD63zEa(FADdUSNPql zc%K}Z-Mjyi@~BIV!Fd_RoyH~BU{q|ACKO)i5JT2wTTDxKz)u=H2jf6S0$Q!SoYGdV zeltH4GS&}ImH)uFllZLS&XZ39;Id>4`onLXO?Qgg49o>x$l$~ zPDjBXN#1aDeSb=09ck=vLdwJ9tv>Kk_;b+l?8lmnU%a+6PFCI5+{DXB*+ZzISKDrZ z1T|pLDfA#}{^XCu+hSfbXX0cIW`5z#3%)x(#F>9*gQs_)u#x0@wmQEH4T3!e2?}2N2948wf805H}oXv$3q5PUp@c}-bqHhdDHk9@E|r{ z?9JA=;cP__xzYoTsylxwVeX}$#Y&8aV1H^6?q!ZnC8i4$lMNX6^6zCO<_ECJ=56;1 T-@Ot`JjE26B0(_#08spYRa22t literal 0 HcmV?d00001 diff --git a/Docs/Reports/StrategyTester X (XXX and XTPW) Full.htm b/Docs/Reports/StrategyTester X (XXX and XTPW) Full.htm new file mode 100644 index 0000000..c78b557 --- /dev/null +++ b/Docs/Reports/StrategyTester X (XXX and XTPW) Full.htm @@ -0,0 +1,227 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit410.10Gross profit504.55Gross loss-94.45
    Profit factor5.34Expected payoff5.40
    Absolute drawdown18.44Maximal drawdown26.23 (2.16%)Relative drawdown2.39% (24.08)
    Total trades76Short positions (won %)40 (90.00%)Long positions (won %)36 (94.44%)
    Profit trades (% of total)70 (92.11%)Loss trades (% of total)6 (7.89%)
    Largestprofit trade21.98loss trade-20.44
    Averageprofit trade7.21loss trade-15.74
    Maximumconsecutive wins (profit in money)19 (139.44)consecutive losses (loss in money)1 (-20.44)
    Maximalconsecutive profit (count of wins)139.44 (19)consecutive loss (count of losses)-20.44 (1)
    Averageconsecutive wins10consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.011842.380.001854.80
    22020.12.04 17:39sell20.011836.610.001825.20
    32020.12.07 10:37t/p20.011825.200.001825.2011.621011.62
    42020.12.07 10:38close10.011822.380.001854.80-20.44991.17
    52021.01.06 02:00buy30.011950.710.001958.51
    62021.01.06 12:00t/p30.011958.510.001958.517.80998.97
    72021.01.29 16:54sell40.011865.800.001855.99
    82021.01.29 17:39t/p40.011855.990.001855.999.811008.78
    92021.02.09 17:45sell50.011841.990.001838.33
    102021.02.09 18:09t/p50.011838.330.001838.333.661012.44
    112021.02.10 17:00sell60.011841.300.001827.41
    122021.02.11 19:09t/p60.011827.410.001827.4114.511026.95
    132021.02.16 17:09sell70.011804.040.001801.47
    142021.02.16 18:49t/p70.011801.470.001801.472.571029.52
    152021.02.19 05:15buy80.011769.850.001786.38
    162021.02.19 16:09t/p80.011786.380.001786.3816.531046.05
    172021.03.03 16:51sell90.011712.530.001708.07
    182021.03.03 17:36t/p90.011708.070.001708.074.461050.51
    192021.03.11 16:48buy100.011719.840.001727.97
    202021.03.11 20:09t/p100.011727.970.001727.978.131058.64
    212021.03.17 13:48buy110.011728.280.001737.00
    222021.03.17 20:06t/p110.011737.000.001737.008.721067.36
    232021.04.08 14:00buy120.011746.240.001756.38
    242021.04.08 16:39t/p120.011756.380.001756.3810.141077.50
    252021.04.19 15:15buy130.011775.840.001781.87
    262021.04.21 04:30buy140.011779.820.001788.61
    272021.04.21 04:39t/p130.011781.870.001781.875.151082.65
    282021.04.21 16:39t/p140.011788.610.001788.618.791091.44
    292021.04.27 18:24buy150.011778.360.001784.35
    302021.04.28 12:24close150.011763.360.001784.35-15.441076.00
    312021.05.04 23:15sell160.011779.150.001777.35
    322021.05.05 03:24t/p160.011777.350.001777.352.011078.00
    332021.05.10 17:45sell170.011839.580.001833.85
    342021.05.11 03:39t/p170.011833.850.001833.855.941083.94
    352021.05.19 22:00buy180.011863.400.001881.95
    362021.05.20 19:49t/p180.011881.950.001881.9517.221101.16
    372021.06.18 08:45sell190.011784.490.001777.35
    382021.06.18 15:52t/p190.011777.350.001777.357.141108.30
    392021.07.01 05:00buy200.011771.700.001788.95
    402021.07.02 15:39t/p200.011788.950.001788.9516.811125.11
    412021.07.06 19:07buy210.011794.020.001807.68
    422021.07.07 13:24t/p210.011807.680.001807.6813.221138.33
    432021.07.08 18:04buy220.011801.870.001814.59
    442021.07.13 15:39t/p220.011814.590.001814.5911.391149.72
    452021.07.13 17:21sell230.011811.750.001808.46
    462021.07.13 20:34t/p230.011808.460.001808.463.291153.01
    472021.07.14 12:00buy240.011814.420.001822.34
    482021.07.14 15:06t/p240.011822.340.001822.347.921160.93
    492021.08.17 17:15buy250.011782.620.001787.73
    502021.08.18 04:09t/p250.011787.730.001787.734.671165.60
    512021.08.20 17:39sell260.011781.750.001777.75
    522021.08.23 02:18t/p260.011777.750.001777.754.211169.80
    532021.08.26 13:45buy270.011787.170.001795.30
    542021.08.26 18:04t/p270.011795.300.001795.308.131177.93
    552021.08.31 15:30sell280.011811.860.001809.11
    562021.08.31 16:04t/p280.011809.110.001809.112.751180.68
    572021.10.21 09:45buy290.011786.670.001797.59
    582021.10.22 15:22t/p290.011797.590.001797.5910.481191.16
    592021.10.27 18:09sell300.011793.560.001789.11
    602021.10.28 16:30close300.011808.560.001789.11-14.381176.78
    612021.11.03 04:00sell310.011783.060.001779.26
    622021.11.03 08:15t/p310.011779.260.001779.263.801180.58
    632021.11.30 17:48sell320.011794.770.001781.02
    642021.11.30 18:04t/p320.011781.020.001781.0213.751194.33
    652021.12.13 16:49sell330.011785.140.001782.99
    662021.12.14 10:24t/p330.011782.990.001782.992.361196.68
    672021.12.15 04:45sell340.011771.980.001768.80
    682021.12.15 07:39t/p340.011768.800.001768.803.181199.86
    692021.12.15 16:54sell350.011769.740.001766.01
    702021.12.15 17:39t/p350.011766.010.001766.013.731203.59
    712021.12.20 17:01sell360.011793.800.001789.41
    722021.12.20 22:09t/p360.011789.410.001789.414.391207.98
    732021.12.21 16:52buy370.011793.730.001796.76
    742021.12.22 18:04t/p370.011796.760.001796.762.591210.57
    752022.01.18 18:19sell380.011813.030.001806.19
    762022.01.19 16:52close380.011828.030.001806.19-14.791195.78
    772022.02.09 11:30buy390.011827.790.001831.60
    782022.02.09 15:09t/p390.011831.600.001831.603.811199.59
    792022.02.15 11:19buy400.011856.870.001866.96
    802022.02.16 19:19t/p400.011866.960.001866.969.651209.24
    812022.02.18 17:33sell410.011895.770.001893.21
    822022.02.18 17:37t/p410.011893.210.001893.212.561211.80
    832022.03.02 18:16sell420.011921.470.001907.56
    842022.03.03 13:34close420.011936.480.001907.56-14.391197.40
    852022.03.14 08:45sell430.011975.330.001973.05
    862022.03.14 09:54t/p430.011973.050.001973.052.281199.68
    872022.04.22 19:22sell440.011936.790.001932.93
    882022.04.22 20:28t/p440.011932.930.001932.933.861203.54
    892022.04.26 16:08sell450.011905.800.001905.21
    902022.04.26 16:57t/p450.011905.210.001905.210.591204.13
    912022.06.10 16:01sell460.011839.900.001834.17
    922022.06.10 16:18t/p460.011834.170.001834.175.731209.86
    932022.06.24 05:00sell470.011823.760.001819.89
    942022.06.24 16:00t/p470.011819.890.001819.893.871213.73
    952022.07.20 16:52sell480.011708.520.001702.79
    962022.07.20 19:48t/p480.011702.790.001702.795.731219.46
    972022.08.01 01:30buy490.011764.460.001772.38
    982022.08.01 12:57t/p490.011772.380.001772.387.921227.38
    992022.08.02 18:02sell500.011776.930.001767.92
    1002022.08.02 21:02t/p500.011767.920.001767.929.011236.39
    1012022.08.22 14:15buy510.011735.800.001742.64
    1022022.08.23 11:42t/p510.011742.640.001742.646.401242.79
    1032022.09.05 04:45buy520.011711.690.001722.31
    1042022.09.06 03:46t/p520.011722.310.001722.3110.181252.97
    1052022.09.30 20:35buy530.011663.070.001667.31
    1062022.10.03 04:30t/p530.011667.310.001667.313.801256.77
    1072022.11.02 21:03sell540.011647.760.001626.40
    1082022.11.03 10:26t/p540.011626.400.001626.4021.981278.75
    1092022.11.15 04:45buy550.011771.800.001782.63
    1102022.11.15 09:47t/p550.011782.630.001782.6310.831289.58
    1112022.11.21 20:30buy560.011738.320.001753.50
    1122022.11.21 23:45buy570.011738.430.001742.36
    1132022.11.22 03:06t/p570.011742.360.001742.363.491293.06
    1142022.11.24 02:26t/p560.011753.500.001753.5012.971306.03
    1152022.11.30 10:00buy580.011755.420.001761.93
    1162022.11.30 11:36t/p580.011761.930.001761.936.511312.54
    1172022.11.30 17:18buy590.011751.830.001763.12
    1182022.11.30 21:20t/p590.011763.120.001763.1211.291323.83
    1192022.12.09 17:23buy600.011791.170.001800.19
    1202022.12.09 18:20t/p600.011800.190.001800.199.021332.85
    1212023.01.11 17:38buy610.011870.920.001874.91
    1222023.01.11 19:21t/p610.011874.910.001874.913.991336.84
    1232023.01.12 17:10sell620.011884.680.001867.96
    1242023.01.12 21:05close620.011899.680.001867.96-15.001321.84
    1252023.01.20 09:00buy630.011926.850.001936.66
    1262023.01.20 10:08t/p630.011936.660.001936.669.811331.65
    1272023.02.07 16:32sell640.011869.860.001868.93
    1282023.02.07 16:45t/p640.011868.930.001868.930.931332.58
    1292023.02.09 17:00sell650.011879.160.001868.22
    1302023.02.09 18:03t/p650.011868.220.001868.2210.941343.52
    1312023.03.01 04:30buy660.011829.010.001845.24
    1322023.03.02 20:35sell670.011835.870.001834.86
    1332023.03.02 20:43t/p670.011834.860.001834.861.011344.53
    1342023.03.03 10:41t/p660.011845.240.001845.2414.461358.99
    1352023.04.25 09:30buy680.011995.350.002008.13
    1362023.04.26 16:27t/p680.012008.130.002008.1312.341371.33
    1372023.04.26 19:17buy690.011988.980.001995.09
    1382023.04.27 05:12t/p690.011995.090.001995.094.781376.11
    1392023.05.15 17:34sell700.012016.660.002011.32
    1402023.05.16 09:04t/p700.012011.320.002011.325.551381.66
    1412023.05.26 17:09sell710.011951.200.001949.72
    1422023.05.26 17:19t/p710.011949.720.001949.721.481383.14
    1432023.06.07 17:32sell720.011958.950.001947.93
    1442023.06.07 18:50t/p720.011947.930.001947.9311.021394.16
    1452023.07.04 17:45buy730.011928.500.001932.73
    1462023.07.05 16:17t/p730.011932.730.001932.733.791397.95
    1472023.07.13 18:04sell740.011959.610.001957.54
    1482023.07.13 18:51t/p740.011957.540.001957.542.071400.02
    1492023.07.19 18:12sell750.011974.940.001970.18
    1502023.07.20 17:35t/p750.011970.180.001970.185.381405.40
    1512023.07.25 15:30sell760.011958.580.001953.88
    1522023.07.25 17:00t/p760.011953.880.001953.884.701410.10
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3 - 1.gif b/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3 - 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..868fd3f19423d61961ff38c143b0e454f918c1d5 GIT binary patch literal 7581 zcmc(D^;?wB_x=KcO9}``iGYB#NV9|>DjkY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.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.27 23:45 (2020.01.01 - 2023.07.28)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.015; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.015; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.01; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.01; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test63077Ticks modelled72224447Modelling qualityn/a
    Mismatched charts errors798
    Initial deposit1000.00SpreadCurrent (58)
    Total net profit191.89Gross profit281.98Gross loss-90.09
    Profit factor3.13Expected payoff4.26
    Absolute drawdown21.51Maximal drawdown42.93 (3.48%)Relative drawdown3.48% (42.93)
    Total trades45Short positions (won %)24 (83.33%)Long positions (won %)21 (90.48%)
    Profit trades (% of total)39 (86.67%)Loss trades (% of total)6 (13.33%)
    Largestprofit trade16.82loss trade-15.43
    Averageprofit trade7.23loss trade-15.02
    Maximumconsecutive wins (profit in money)17 (134.54)consecutive losses (loss in money)2 (-30.00)
    Maximalconsecutive profit (count of wins)134.54 (17)consecutive loss (count of losses)-30.00 (2)
    Averageconsecutive wins10consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.011842.450.001854.87
    22020.12.07 10:34close10.011827.450.001854.87-15.43984.57
    32020.12.18 02:30sell20.011884.040.001880.44
    42020.12.18 03:21t/p20.011880.440.001880.443.60988.17
    52021.01.06 02:00buy30.011950.780.001958.58
    62021.01.06 12:00t/p30.011958.580.001958.587.80995.97
    72021.02.19 05:15buy40.011769.920.001786.45
    82021.02.19 16:09t/p40.011786.450.001786.4516.531012.50
    92021.04.08 14:00buy50.011746.310.001756.45
    102021.04.08 16:39t/p50.011756.450.001756.4510.141022.64
    112021.04.21 04:30buy60.011779.890.001788.68
    122021.04.21 16:39t/p60.011788.680.001788.688.791031.43
    132021.05.04 23:15sell70.011779.150.001777.35
    142021.05.05 03:24t/p70.011777.350.001777.352.001033.43
    152021.06.03 23:15sell80.011870.990.001864.93
    162021.06.04 03:45sell90.011869.320.001861.64
    172021.06.04 04:49t/p80.011864.930.001864.936.261039.69
    182021.06.04 04:52t/p90.011861.640.001861.647.681047.37
    192021.06.17 08:00sell100.011821.330.001813.95
    202021.06.17 09:09t/p100.011813.950.001813.957.381054.75
    212021.06.18 08:45sell110.011784.490.001777.35
    222021.06.18 15:52t/p110.011777.350.001777.357.141061.89
    232021.07.01 05:00buy120.011771.770.001789.02
    242021.07.02 15:39t/p120.011789.020.001789.0216.821078.71
    252021.07.14 12:00buy130.011814.490.001822.41
    262021.07.14 15:07t/p130.011822.410.001822.417.921086.63
    272021.08.26 13:45buy140.011787.240.001795.37
    282021.08.26 18:04t/p140.011795.370.001795.378.131094.76
    292021.10.21 09:45buy150.011786.740.001797.66
    302021.10.22 15:22t/p150.011797.660.001797.6610.491105.24
    312021.11.23 05:30sell160.011808.910.001802.04
    322021.11.23 10:52t/p160.011802.040.001802.046.871112.11
    332021.12.15 04:45sell170.011771.980.001768.80
    342021.12.15 07:39t/p170.011768.800.001768.803.181115.29
    352022.02.09 11:30buy180.011827.860.001831.67
    362022.02.09 15:09t/p180.011831.670.001831.673.811119.10
    372022.02.14 13:30sell190.011855.860.001850.34
    382022.02.14 17:39close190.011870.860.001850.34-15.001104.10
    392022.03.14 08:45sell200.011975.330.001973.05
    402022.03.14 10:01t/p200.011973.050.001973.052.281106.38
    412022.03.16 05:15sell210.011919.680.001909.45
    422022.03.16 16:19t/p210.011909.450.001909.4510.231116.61
    432022.05.17 11:30sell220.011827.110.001818.29
    442022.05.17 21:12t/p220.011818.290.001818.298.821125.43
    452022.06.24 05:00sell230.011823.760.001819.89
    462022.06.24 16:00t/p230.011819.890.001819.893.871129.30
    472022.07.06 01:05sell240.011766.830.001763.38
    482022.07.06 13:07t/p240.011763.380.001763.383.451132.75
    492022.07.07 01:45sell250.011738.940.001733.96
    502022.07.07 05:30sell260.011739.930.001733.36
    512022.07.08 10:45t/p250.011733.960.001733.965.181137.93
    522022.07.08 15:31t/p260.011733.360.001733.366.771144.70
    532022.08.01 01:30buy270.011764.530.001772.45
    542022.08.01 12:57t/p270.011772.450.001772.457.921152.62
    552022.08.08 22:30sell280.011787.280.001781.64
    562022.08.10 15:32close280.011802.280.001781.64-14.601138.02
    572022.08.22 14:15buy290.011735.870.001742.71
    582022.08.23 11:42t/p290.011742.710.001742.716.411144.43
    592022.09.05 04:45buy300.011711.760.001722.38
    602022.09.06 03:47t/p300.011722.380.001722.3810.191154.62
    612022.10.10 23:00sell310.011668.780.001662.90
    622022.10.11 05:13t/p310.011662.900.001662.906.081160.70
    632022.11.15 04:45buy320.011771.870.001782.70
    642022.11.15 09:47t/p320.011782.700.001782.7010.831171.53
    652022.11.15 15:00sell330.011775.140.001768.81
    662022.11.15 16:48t/p330.011768.810.001768.816.331177.86
    672022.11.21 20:30buy340.011738.390.001753.57
    682022.11.21 23:45buy350.011738.500.001742.43
    692022.11.22 03:07t/p350.011742.430.001742.433.501181.36
    702022.11.24 02:26t/p340.011753.570.001753.5713.021194.38
    712022.11.30 10:00buy360.011755.490.001762.00
    722022.11.30 12:00t/p360.011762.000.001762.006.511200.89
    732023.01.20 09:00buy370.011926.920.001936.73
    742023.01.20 10:08t/p370.011936.730.001936.739.811210.70
    752023.02.03 05:45sell380.011916.370.001914.03
    762023.02.03 09:32t/p380.011914.030.001914.032.341213.04
    772023.03.01 04:30buy390.011829.080.001845.31
    782023.03.03 10:42t/p390.011845.310.001845.3114.501227.54
    792023.03.21 07:45sell400.011981.970.001978.01
    802023.03.21 08:23t/p400.011978.010.001978.013.961231.50
    812023.03.31 07:15sell410.011981.510.001979.86
    822023.03.31 08:08t/p410.011979.860.001979.861.651233.15
    832023.04.25 09:30buy420.011995.420.002008.20
    842023.04.25 14:02close420.011980.420.002008.20-15.001218.15
    852023.05.08 01:45sell430.012014.730.002005.97
    862023.05.08 18:42close430.012029.730.002005.97-15.001203.15
    872023.07.04 17:45buy440.011928.570.001932.80
    882023.07.05 16:17t/p440.011932.800.001932.803.801206.95
    892023.07.07 04:30sell450.011911.150.001907.91
    902023.07.07 15:30close450.011926.210.001907.91-15.061191.89
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3.gif b/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015 - r2r 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..1cc063780f2a94dac56d82ee9b9b0bf14e58b3f2 GIT binary patch literal 7649 zcmc(6g?-s|EYjW0pL}_4ISBV)8Qt0#NM<)g0T3T;O1($sYKp@eE?A34eO>4@`iLX(|;yz^8X=N zJRXUkx{1IyIY8-+)Qu<@iN}KgpqrupzbxUK*9ZLf7l7LYD8SD@ATTI6Boqb@3r9pC zBcq~YV&mdb35iL`=#JF$Lt|5OOKV$u zM`u@ePj4Tte_(K^kZ5#ld}4BHdImo`H@~pBw7l|rb!~lPb8Gw0&hFm+!QtP3N5?1o zr9`R3m)9v*fa`4rxmm`an~I&yBn6jFB5^m7X_2?i1L=R) z&|vUwe~$xKRXP7s3Tf5R!*S>B^JCjk$%oXObo7dra#GN~z*i5WitEn@I`Y_pS%fS~ z(|Y5k3|XGm(1s4droIX2UPsy2-PVb(ymG0=oE?+zVshmz!pW)KOL(il*Rgz1Nn z3*32T>dsK#JWa;d3{Z;TY3C#%6C2X;=VZd^XA(HKmqHRqB-3d00a7fb0BV`VQp;$7 zhPyvCP^VM{K)z42M(v-ynoTXO1A)eu4UezIJHR&Ah(`bILz65uqe&?A<`>&iKFk>K zK}X#H>xRx-i#hTBZ+pP#&rF~-Q`@u9=MYyuid-~`!on){Hjb4)H;cHM4MP@2wwjZZ zy~SAIMz)`;2QMe%FLI~Dj3)vl&jr#W=l4mdr2w=AMA>Q}yIi8Q3Ep(&_iX%mcbcc| zVjama!m%Ap?CZsSY`y;ZegNCu1e^P5Jegi2-H*7m<=>V(Jduog^6)}rq=cKmM<>dy zyD1hD5*f=+O0q~)x(`s1)=+Zw)44-L;G(9{O#vsHmn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>{ID<}jaz97H1U4hK*zp&ue(IJ) zdFv6_?~72zKn+Ft$D^El2BB9ZaF)UOKu24*9mr>)ZSwMBi4qT6+dc)#nIV` + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.27 23:45 (2020.01.01 - 2023.07.28)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.015; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.015; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=1.5; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.01; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.01; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test63077Ticks modelled72224447Modelling qualityn/a
    Mismatched charts errors798
    Initial deposit1000.00SpreadCurrent (59)
    Total net profit176.26Gross profit265.68Gross loss-89.42
    Profit factor2.97Expected payoff3.39
    Absolute drawdown6.09Maximal drawdown47.44 (3.88%)Relative drawdown3.88% (47.44)
    Total trades52Short positions (won %)37 (83.78%)Long positions (won %)15 (100.00%)
    Profit trades (% of total)46 (88.46%)Loss trades (% of total)6 (11.54%)
    Largestprofit trade10.83loss trade-15.01
    Averageprofit trade5.78loss trade-14.90
    Maximumconsecutive wins (profit in money)18 (96.73)consecutive losses (loss in money)2 (-29.81)
    Maximalconsecutive profit (count of wins)96.73 (18)consecutive loss (count of losses)-29.81 (2)
    Averageconsecutive wins9consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.011884.040.001880.44
    22020.12.18 03:21t/p10.011880.440.001880.443.601003.60
    32021.01.06 02:00buy20.011950.790.001958.59
    42021.01.06 12:00t/p20.011958.590.001958.597.801011.40
    52021.01.21 02:45sell30.011869.150.001861.32
    62021.01.21 15:54t/p30.011861.320.001861.327.831019.23
    72021.03.09 22:15sell40.011716.740.001708.85
    82021.03.10 13:30t/p40.011708.850.001708.858.091027.32
    92021.04.01 03:45sell50.011706.320.001698.49
    102021.04.01 16:01close50.011721.320.001698.49-15.001012.32
    112021.04.08 14:00buy60.011746.320.001756.46
    122021.04.08 16:39t/p60.011756.460.001756.4610.141022.46
    132021.04.15 21:15sell70.011767.210.001764.03
    142021.04.15 23:24t/p70.011764.030.001764.033.181025.64
    152021.04.21 04:30buy80.011779.900.001788.69
    162021.04.21 16:39t/p80.011788.690.001788.698.791034.43
    172021.05.04 23:15sell90.011779.150.001777.35
    182021.05.05 03:24t/p90.011777.350.001777.352.001036.43
    192021.05.07 13:45sell100.011820.100.001817.55
    202021.05.07 15:33t/p100.011817.550.001817.552.551038.98
    212021.06.03 23:15sell110.011870.990.001864.93
    222021.06.04 03:45sell120.011869.320.001861.64
    232021.06.04 04:49t/p110.011864.930.001864.936.261045.24
    242021.06.04 04:52t/p120.011861.640.001861.647.681052.92
    252021.06.17 08:00sell130.011821.330.001813.95
    262021.06.17 09:09t/p130.011813.950.001813.957.381060.30
    272021.06.18 08:45sell140.011784.490.001777.35
    282021.06.18 15:52t/p140.011777.350.001777.357.141067.44
    292021.07.14 12:00buy150.011814.500.001822.42
    302021.07.14 15:07t/p150.011822.420.001822.427.921075.36
    312021.08.26 13:45buy160.011787.250.001795.38
    322021.08.26 18:04t/p160.011795.380.001795.388.131083.49
    332021.10.21 09:45buy170.011786.750.001797.67
    342021.10.22 15:22t/p170.011797.670.001797.6710.491093.98
    352021.11.23 05:30sell180.011808.910.001802.04
    362021.11.23 10:52t/p180.011802.040.001802.046.871100.85
    372021.12.15 04:45sell190.011771.980.001768.80
    382021.12.15 07:39t/p190.011768.800.001768.803.181104.03
    392022.02.09 11:30buy200.011827.870.001831.68
    402022.02.09 15:09t/p200.011831.680.001831.683.811107.84
    412022.02.14 13:30sell210.011855.860.001850.34
    422022.02.14 17:39close210.011870.860.001850.34-15.001092.84
    432022.03.14 08:45sell220.011975.330.001973.05
    442022.03.14 10:01t/p220.011973.050.001973.052.281095.12
    452022.03.16 05:15sell230.011919.680.001909.45
    462022.03.16 16:19t/p230.011909.450.001909.4510.231105.35
    472022.05.17 05:00sell240.011826.120.001823.51
    482022.05.17 06:33t/p240.011823.510.001823.512.611107.96
    492022.06.24 05:00sell250.011823.760.001819.89
    502022.06.24 16:00t/p250.011819.890.001819.893.871111.83
    512022.07.06 01:05sell260.011766.830.001763.38
    522022.07.06 13:07t/p260.011763.380.001763.383.451115.28
    532022.07.07 01:45sell270.011738.940.001733.96
    542022.07.07 05:30sell280.011739.930.001733.36
    552022.07.08 10:45t/p270.011733.960.001733.965.181120.46
    562022.07.08 15:31t/p280.011733.360.001733.366.771127.23
    572022.08.01 01:30buy290.011764.540.001772.46
    582022.08.01 12:57t/p290.011772.460.001772.467.921135.15
    592022.08.08 22:30sell300.011787.280.001781.64
    602022.08.10 15:32close300.011802.290.001781.64-14.611120.54
    612022.08.22 14:15buy310.011735.880.001742.72
    622022.08.23 11:42t/p310.011742.720.001742.726.411126.95
    632022.09.05 04:45buy320.011711.770.001722.39
    642022.09.06 03:47t/p320.011722.390.001722.3910.191137.13
    652022.10.10 23:00sell330.011668.780.001662.90
    662022.10.11 05:13t/p330.011662.900.001662.906.081143.21
    672022.11.09 07:30sell340.011708.410.001705.89
    682022.11.09 12:07t/p340.011705.890.001705.892.521145.73
    692022.11.15 04:45buy350.011771.880.001782.71
    702022.11.15 09:47t/p350.011782.710.001782.7110.831156.56
    712022.11.15 15:00sell360.011775.140.001768.81
    722022.11.15 16:48t/p360.011768.810.001768.816.331162.89
    732022.11.21 23:45buy370.011738.510.001742.44
    742022.11.22 03:07t/p370.011742.440.001742.443.501166.39
    752022.11.30 10:00buy380.011755.500.001762.01
    762022.11.30 12:00t/p380.011762.010.001762.016.511172.90
    772023.01.09 07:30sell390.011876.700.001873.64
    782023.01.09 11:03t/p390.011873.640.001873.643.061175.96
    792023.01.20 09:00buy400.011926.930.001936.74
    802023.01.20 10:08t/p400.011936.740.001936.749.811185.77
    812023.02.02 09:00sell410.011951.910.001945.34
    822023.02.02 15:58t/p410.011945.340.001945.346.571192.34
    832023.02.03 05:45sell420.011916.370.001914.03
    842023.02.03 09:32t/p420.011914.030.001914.032.341194.68
    852023.03.21 07:45sell430.011981.970.001978.01
    862023.03.21 08:23t/p430.011978.010.001978.013.961198.64
    872023.03.31 07:15sell440.011981.510.001979.86
    882023.03.31 08:08t/p440.011979.860.001979.861.651200.29
    892023.04.04 02:00sell450.011983.600.001978.41
    902023.04.04 04:59t/p450.011978.410.001978.415.191205.48
    912023.04.05 01:45sell460.012020.810.002019.10
    922023.04.05 04:15sell470.012020.920.002015.55
    932023.04.05 17:32t/p460.012019.100.002019.101.711207.19
    942023.04.05 17:33t/p470.012015.550.002015.555.371212.56
    952023.04.14 07:30sell480.012044.780.002040.07
    962023.04.14 08:51t/p480.012040.070.002040.074.711217.27
    972023.05.02 21:45sell490.012014.740.002008.50
    982023.05.03 21:00close490.012029.740.002008.50-14.801202.47
    992023.05.08 01:45sell500.012014.730.002005.97
    1002023.05.08 18:42close500.012029.740.002005.97-15.011187.46
    1012023.07.04 17:45buy510.011928.580.001932.81
    1022023.07.05 16:17t/p510.011932.810.001932.813.801191.26
    1032023.07.07 04:30sell520.011911.150.001907.91
    1042023.07.07 15:30close520.011926.150.001907.91-15.001176.26
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015.gif b/Docs/Reports/Tests/X/StrategyTester - lots 0.00001 - maxd 0.015.gif new file mode 100644 index 0000000000000000000000000000000000000000..fc19c9b3031d09496387e59ca0f48930726e1791 GIT binary patch literal 7693 zcmc(D^;eYN_x+GElz@UTfD+Q7sML^R& zOsj57Z;NlCD$^2hBND%E3cl4unpT-M-bw=iePD1S{uTw4%>GZsv;<(fj=!ZN8*e+@ zCT|_#kznwx7WlsvTy^UY0GPdXV~VW0ZG!|?&E5vLOXF=N@)qm^fctJ)w|$Veq}x6H zXW};hA5t|ti=4&XMy9tpK#3_BaI1D}Xci0r-){Q<%MiRheZYVJ0&oZK2M7oZ3JwW{ zKw)9*^aC zo0?l%+kUlobar+3^!D`+3=Rz!5R8paOitm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NLQHO<6G9iUjL_oXr(o@%&Wia>;^zoD~E?3 z2D>eKpQ>xqlC0vMx3tpdJFe89*m{;-oi@9+H6HwNEW7%fHSQ~OP05IFQvX}vHL%Kb z!Kf{_#`@HIcdQ*iwbV2OET%b*X5(lHg(s{d@YcGhbUt1r@gHvvgZXlu4iE&G;XM@8 zSe|er&t5@feBgsJizRLCd^r-F`Dv}J?au3NATue_`q{@8LbC*5(mYKF_s0w#vr`4` z8^Iv0$6qPDmBe|aszy(cs&ximnF2v{S&v!Me~9F24iGw~zx$yFkG;inJD zUuC&>0k#(@L$Ct$+5ELt6i8c;*{VN4p}Eix7KM?CxOuMfZiRokbkUfgMPaIv9)Ocp zd^K?nCk0R~rz6rOpC$QmY{pwfh0*)&_&s7We@2*vkwUP~To6O0In=i8Sulg=0-;$V z^yk|TNq(Ma9(up(wjTRWS^rob4?y3kKebFrk$5QaWO>Nml*4ptZ)Wy}59)@+qWF@N zq-jCGU~YNx-hLiNRttWZa9?Hu4pSC4{r*Sob0&Hd9{yxeatL_%C)eJ0VZ0kz4E3lx zA=OXG*qqTfHRajdhBGhrCF}JGV*^$Q&A}L8i^k(H%#kNb4W;rSXQcvNxds|GhA4+v zDC7pa@n88QNM+fagesGCXuW~9V-YWy%656`a%VK%wIX2I#-P779RN&DC7s6r%Nnr` z7IWbol`x#YJJ%~jTtQ!|-#6zlDZQ*yWFLDkvV&PboOb$`)};N1t9)6!m`-=V=c0sb z{g-kgI`uAxp&lLl#L8Enh;$fG$|lx%!dKJ5E^#FQR_kvOq;pH;t~KpKMfMS4b8Gyr lwf)vbj%gJ0TPm(~ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.27 23:45 (2020.01.01 - 2023.07.28)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=2.5; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.015; xLongR2R=2.5; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.015; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=1.5; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.01; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.01; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test63077Ticks modelled72224447Modelling qualityn/a
    Mismatched charts errors798
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit151.92Gross profit226.60Gross loss-74.68
    Profit factor3.03Expected payoff2.92
    Absolute drawdown6.67Maximal drawdown26.96 (2.29%)Relative drawdown2.41% (26.81)
    Total trades52Short positions (won %)37 (86.49%)Long positions (won %)15 (100.00%)
    Profit trades (% of total)47 (90.38%)Loss trades (% of total)5 (9.62%)
    Largestprofit trade9.03loss trade-15.05
    Averageprofit trade4.82loss trade-14.94
    Maximumconsecutive wins (profit in money)19 (85.81)consecutive losses (loss in money)1 (-15.05)
    Maximalconsecutive profit (count of wins)85.81 (19)consecutive loss (count of losses)-15.05 (1)
    Averageconsecutive wins9consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.011884.040.001881.04
    22020.12.18 03:17t/p10.011881.040.001881.043.001003.00
    32021.01.06 02:00buy20.011950.770.001957.27
    42021.01.06 11:54t/p20.011957.270.001957.276.501009.50
    52021.01.21 02:45sell30.011869.150.001862.63
    62021.01.21 15:54t/p30.011862.630.001862.636.521016.02
    72021.03.09 22:15sell40.011716.740.001710.17
    82021.03.10 08:09t/p40.011710.170.001710.176.771022.79
    92021.04.01 03:45sell50.011706.320.001699.80
    102021.04.01 16:01close50.011721.320.001699.80-15.001007.79
    112021.04.08 14:00buy60.011746.300.001754.75
    122021.04.08 16:36t/p60.011754.750.001754.758.451016.24
    132021.04.15 21:15sell70.011767.210.001764.56
    142021.04.15 22:39t/p70.011764.560.001764.562.651018.89
    152021.04.21 04:30buy80.011779.880.001787.21
    162021.04.21 09:51t/p80.011787.210.001787.217.331026.22
    172021.05.04 23:15sell90.011779.150.001777.65
    182021.05.05 03:10t/p90.011777.650.001777.651.701027.92
    192021.05.07 13:45sell100.011820.100.001817.98
    202021.05.07 15:07t/p100.011817.980.001817.982.121030.04
    212021.06.03 23:15sell110.011870.990.001865.94
    222021.06.04 03:45sell120.011869.320.001862.92
    232021.06.04 04:49t/p110.011865.940.001865.945.251035.29
    242021.06.04 04:52t/p120.011862.920.001862.926.401041.69
    252021.06.17 08:00sell130.011821.330.001815.18
    262021.06.17 09:07t/p130.011815.180.001815.186.151047.84
    272021.06.18 08:45sell140.011784.490.001778.54
    282021.06.18 15:24t/p140.011778.540.001778.545.951053.79
    292021.07.14 12:00buy150.011814.480.001821.08
    302021.07.14 15:06t/p150.011821.080.001821.086.601060.39
    312021.08.26 13:45buy160.011787.230.001794.01
    322021.08.26 17:31t/p160.011794.010.001794.016.781067.17
    332021.10.21 09:45buy170.011786.730.001795.83
    342021.10.22 15:19t/p170.011795.830.001795.838.671075.84
    352021.11.23 05:30sell180.011808.910.001803.19
    362021.11.23 10:49t/p180.011803.190.001803.195.721081.56
    372021.12.15 04:45sell190.011771.980.001769.33
    382021.12.15 07:24t/p190.011769.330.001769.332.651084.21
    392022.02.09 11:30buy200.011827.850.001831.03
    402022.02.09 15:07t/p200.011831.030.001831.033.181087.39
    412022.02.14 13:30sell210.011855.860.001851.26
    422022.02.14 17:39close210.011870.860.001851.26-15.001072.39
    432022.03.14 08:45sell220.011975.330.001973.43
    442022.03.14 09:24t/p220.011973.430.001973.431.901074.29
    452022.03.16 05:15sell230.011919.680.001911.16
    462022.03.16 16:09t/p230.011911.160.001911.168.521082.81
    472022.05.17 05:00sell240.011826.120.001823.95
    482022.05.17 06:08t/p240.011823.950.001823.952.171084.98
    492022.06.24 05:00sell250.011823.760.001820.54
    502022.06.24 16:00t/p250.011820.540.001820.543.221088.20
    512022.07.06 01:05sell260.011766.830.001763.96
    522022.07.06 08:38t/p260.011763.960.001763.962.871091.07
    532022.07.07 01:45sell270.011738.940.001734.79
    542022.07.07 05:30sell280.011739.930.001734.46
    552022.07.08 10:43t/p270.011734.790.001734.794.351095.42
    562022.07.08 10:43t/p280.011734.460.001734.465.671101.09
    572022.08.01 01:30buy290.011764.520.001771.12
    582022.08.01 12:53t/p290.011771.120.001771.126.601107.69
    592022.08.08 22:30sell300.011787.280.001782.58
    602022.08.10 15:32close300.011802.300.001782.58-14.621093.07
    612022.08.22 14:15buy310.011735.860.001741.56
    622022.08.23 11:20t/p310.011741.560.001741.565.271098.34
    632022.09.05 04:45buy320.011711.750.001720.60
    642022.09.06 03:32t/p320.011720.600.001720.608.421106.75
    652022.10.10 23:00sell330.011668.780.001663.88
    662022.10.11 05:13t/p330.011663.880.001663.885.101111.85
    672022.11.09 07:30sell340.011708.410.001706.31
    682022.11.09 12:07t/p340.011706.310.001706.312.101113.95
    692022.11.15 04:45buy350.011771.860.001780.89
    702022.11.15 09:46t/p350.011780.890.001780.899.031122.98
    712022.11.15 15:00sell360.011775.140.001769.87
    722022.11.15 16:48t/p360.011769.870.001769.875.271128.25
    732022.11.21 23:45buy370.011738.490.001741.77
    742022.11.22 03:03t/p370.011741.770.001741.772.851131.10
    752022.11.30 10:00buy380.011755.480.001760.91
    762022.11.30 11:08t/p380.011760.910.001760.915.431136.53
    772023.01.09 07:30sell390.011876.700.001874.15
    782023.01.09 09:51t/p390.011874.150.001874.152.551139.08
    792023.01.20 09:00buy400.011926.910.001935.09
    802023.01.20 10:07t/p400.011935.090.001935.098.181147.26
    812023.02.02 09:00sell410.011951.910.001946.44
    822023.02.02 15:52t/p410.011946.440.001946.445.471152.73
    832023.02.03 05:45sell420.011916.370.001914.42
    842023.02.03 06:23t/p420.011914.420.001914.421.951154.68
    852023.03.21 07:45sell430.011981.970.001978.67
    862023.03.21 08:22t/p430.011978.670.001978.673.301157.98
    872023.03.31 07:15sell440.011981.510.001980.14
    882023.03.31 08:08t/p440.011980.140.001980.141.371159.35
    892023.04.04 02:00sell450.011983.600.001979.28
    902023.04.04 04:54t/p450.011979.280.001979.284.321163.67
    912023.04.05 01:45sell460.012020.810.002019.39
    922023.04.05 04:15sell470.012020.920.002016.45
    932023.04.05 17:11t/p460.012019.390.002019.391.421165.09
    942023.04.05 17:32t/p470.012016.450.002016.454.471169.56
    952023.04.14 07:30sell480.012044.780.002040.86
    962023.04.14 08:38t/p480.012040.860.002040.863.921173.48
    972023.05.02 21:45sell490.012014.740.002009.54
    982023.05.03 15:15t/p490.012009.540.002009.545.401178.88
    992023.05.08 01:45sell500.012014.730.002007.43
    1002023.05.08 19:15close500.012029.740.002007.43-15.011163.87
    1012023.07.04 17:45buy510.011928.560.001932.09
    1022023.07.05 16:17t/p510.011932.090.001932.093.101166.97
    1032023.07.07 04:30sell520.011911.150.001908.45
    1042023.07.07 15:30close520.011926.200.001908.45-15.051151.92
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester 1.gif b/Docs/Reports/Tests/X/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f4c0daa49ae07857b872958e7c7b2aa5b17f174 GIT binary patch literal 7224 zcmc(E=T{TX^K}5l5FixkMM3GHAc8=sib^kng^nQ7Rct`$y@VF&HG~#A0coKJr1vU; z&^w`{AU(f)zRw@=?Ae_&=gyrwv%4?$#j0sMmzA@UqUZ*!0RTiI5dZ-6_xBTP`XKPb z8e7{M5>#Ugf#U(BMI_?k5E4{lOJb5-01=Oa0LlTR3Bmn89`O(k`5yr2t04s;IQ;*J z0Dx@`DV3B=f@*BbAx&`Nsx5@13Ae4WZ6Zkn0DTZh6On`h%JKhGu`LJKt`bRfcoV4t zDM;#w2!}vOT9E%Nq=wWV0DvcTV+*e#m4QQQ@Fa(1nn;;&64(cT^pRMkI&cz+w5R`? zAjSVfYVdeC9!K(QNijeGT2r-38zV(GL(17!({58Ws+V zh>VJkf&Yk&i%&>QN=`{lOV2=LBD1n{a`RC61%*Y$C8cHP@`|68Rn;}Mn7aCg#-`>L zY-`)E_Kwc3?w;Ph{(-@v;S#d3@rmD)xT$IU%z)+p+ zYgsJJ9zdpjohGaoMgRn;-e44>Uy(L3en!nk0}&Pez>jt&@^@Uvy6#S+Q5@Iw&;RV^ zRDy5q^S3jSK* zfCti<7!Mf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`QCkTnSba zLH5SmW=`MGw zvTX9aI{0O{I5eIy1)Q~!0T0<^X&ll)mAHJQipU!HN6`}kkDc6EL81ARPJ&ROtw?V1 zH;V(u;{01-c_lR=(@w(0k3{;53R%tp#c_zAA^>I+m>5Nsz?c|%#Dim7sF++{+omgk zU|$X7-w+f6!`jG+Sgt#g(71Xs*f2D>VMkS~0F96*YBthzIiT06hfgNg+l2*aDtL%o@e+39imdYc-=2*r zxKJQ=M4a2y+z$7ml>#NJ$z?NVHKz6UO2YAPsN-C19>;OXOqeWthvOq@<6N_n2?J7i zZ#S3O{=9x2!3ofNuIiB~P()&SteTjh>VkDu(Hc|zrbFI1G)k}DK`w6YVw1hs$>S(uPgjY5jJnMS-|sZv@Z_(! zdm}YZ$C3=}a)9n-Xiug9O{H>BRe@s;xfa0eSg!BAUWUEWC=&j%CQ^lVCxGcE4@LKr zHbW$w%0Mecp zD{BN}xz7-;K(L~W6KWGZ1ctp~>SJgq00_p~N7{(xun&cGN)>&Ma(2$)oCkKv_I{53 pR+7WL7uKaf_#ET4opYNA>{bDNfd`4@^3sKOKNVr*@dp6p{}1M<#~c6v literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/X/StrategyTester 1.htm b/Docs/Reports/Tests/X/StrategyTester 1.htm new file mode 100644 index 0000000..9f8cc67 --- /dev/null +++ b/Docs/Reports/Tests/X/StrategyTester 1.htm @@ -0,0 +1,98 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.27 23:45 (2020.01.01 - 2023.07.28)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test63077Ticks modelled72224447Modelling qualityn/a
    Mismatched charts errors798
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit201.25Gross profit201.25Gross loss-0.00
    Profit factorExpected payoff9.58
    Absolute drawdown21.07Maximal drawdown26.62 (2.65%)Relative drawdown2.65% (26.62)
    Total trades21Short positions (won %)0 (0.00%)Long positions (won %)21 (100.00%)
    Profit trades (% of total)21 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade16.82loss trade-0.00
    Averageprofit trade9.58loss trade-0.00
    Maximumconsecutive wins (profit in money)21 (201.25)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)201.25 (21)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins21consecutive losses0
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.011842.470.001854.89
    22020.12.07 16:54t/p10.011854.890.001854.8911.991011.99
    32021.01.06 02:00buy20.011950.800.001958.60
    42021.01.06 12:00t/p20.011958.600.001958.607.801019.79
    52021.02.19 05:15buy30.011769.940.001786.47
    62021.02.19 16:09t/p30.011786.470.001786.4716.531036.32
    72021.04.08 14:00buy40.011746.330.001756.47
    82021.04.08 16:39t/p40.011756.470.001756.4710.141046.46
    92021.04.21 04:30buy50.011779.910.001788.70
    102021.04.21 16:39t/p50.011788.700.001788.708.791055.25
    112021.07.01 05:00buy60.011771.790.001789.04
    122021.07.02 15:39t/p60.011789.040.001789.0416.821072.07
    132021.07.14 12:00buy70.011814.510.001822.43
    142021.07.14 15:07t/p70.011822.430.001822.437.921079.99
    152021.08.26 13:45buy80.011787.260.001795.39
    162021.08.26 18:04t/p80.011795.390.001795.398.131088.12
    172021.10.21 09:45buy90.011786.760.001797.68
    182021.10.22 15:22t/p90.011797.680.001797.6810.491098.60
    192022.02.09 11:30buy100.011827.880.001831.69
    202022.02.09 15:09t/p100.011831.690.001831.693.811102.41
    212022.08.01 01:30buy110.011764.550.001772.47
    222022.08.01 12:57t/p110.011772.470.001772.477.921110.33
    232022.08.22 14:15buy120.011735.890.001742.73
    242022.08.23 11:42t/p120.011742.730.001742.736.411116.74
    252022.09.05 04:45buy130.011711.780.001722.40
    262022.09.06 03:47t/p130.011722.400.001722.4010.191126.93
    272022.11.15 04:45buy140.011771.890.001782.72
    282022.11.15 09:47t/p140.011782.720.001782.7210.831137.76
    292022.11.21 20:30buy150.011738.410.001753.59
    302022.11.21 23:45buy160.011738.520.001742.45
    312022.11.22 03:07t/p160.011742.450.001742.453.501141.26
    322022.11.24 02:26t/p150.011753.590.001753.5913.021154.28
    332022.11.30 10:00buy170.011755.510.001762.02
    342022.11.30 12:00t/p170.011762.020.001762.026.511160.79
    352023.01.20 09:00buy180.011926.940.001936.75
    362023.01.20 10:08t/p180.011936.750.001936.759.811170.60
    372023.03.01 04:30buy190.011829.100.001845.33
    382023.03.03 10:42t/p190.011845.330.001845.3314.501185.10
    392023.04.25 09:30buy200.011995.440.002008.22
    402023.04.26 16:28t/p200.012008.220.002008.2212.351197.45
    412023.07.04 17:45buy210.011928.590.001932.82
    422023.07.05 16:17t/p210.011932.820.001932.823.801201.25
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester 2.gif b/Docs/Reports/Tests/X/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..93e3b74079c182495d151af3f699715614a9e146 GIT binary patch literal 7247 zcmch5_dDC&|9|YDs@p0xYVTHW#HiA{M(J|jwH0mcT~#6_c4EZdM2r#yvG=Az?3oaI zZ(21&KJNGTfB3$x*Xz2T*JGXMIp>FSu9v3v3k5|>IT{>b6#$@6C;$MUudk0%jR!^l zsLY-`Y(@S4FFux)z(;0Q#5788gzw4TU%dYp#PX^>m~pI4+1q&t~da8 z`hU6BSb+5k<;oO&MPjeWs~#!QAkbC%m94tkdits}>*(sMA)`Un(^o}x^z>EgRdUmn zvl(O06Y`Tf_>mFT~btFKhkl&glVuQ&kK8Uz4c&HMlVBXPC*fdBRaz(9cl z0s@1ALqcKju<(dTL{xN4Y+QUoVp4KSYFc^*G82`Ros;_`FCSe{ScEAqDa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..62ee295 --- /dev/null +++ b/Docs/Reports/Tests/X/StrategyTester 2.htm @@ -0,0 +1,84 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.4; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
    Bars in test61155Ticks modelled69617088Modelling quality40.15%
    Mismatched charts errors30
    Initial deposit1000.00SpreadCurrent (59)
    Total net profit1812.58Gross profit1812.58Gross loss-0.00
    Profit factorExpected payoff226.57
    Absolute drawdown290.70Maximal drawdown420.90 (37.24%)Relative drawdown37.24% (420.90)
    Total trades8Short positions (won %)0 (0.00%)Long positions (won %)8 (100.00%)
    Profit trades (% of total)8 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade270.90loss trade-0.00
    Averageprofit trade226.57loss trade-0.00
    Maximumconsecutive wins (profit in money)8 (1812.58)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)1812.58 (8)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins8consecutive losses0
    +Graph
    + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.06 02:00buy10.301950.790.001957.29
    22021.01.06 11:54t/p10.301957.290.001957.29195.001195.00
    32021.04.08 14:00buy20.301746.320.001754.77
    42021.04.08 16:36t/p20.301754.770.001754.77253.501448.50
    52021.04.21 04:30buy30.301779.900.001787.23
    62021.04.21 09:52t/p30.301787.230.001787.23219.901668.40
    72021.07.14 12:00buy40.301814.500.001821.10
    82021.07.14 15:06t/p40.301821.100.001821.10198.001866.40
    92021.10.21 09:45buy50.301786.750.001795.85
    102021.10.22 15:19t/p50.301795.850.001795.85259.942126.34
    112022.09.05 04:45buy60.301711.770.001720.62
    122022.09.06 03:32t/p60.301720.620.001720.62252.442378.78
    132022.11.15 04:45buy70.301771.880.001780.91
    142022.11.15 09:46t/p70.301780.910.001780.91270.902649.68
    152022.11.30 10:00buy80.301755.500.001760.93
    162022.11.30 11:08t/p80.301760.930.001760.93162.902812.58
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester 3 - Short.gif b/Docs/Reports/Tests/X/StrategyTester 3 - Short.gif new file mode 100644 index 0000000000000000000000000000000000000000..e7e420b10d0ffb15a501e5da59d7ef84ae6a8a5b GIT binary patch literal 7740 zcmch6^;28V+jf8g!D&me;w>#MH6Tz*4K37LyhVxxm*TF05J+*CU`cQb?hXm=A-KDH zn}^T${U6>lduHyrZ13Ik!`YctQc;waF?d4O1y}(9h(sa)0Kj6gL`*LTet{g+2H0RXOPj7c%59!^{~0bOHo6O(HU^dEyUsRsahL7;l#H3ulh|1a017+|tY zyf(qF$>MABxBk*QwXZ_18{JF96hw0m0$d zqU-hj*U+`-znL-DDm?MJ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-_WlA%R~Oibv0`=UA)7^q5bUAA^H}uESK|+y ztNN7j;|Vig3qqB1zAE{SV6@>#@dBX?(mFJJSM>euGg8i%R&F&7GxTLbBB-4;a-6n@ zMqzX|%bJjywrcu`oA1{)u#D{M;YR>xDqOndN0zCH6DWz?-)u{zyEJ2}PIvO(irT3u z;k&_p72G2t0-8zFizhTB^>5$Wz1-|mDrT-4s)(~Ipn0+4WL>u;TIAXfojF1~*Kb)B kxzEzfp7l6492FFK?m}m;Hk=!;wu`)pG(SCWkOE}?4?}(SG5`Po literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/X/StrategyTester 3 - Short.htm b/Docs/Reports/Tests/X/StrategyTester 3 - Short.htm new file mode 100644 index 0000000..3d0b7dc --- /dev/null +++ b/Docs/Reports/Tests/X/StrategyTester 3 - Short.htm @@ -0,0 +1,130 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
    Bars in test61155Ticks modelled69617088Modelling quality40.15%
    Mismatched charts errors30
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit74.65Gross profit120.83Gross loss-46.18
    Profit factor2.62Expected payoff2.41
    Absolute drawdown14.66Maximal drawdown31.19 (3.07%)Relative drawdown3.07% (31.19)
    Total trades31Short positions (won %)31 (90.32%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)28 (90.32%)Loss trades (% of total)3 (9.68%)
    Largestprofit trade8.52loss trade-29.37
    Averageprofit trade4.32loss trade-15.39
    Maximumconsecutive wins (profit in money)14 (65.09)consecutive losses (loss in money)1 (-29.37)
    Maximalconsecutive profit (count of wins)65.09 (14)consecutive loss (count of losses)-29.37 (1)
    Averageconsecutive wins9consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.011884.040.001881.04
    22020.12.18 03:09t/p10.011881.040.001881.043.001003.00
    32021.01.21 02:45sell20.011869.150.001862.63
    42021.01.21 15:54t/p20.011862.630.001862.636.521009.52
    52021.03.09 22:15sell30.011716.740.001710.17
    62021.03.10 08:09t/p30.011710.170.001710.176.781016.30
    72021.04.01 03:45sell40.011706.320.001699.80
    82021.04.06 07:54close40.011736.320.001699.80-29.37986.93
    92021.04.15 21:15sell50.011767.210.001764.56
    102021.04.15 22:39t/p50.011764.560.001764.562.65989.58
    112021.06.03 23:15sell60.011870.990.001865.94
    122021.06.04 03:45sell70.011869.320.001862.92
    132021.06.04 04:49t/p60.011865.940.001865.945.26994.84
    142021.06.04 04:52t/p70.011862.920.001862.926.401001.24
    152021.06.17 08:00sell80.011821.330.001815.18
    162021.06.17 09:07t/p80.011815.180.001815.186.151007.39
    172021.06.18 08:45sell90.011784.490.001778.54
    182021.06.18 15:24t/p90.011778.540.001778.545.951013.34
    192021.11.23 05:30sell100.011808.910.001803.19
    202021.11.23 09:03t/p100.011803.190.001803.195.721019.06
    212021.12.15 04:45sell110.011771.980.001769.33
    222021.12.15 07:24t/p110.011769.330.001769.332.651021.71
    232022.02.14 13:30sell120.011855.860.001851.26
    242022.02.15 13:54t/p120.011851.260.001851.264.811026.52
    252022.03.14 08:45sell130.011975.330.001973.43
    262022.03.14 09:24t/p130.011973.430.001973.431.901028.42
    272022.03.16 05:15sell140.011919.680.001911.16
    282022.03.16 16:09t/p140.011911.160.001911.168.521036.94
    292022.05.17 05:00sell150.011826.120.001823.95
    302022.05.17 06:08t/p150.011823.950.001823.952.171039.11
    312022.07.06 01:05sell160.011766.830.001763.96
    322022.07.06 08:38t/p160.011763.960.001763.962.871041.98
    332022.07.07 01:45sell170.011738.940.001734.79
    342022.07.07 05:30sell180.011739.930.001734.46
    352022.07.08 10:43t/p170.011734.790.001734.794.361046.34
    362022.07.08 10:43t/p180.011734.460.001734.465.681052.02
    372022.08.08 22:30sell190.011787.280.001782.58
    382022.08.11 05:00close190.011788.480.001782.58-0.151051.87
    392022.10.10 23:00sell200.011668.780.001663.88
    402022.10.11 05:13t/p200.011663.880.001663.885.111056.98
    412022.11.09 07:30sell210.011708.410.001706.31
    422022.11.09 12:07t/p210.011706.310.001706.312.101059.08
    432022.11.15 15:00sell220.011775.140.001769.87
    442022.11.15 16:48t/p220.011769.870.001769.875.271064.35
    452023.01.09 07:30sell230.011876.700.001874.15
    462023.01.09 09:50t/p230.011874.150.001874.152.551066.90
    472023.02.02 09:00sell240.011951.910.001946.44
    482023.02.02 15:52t/p240.011946.440.001946.445.471072.37
    492023.02.03 05:45sell250.011916.370.001914.42
    502023.02.03 06:23t/p250.011914.420.001914.421.951074.32
    512023.03.31 07:15sell260.011981.510.001980.14
    522023.03.31 08:07t/p260.011980.140.001980.141.371075.69
    532023.04.04 02:00sell270.011983.600.001979.28
    542023.04.04 04:50t/p270.011979.280.001979.284.321080.01
    552023.04.05 01:45sell280.012020.810.002019.39
    562023.04.05 04:15sell290.012020.920.002016.45
    572023.04.05 17:11t/p280.012019.390.002019.391.421081.43
    582023.04.05 17:32t/p290.012016.450.002016.454.471085.90
    592023.05.02 21:45sell300.012014.740.002009.54
    602023.05.03 15:15t/p300.012009.540.002009.545.411091.31
    612023.05.08 01:45sell310.012014.730.002007.43
    622023.05.10 07:15close310.012031.810.002007.43-16.661074.65
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.gif b/Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.gif new file mode 100644 index 0000000000000000000000000000000000000000..0cd854187f05de99cb7e3ed4730d4a4ed3d79b3c GIT binary patch literal 7697 zcmch3_d6Tj`*%=;Sk+QRTccXL)m9N(t5#7RYPDKzV{f%f>_m*%V#X-3W5wQk?;=8N zVz1id>-~BDhv!`9T-SZQ*169)zZ?~{SCUd+pHXxImH_|~i39)udV70GxE?Ta4+nwZ zt{@x)jGO{oEfQ%83BH1GkSpa?2_Q{PfB{&*)dWxcKOJcg3H~1d=)ql);EAdK2>}2I z?#g;)247YG<&hu&z!i;yV8L}r(h>xGg&`r3D-8S}gM-uo06k!E9qEb#V5k0<3&8>) zOQb6k@`}V>kykyEkYMmt`jribgG^m@20`MkwnTz)Q&$BJIdzqKm0Wk_#PtBcJvcBD zc_q3!-+v8ViT>Leccq#lT{R53;s96(7y!OH_y7MPe0BSP|K0*XO@ab^{rm$0gJAGr zL`Y~@I5HwKDmo@ME*_PTn3SB7icU+<$o!p^jmgQ)%P%M_!WNg5mX+fwDyyn%YU}D7 z8k?G1THD$?I=i}idi(kZ2J^{AM#uh)PfX&c2-7ovXXoY@7MGS+R*7rt8=G6(JG*=P z2mcO_cCcirISZyS^H z&^+u4fOljR>4oWF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^o#y5)~T@&QyUR5jz7&8s$ApM+2LP^u3D8cDSad?{To^7QP(vCoYAC2uJZDfcWu zs#y=5D>ZKimn5z@%}q7t^lQI;>$-G*iFc%{ODAwRh1NBDTIRaC8~H)R!LyYINdW^| zMtP`Ies(ck9k$J(X)B|vf9`{6yuEH_#4+Uvb;Q$M(nlw^NdMr6 ze$*g0KxD?B&k1u^X{)mL{SNWZQM6>QMd3=A1V0hMic;Ol1|!U82gEmi37YaeXw0Pt zt4cDehDv>m$)LdE{Xf%cvro)ne6_g@+LIsl(_*r|E3>P5M@VV!gcXP{=9~@V-fO-W z^(ZPaFsgA8Jg-6&Mk^$aMR$)k){Dd^KNfbTI20Ujy8Mvlmu&fh8ZptCLQ96|6XIK@ z)$g`>Zz){kus_s%fT2T122r<23;Zj4`EOcoA&FnxVm;loM2hFzHhX4Qo literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.htm b/Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.htm new file mode 100644 index 0000000..cc169a5 --- /dev/null +++ b/Docs/Reports/Tests/X/StrategyTester 4 - Short Long 0.3 0.4.htm @@ -0,0 +1,162 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=2; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.4; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7;
    Bars in test61155Ticks modelled69617088Modelling quality40.15%
    Mismatched charts errors30
    Initial deposit1000.00SpreadCurrent (56)
    Total net profit4615.79Gross profit6210.29Gross loss-1594.49
    Profit factor3.89Expected payoff98.21
    Absolute drawdown199.80Maximal drawdown759.90 (18.60%)Relative drawdown34.47% (420.90)
    Total trades47Short positions (won %)33 (87.88%)Long positions (won %)14 (100.00%)
    Profit trades (% of total)43 (91.49%)Loss trades (% of total)4 (8.51%)
    Largestprofit trade270.90loss trade-400.20
    Averageprofit trade144.43loss trade-398.62
    Maximumconsecutive wins (profit in money)18 (2440.63)consecutive losses (loss in money)1 (-400.20)
    Maximalconsecutive profit (count of wins)2440.63 (18)consecutive loss (count of losses)-400.20 (1)
    Averageconsecutive wins11consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.301884.040.001881.04
    22020.12.18 03:10t/p10.301881.040.001881.0490.001090.00
    32021.01.06 02:00buy20.301950.760.001957.26
    42021.01.06 11:54t/p20.301957.260.001957.26195.001285.00
    52021.01.21 02:45sell30.301869.150.001862.63
    62021.01.21 15:54t/p30.301862.630.001862.63195.601480.60
    72021.03.09 22:15sell40.301716.740.001710.17
    82021.03.10 08:09t/p40.301710.170.001710.17203.411684.01
    92021.04.01 03:45sell50.301706.320.001699.80
    102021.04.01 10:24close50.301719.660.001699.80-400.201283.81
    112021.04.08 14:00buy60.301746.290.001754.74
    122021.04.08 16:36t/p60.301754.740.001754.74253.501537.31
    132021.04.15 21:15sell70.301767.210.001764.56
    142021.04.15 22:39t/p70.301764.560.001764.5679.501616.81
    152021.04.21 04:30buy80.301779.870.001787.20
    162021.04.21 09:51t/p80.301787.200.001787.20219.901836.71
    172021.05.04 23:15sell90.301779.150.001777.65
    182021.05.05 03:09t/p90.301777.650.001777.6551.311888.01
    192021.05.07 13:45sell100.301820.100.001817.98
    202021.05.07 15:07t/p100.301817.980.001817.9863.601951.61
    212021.06.03 23:15sell110.301870.990.001865.94
    222021.06.04 04:49t/p110.301865.940.001865.94157.812109.42
    232021.06.17 08:00sell120.301821.330.001815.18
    242021.06.17 09:07t/p120.301815.180.001815.18184.502293.92
    252021.06.18 08:45sell130.301784.490.001778.54
    262021.06.18 15:24t/p130.301778.540.001778.54178.502472.42
    272021.07.14 12:00buy140.301814.470.001821.07
    282021.07.14 15:05t/p140.301821.070.001821.07198.002670.42
    292021.08.26 13:45buy150.301787.220.001794.00
    302021.08.26 17:31t/p150.301794.000.001794.00203.402873.82
    312021.10.21 09:45buy160.301786.720.001795.82
    322021.10.22 15:19t/p160.301795.820.001795.82259.943133.76
    332021.11.23 05:30sell170.301808.910.001803.19
    342021.11.23 10:49t/p170.301803.190.001803.19171.603305.36
    352021.12.15 04:45sell180.301771.980.001769.33
    362021.12.15 07:24t/p180.301769.330.001769.3379.503384.86
    372022.02.09 11:30buy190.301827.840.001831.02
    382022.02.09 15:07t/p190.301831.020.001831.0295.403480.26
    392022.02.14 13:30sell200.301855.860.001851.26
    402022.02.14 17:18close200.301869.200.001851.26-400.203080.06
    412022.03.14 08:45sell210.301975.330.001973.43
    422022.03.14 09:24t/p210.301973.430.001973.4357.003137.06
    432022.03.16 05:15sell220.301919.680.001911.16
    442022.03.16 16:09t/p220.301911.160.001911.16255.603392.66
    452022.05.17 05:00sell230.301826.120.001823.95
    462022.05.17 06:08t/p230.301823.950.001823.9565.103457.76
    472022.06.24 05:00sell240.301823.760.001820.54
    482022.06.24 16:00t/p240.301820.540.001820.5496.603554.36
    492022.07.06 01:05sell250.301766.830.001763.96
    502022.07.06 08:38t/p250.301763.960.001763.9686.103640.46
    512022.07.07 01:45sell260.301738.940.001734.79
    522022.07.08 10:43t/p260.301734.790.001734.79130.813771.26
    532022.08.01 01:30buy270.301764.510.001771.11
    542022.08.01 12:53t/p270.301771.110.001771.11198.003969.26
    552022.08.08 22:30sell280.301787.280.001782.58
    562022.08.09 16:33close280.301800.620.001782.58-393.893575.37
    572022.08.22 14:15buy290.301735.850.001741.55
    582022.08.23 11:20t/p290.301741.550.001741.55157.943733.31
    592022.09.05 04:45buy300.301711.740.001720.59
    602022.09.06 03:32t/p300.301720.590.001720.59252.443985.74
    612022.10.10 23:00sell310.301668.780.001663.88
    622022.10.11 05:13t/p310.301663.880.001663.88153.314139.05
    632022.11.09 07:30sell320.301708.410.001706.31
    642022.11.09 12:07t/p320.301706.310.001706.3163.004202.05
    652022.11.15 04:45buy330.301771.850.001780.88
    662022.11.15 09:46t/p330.301780.880.001780.88270.904472.95
    672022.11.15 15:00sell340.301775.140.001769.87
    682022.11.15 16:48t/p340.301769.870.001769.87158.104631.05
    692022.11.21 23:45buy350.301738.480.001741.76
    702022.11.22 03:03t/p350.301741.760.001741.7685.344716.39
    712022.11.30 10:00buy360.301755.470.001760.90
    722022.11.30 11:08t/p360.301760.900.001760.90162.904879.29
    732023.01.09 07:30sell370.301876.700.001874.15
    742023.01.09 09:51t/p370.301874.150.001874.1576.504955.79
    752023.01.20 09:00buy380.301926.900.001935.08
    762023.01.20 10:07t/p380.301935.080.001935.08245.405201.19
    772023.02.02 09:00sell390.301951.910.001946.44
    782023.02.02 15:52t/p390.301946.440.001946.44164.105365.29
    792023.02.03 05:45sell400.301916.370.001914.42
    802023.02.03 06:23t/p400.301914.420.001914.4258.505423.79
    812023.03.21 07:45sell410.301981.970.001978.67
    822023.03.21 08:22t/p410.301978.670.001978.6799.005522.79
    832023.03.31 07:15sell420.301981.510.001980.14
    842023.03.31 08:08t/p420.301980.140.001980.1441.105563.89
    852023.04.04 02:00sell430.301983.600.001979.28
    862023.04.04 04:54t/p430.301979.280.001979.28129.605693.49
    872023.04.05 01:45sell440.302020.810.002019.39
    882023.04.05 17:11t/p440.302019.390.002019.3942.605736.09
    892023.04.14 07:30sell450.302044.780.002040.86
    902023.04.14 08:38t/p450.302040.860.002040.86117.605853.69
    912023.05.02 21:45sell460.302014.740.002009.54
    922023.05.03 15:15t/p460.302009.540.002009.54162.316015.99
    932023.05.08 01:45sell470.302014.730.002007.43
    942023.05.08 18:29close470.302028.070.002007.43-400.205615.79
    +
    diff --git a/Docs/Reports/Tests/X/StrategyTester Short 1.gif b/Docs/Reports/Tests/X/StrategyTester Short 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..5b29ecb257f844f7b60254a93014dce266ac6a35 GIT binary patch literal 8031 zcmc(@^;;Cq_ddLU!qVM>Aks*PfGjOYm#9bz@0Y{)?hXm*u7#yj8l-c- zyg$z$@ysJ0~|Uzo4+F7*SGMR$ftARb5kCSKrXs)ZEhA*51+i zyQ{mW_fKE{z~IpE$mrO3DaO?F%r{ z5#tGK59Oz|cJQ5++7{`DXSif+5v-;cWFdHQZwxv+MT1@u($g8jhqJMSh*POnSzA0| zLBx8xV_G8vcFYac>}&964Hqmk&il8Q)(~M9A|^6&DN}I~|Dh0hme}&v+tJ=4x-c4U zlgg~YM5G>#Kocos9Ex<}`1BZS+k&H+RQKT8h`71LJuDcrXfSwoFF>|vb^csY(Eyt& z*7!BP$)xeClX>bST)b_Cq>$O4U;@`d3z1n|j`wUbc-T6uuOL`O{5crhl_a|Oyb(HJ zTn>V_-#sW=JLj?KIswwruX~uVum#68gP5p>b#l>6`)lA7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wV!b7P!pbKA54s_2KupJmScOnD8(a-YV-DMA1S8FDhzh~pB(;faIHjPmv*pMTb4kW21&YU?Th2+n5IvU7-U;>hD(m}m4~|Bw}UZ4A_q(Uj>Fq{OUa z=c7{&F?#z8=ZHs6l2m!(@|v6)TW#lq?vL@{=B_MGaSJX*E4asYR~FIXbEW5w6LEo+ zLHF^TW|sr_d*Erx6K_rtvsiW5f^<%+L#L+Ck7;gie|VFHB|iu3S;4wV$eV+YX74?} z0B915@{tJUeh<6~s&^$HY@qs;ctiDBi&KP34BzIEm^Y#tSXtnYet8De+ zk9p2r$jwx6WFeFsA@HPUE_n)d-01)Gac6BxovVJZTJ!yq{br!qhvCz9V26oGQ1|#b zA$w8HejGZN5PJcO-ZH^?d#7FFJ6o1>Vuj`Yd7`eXwjd#)jMH(VZ=g$?BJ39rHxXps z)6=mg!{y`4AS}IAPsfJA3mnUQ{1;P1N#p}Fh@YP)46W1~=$&nC`Q_+mar!k=Ztp+p z`&Erfz>^y4Mi7o(L%pY|NzHe?qk19XdcP;@+dJg=+zR!-??hd-=NrHAi{9^5hLd-d zymMgFx%+;A_#BODtMq-?hoz7H6nCs&KWG7eSVM|>0DFLN1A^ZWuB$n zxGrLwE&HI~x?%Lky=*s+$5*E3;J-@_WHiTjC+1%f5Jut~3byS7e+lm)P7$3B!Ki=k z)~Z{?+)bH$0dLt2CO2$fpCx8qD*&|8p<2~$`Fwvu(&vXqe>Y#ne6y?c#cqxkX`vlW zq4~v$1u#{m@$4esBE&ip*HifRwmFij7S8gpEgz~AYrXu=o`l~*gN1Ig^!@qkG9IfG z{?wk>VFyG9t+|p_^K?CdP}v*Hy^njIbFD{p6@G*V#`s>y9^U$@=*R<8Zm;=ayZV|; Q!b1xcuZ4EtGl1Ct16Y7 + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit-16.50Gross profit42.85Gross loss-59.35
    Profit factor0.72Expected payoff-1.27
    Absolute drawdown20.26Maximal drawdown40.23 (3.94%)Relative drawdown3.94% (40.23)
    Total trades13Short positions (won %)13 (76.92%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)10 (76.92%)Loss trades (% of total)3 (23.08%)
    Largestprofit trade8.82loss trade-20.00
    Averageprofit trade4.28loss trade-19.78
    Maximumconsecutive wins (profit in money)4 (15.94)consecutive losses (loss in money)1 (-20.00)
    Maximalconsecutive profit (count of wins)15.94 (4)consecutive loss (count of losses)-20.00 (1)
    Averageconsecutive wins3consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.011884.040.001880.44
    22020.12.18 03:21t/p10.011880.440.001880.443.601003.60
    32021.05.04 23:15sell20.011779.150.001777.35
    42021.05.05 03:24t/p20.011777.350.001777.352.021005.62
    52021.06.18 08:45sell30.011784.490.001777.35
    62021.06.18 15:52t/p30.011777.350.001777.357.141012.76
    72021.12.15 04:45sell40.011771.980.001768.80
    82021.12.15 07:39t/p40.011768.800.001768.803.181015.94
    92022.02.14 13:30sell50.011855.860.001850.34
    102022.02.15 04:39close50.011875.860.001850.34-19.78996.16
    112022.03.14 08:45sell60.011975.330.001973.05
    122022.03.14 10:01t/p60.011973.050.001973.052.28998.44
    132022.05.17 11:30sell70.011827.110.001818.29
    142022.05.17 21:12t/p70.011818.290.001818.298.821007.26
    152022.06.24 05:00sell80.011823.760.001819.89
    162022.06.24 16:00t/p80.011819.890.001819.893.871011.13
    172022.08.08 22:30sell90.011787.280.001781.64
    182022.08.10 15:33close90.011807.290.001781.64-19.57991.56
    192022.11.15 15:00sell100.011775.140.001768.81
    202022.11.15 16:48t/p100.011768.810.001768.816.33997.89
    212023.03.21 07:45sell110.011981.970.001978.01
    222023.03.21 08:23t/p110.011978.010.001978.013.961001.85
    232023.03.31 07:15sell120.011981.510.001979.86
    242023.03.31 08:08t/p120.011979.860.001979.861.651003.50
    252023.07.07 04:30sell130.011911.150.001907.91
    262023.07.07 17:37close130.011931.150.001907.91-20.00983.50
    +
    diff --git a/Docs/Reports/Tests/XR/StrategyTester 1.gif b/Docs/Reports/Tests/XR/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf203aec1cf35642fdbd9208edd6257d3c226628 GIT binary patch literal 8424 zcmch6^;cBy_x&J9gS4aq(y1slNQePa0)jLm;z)OQGc(lCLnAp1HFS4(Bh1jQ76?EA?oZ(C|KnkgVZi?ZfWeykBybkJKQJl z9bsWW;Jp^`zZF<>?+*aL+`9q6YVO;>fHj!=;C^YouY}!$g8<;*J?p*??4EQ#(|;!J z^Zy|=7z_+Edmn-Ba{v?w2mpcr_qre$=6+bv{r&yu|DO+m`=<~1Z!Z7@SbsoZP;f|S z7#IQ#kBE$lhQ-9j#U~^t!IM)`)6z3CvwmggsPc-+s_L5By84F3 zrskH`w)T$BuI`@RzW#y1q2ZCyv0|Lbsp*;DvvX+7{KDeW^2+Mk`o`wg_Rj9!{=wm& zqrb-|r~l5*k5D+74{q)2@~UKPGD9>mtM623U)*8Np*e2? zSY@GF^s(!TVVoKn@$lFUrEtM-EmQPy`MqDnb9UzYD+@loWe|Q?{i;e+LrH;~Gok90 z=4VA5r_xxcIRHoHAt`tOx(f(=OF+d#u`a5w_nw5F6v)qO!&zpH zzdkw4sU&}L#MwowvC;y*)>Pe~l*c2Y;)>uj`$rW*94Bbl)+QOmPR7J&lri)RSM*T| z-7;sRCoJfZzTT+jaK9~EZ3XvA243yIXVXr5S7%lbv1jD0RMfI&uf_cbLq0rb{895-L%f?8RP&an z4;2*+@#$hsI7mz z^hksvbiqVCq$0*1G)--D_>64;xoD0qR$Tm-W9mVybVIs1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B8q5nTKWHeO$Q(uwHiOo@q9<5*{1(p7wC$r}}Kl1uiKs9&*WCe#murTZDx^zEZi5AYc|g^6#8fvAPG+sY zG6T5yOzWuHZJ}A2GJ{wxbEPf*suB0QId-*-#2$k0`%&ObBu6R3VeKmkW=$5eFA&D`TiIw#m2Uh3rpwnlf zbrREiHUSt&S2i6DBq1`x(!dapw3cD%V*=lH7csfN3Ej0;F;{6^`mSjb%`#`SC9^*C z*wVGpyL%)99uGZ%K5j-xl(FtJEfKU;6Kj|V@*a`!{&8Jx0@2!Yqex7&#w?0&jo!QW zOhON7Bxp&+{5^SxmcDD#ciz%Ia(tt)ayXON45+i`t+E3D6-nxPG9n0he-rVs`&?s= z(}ACgSpVwoTtlQ(I5Jx5dl!1Pcm0>khH2BUG?Bg-GXC>crp}7T)BS8Q4A3E7-%YAb=mcH@dQfn z=BLb~)e#`*Lta+u=KSiEZV8WIOiAO0=6*6R=TTwq(~U15Wc4Wm?tdygN+(vj)|#rn zeTC{`-c@o!x1~_H7*nUulfO=!0;?t9s{5GgIdOkN4gYgBE?NFudD)x0JyJquVr>}2 zKG(Ndoy6O2tw1dfh&X%c^w_63wWDErwrA4GN!5mAbY@~$*O3=kLhSrFwFuMFRX9`v zVx07xEZTI0L>unTwn^0^XRKST40f=;z3G-^svTR1e%Y!%w^%IH^{4*w@+kBfV2X<1 zRS_GT{jBcwAjKm9T?Ie`?f80K)80InVE!*&JhSG(m%3OnHK+*p4VA8_$DoCbgX`Px zEx()H%YA$yM6xMc(V&aGbLTPD(KM_b7Yw6MyhbJ zDd$tFK?NCuvgq4=E5GacKP~62kM54b{chHUTQ5hW?@o*SZujk4ua~|; + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.xr.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.03; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
    Bars in test62709Ticks modelled71719330Modelling qualityn/a
    Mismatched charts errors777
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit64.36Gross profit198.76Gross loss-134.40
    Profit factor1.48Expected payoff1.11
    Absolute drawdown9.15Maximal drawdown38.61 (3.57%)Relative drawdown3.57% (38.61)
    Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
    Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
    Largestprofit trade14.58loss trade-15.38
    Averageprofit trade5.85loss trade-5.60
    Maximumconsecutive wins (profit in money)4 (23.01)consecutive losses (loss in money)3 (-26.09)
    Maximalconsecutive profit (count of wins)23.01 (4)consecutive loss (count of losses)-26.09 (3)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.011841.440.001845.90
    22020.12.04 15:31t/p10.011845.900.001845.904.021004.02
    32020.12.08 18:30buy20.011870.350.001886.13
    42020.12.09 05:19close20.011864.070.001886.13-6.72997.31
    52020.12.30 03:45buy30.011883.290.001893.75
    62020.12.30 10:00close30.011878.490.001893.75-4.80992.51
    72020.12.30 18:00buy40.011885.860.001895.62
    82020.12.31 02:15t/p40.011895.620.001895.628.451000.96
    92021.01.05 11:30buy50.011944.710.001954.49
    102021.01.06 03:09t/p50.011954.490.001954.499.341010.31
    112021.04.05 17:30buy60.011729.420.001742.62
    122021.04.05 22:00close60.011725.680.001742.62-3.741006.57
    132021.04.19 06:15buy70.011778.720.001785.24
    142021.04.19 07:15close70.011776.750.001785.24-1.971004.60
    152021.04.26 21:00buy80.011780.010.001781.77
    162021.04.26 23:39t/p80.011781.770.001781.771.761006.36
    172021.05.18 23:45buy90.011870.210.001872.99
    182021.05.19 05:00close90.011867.630.001872.99-3.021003.34
    192021.05.20 08:15buy100.011876.090.001877.07
    202021.05.20 08:30t/p100.011877.070.001877.070.981004.32
    212021.05.21 11:30buy110.011876.530.001882.65
    222021.05.21 15:21t/p110.011882.650.001882.656.121010.44
    232021.05.24 19:15buy120.011884.010.001887.27
    242021.05.25 01:15close120.011880.910.001887.27-3.541006.91
    252021.05.25 10:45buy130.011884.160.001898.74
    262021.05.25 21:06t/p130.011898.740.001898.7414.581021.49
    272021.06.28 20:30buy140.011780.510.001785.35
    282021.06.28 21:15close140.011778.020.001785.35-2.491019.00
    292021.07.06 04:15buy150.011792.940.001796.10
    302021.07.06 04:53t/p150.011796.100.001796.103.161022.16
    312021.07.09 17:45buy160.011806.390.001814.91
    322021.07.12 07:16close160.011801.870.001814.91-4.961017.20
    332021.07.12 19:30buy170.011805.330.001808.45
    342021.07.13 04:34t/p170.011808.450.001808.452.681019.89
    352021.08.12 23:00buy180.011753.790.001757.21
    362021.08.13 09:09t/p180.011757.210.001757.212.981022.87
    372021.09.01 22:30buy190.011815.330.001820.69
    382021.09.02 02:45close190.011813.220.001820.69-3.421019.45
    392021.09.03 05:15buy200.011813.490.001819.35
    402021.09.03 15:34t/p200.011819.350.001819.355.861025.31
    412021.09.29 06:00buy210.011740.530.001751.43
    422021.09.29 16:24close210.011736.210.001751.43-4.321020.99
    432021.11.16 04:45buy220.011867.860.001877.40
    442021.11.16 09:45close220.011863.300.001877.40-4.561016.43
    452021.12.07 04:30buy230.011781.010.001785.23
    462021.12.07 05:45close230.011778.500.001785.23-2.511013.92
    472021.12.07 20:30buy240.011784.430.001788.51
    482021.12.08 04:07t/p240.011788.510.001788.513.641017.57
    492021.12.28 08:15buy250.011813.150.001819.37
    502021.12.28 15:37t/p250.011819.370.001819.376.221023.79
    512022.01.10 21:30buy260.011801.220.001805.98
    522022.01.11 04:24t/p260.011805.980.001805.984.321028.11
    532022.01.19 11:15buy270.011816.130.001824.95
    542022.01.19 15:54t/p270.011824.950.001824.958.821036.93
    552022.01.24 23:15buy280.011843.380.001853.74
    562022.01.25 11:04close280.011838.270.001853.74-5.551031.39
    572022.01.31 11:30buy290.011791.280.001798.92
    582022.01.31 16:39t/p290.011798.920.001798.927.641039.03
    592022.02.16 09:30buy300.011856.110.001860.85
    602022.02.16 15:00close300.011852.740.001860.85-3.371035.66
    612022.03.03 22:15buy310.011937.410.001946.73
    622022.03.04 02:36t/p310.011946.730.001946.738.881044.54
    632022.03.04 13:00buy320.011947.630.001961.75
    642022.03.04 18:09t/p320.011961.750.001961.7514.121058.66
    652022.03.11 21:30buy330.011986.950.001999.25
    662022.03.14 00:45close330.011972.860.001999.25-14.531044.14
    672022.03.24 13:30buy340.011946.500.001957.42
    682022.03.24 14:03t/p340.011957.420.001957.4210.921055.06
    692022.04.05 16:15buy350.011935.270.001956.63
    702022.04.05 18:45close350.011925.680.001956.63-9.591045.47
    712022.04.13 08:30buy360.011969.860.001973.40
    722022.04.13 11:19t/p360.011973.400.001973.403.541049.01
    732022.05.20 09:45buy370.011848.340.001859.62
    742022.05.20 16:30close370.011840.610.001859.62-7.731041.28
    752022.05.23 01:15buy380.011845.310.001848.55
    762022.05.23 02:07t/p380.011848.550.001848.553.241044.52
    772022.06.08 15:15buy390.011851.320.001858.82
    782022.06.08 18:07t/p390.011858.820.001858.827.501052.02
    792022.07.05 02:15buy400.011810.010.001814.79
    802022.07.05 10:30close400.011806.730.001814.79-3.281048.74
    812022.10.26 07:45buy410.011656.860.001658.96
    822022.10.26 08:41t/p410.011658.960.001658.962.101050.84
    832022.10.27 08:45buy420.011669.970.001683.09
    842022.10.27 09:45close420.011661.850.001683.09-8.121042.72
    852022.11.02 04:00buy430.011650.460.001653.36
    862022.11.02 10:00t/p430.011653.360.001653.362.901045.62
    872022.11.14 17:45buy440.011770.180.001784.24
    882022.11.15 08:45close440.011769.440.001784.24-1.181044.44
    892022.11.30 05:45buy450.011754.150.001759.19
    902022.11.30 10:57t/p450.011759.190.001759.195.041049.48
    912023.01.11 06:30buy460.011877.620.001882.84
    922023.01.11 07:37t/p460.011882.840.001882.845.221054.70
    932023.02.09 05:00buy470.011879.530.001889.99
    942023.02.09 16:01t/p470.011889.990.001889.9910.461065.16
    952023.02.16 21:30buy480.011843.520.001847.54
    962023.02.17 01:15close480.011835.010.001847.54-8.951056.22
    972023.02.22 05:15buy490.011837.180.001840.68
    982023.02.22 10:03t/p490.011840.680.001840.683.501059.72
    992023.03.28 17:00buy500.011963.690.001968.77
    1002023.03.28 17:57t/p500.011968.770.001968.775.081064.80
    1012023.03.30 10:45buy510.011969.560.001976.42
    1022023.03.30 19:01t/p510.011976.420.001976.426.861071.66
    1032023.04.26 13:30buy520.012000.140.002005.44
    1042023.04.26 16:24t/p520.012005.440.002005.445.301076.96
    1052023.04.27 06:00buy530.011999.160.002014.50
    1062023.04.27 15:45close530.011983.780.002014.50-15.381061.58
    1072023.05.15 19:45buy540.012020.300.002031.78
    1082023.05.15 22:00close540.012014.590.002031.78-5.711055.87
    1092023.06.09 17:30buy550.011967.630.001988.83
    1102023.06.09 18:30close550.011962.630.001988.83-5.001050.87
    1112023.06.13 03:15buy560.011961.000.001966.36
    1122023.06.13 15:30t/p560.011966.360.001966.365.361056.23
    1132023.07.12 03:45buy570.011936.100.001941.76
    1142023.07.12 15:30t/p570.011941.760.001941.765.661061.89
    1152023.07.19 23:00buy580.011978.780.001982.56
    1162023.07.20 04:30t/p580.011982.560.001982.562.471064.36
    +
    diff --git a/Docs/Reports/Tests/XR/StrategyTester 2.gif b/Docs/Reports/Tests/XR/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..e8b04beda0fc707b326f389f08422f93b412c3a3 GIT binary patch literal 8400 zcmch5^;;C&^Y+rq(g;dOD&0!RBB7#EOB!@Zx1zw(&9ZcN!_p{u5;#^>z;e=nK|dT^HKi8D{&)XoL;~d0D!?@006+?;2;J$0FL~NG&4g!Ku9xi zBpUE=Fc@?s_yIziJun|!00un^22=nZHhA{`@i2cQ!T$pQ1IULUcozLXA^>29d`Nvr zet?i>72u{w%%&OmK{L_}Y1Z^04FC*)!A+P46i|WwpNd%pz-$xqK#y#CsPGVc=m--D z20v(l|FdA^Lw^7O`k@=MNaRDANH7xp;5?Y7hs?+aZ~y=vcwjx$iF_bE%=BLq5ApvH zBpMxwo_+Al9%6us2dM{9Gw^?NJ`8L2;604~|9SB~+&$7iZXP1Pps=X8q_nKOqVjiDbq%r>Raf88*woz8 z+ScCD+11_C+t)uZI5a#mT7oq(IW;{qJ2#JBSX^3OSzTM-*xcIQ+1=YeI6OK&`SbVm z-`V-aNd;C0_U(Q89pHYSDsn|e8IOW-AvSXLErf(cYLF^wO;(9o=pKCm&w1m+EDire z6TKl9#HN-Wn;5;R5W;8FJV_IS==ma+v%An&m9O%SRsgR?xLRFJ;UfoIT(z*eh8&h- zSv1@NfTe^-4C{yQ0es&PP;!!Qh-hoQC!!$+^KjX+mD^z0y6{?^j^@h|bhxTFr$;$e zq>LwQoz!Zp&9EDF$R@>GTtZ6rP&Sh@$^cLdpKfcbxF0JCJ)K_qU>1%DS@Po*wg%To zKQe8t5%r-yJC@qt9INTLwP(+!9QUu!t%F6Mkup<0k~VoQ<~351}nj|lkTp#Pd#O9Q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uIfRz_xNKHNnxSXmq{S~LjML*qXJY5oEYr{$E zHW=lUT@lYsMdLErr}bynQ~1UoDif2zTUg3Nta}n4@e*)L4kH9E>CBikqa6 zDbFC!KNHZ+ck4TSiCZLQ&cGhZTM_;3Q}3;-(XKTAMIcj?!Bl~sPE`r{4>53PHyo|q z5q7`#ZP#|%3FEYsw}f;WZL-C1=$J4urBDIUSFm5d16y(({>Z6)ilsc{;<;P*k4r~cBP%-p!|lD`(3! z`UT@bPx=fFCETNQ7kYz4&d%z|JhI#jZYEW*|J7v_{fUUU-Qe-M8nkad%^ + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.xr.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test62709Ticks modelled71719330Modelling qualityn/a
    Mismatched charts errors777
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit1287.21Gross profit3975.20Gross loss-2687.99
    Profit factor1.48Expected payoff22.19
    Absolute drawdown183.02Maximal drawdown772.20 (29.49%)Relative drawdown29.49% (772.20)
    Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
    Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
    Largestprofit trade291.60loss trade-307.60
    Averageprofit trade116.92loss trade-112.00
    Maximumconsecutive wins (profit in money)4 (460.18)consecutive losses (loss in money)3 (-521.80)
    Maximalconsecutive profit (count of wins)460.18 (4)consecutive loss (count of losses)-521.80 (3)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.201841.440.001845.90
    22020.12.04 15:31t/p10.201845.900.001845.9080.491080.49
    32020.12.08 18:30buy20.201870.350.001886.13
    42020.12.09 05:19close20.201864.070.001886.13-134.31946.18
    52020.12.30 03:45buy30.201883.290.001893.75
    62020.12.30 10:00close30.201878.490.001893.75-96.00850.18
    72020.12.30 18:00buy40.201885.860.001895.62
    82020.12.31 02:15t/p40.201895.620.001895.62169.081019.26
    92021.01.05 11:30buy50.201944.710.001954.49
    102021.01.06 03:09t/p50.201954.490.001954.49186.891206.15
    112021.04.05 17:30buy60.201729.420.001742.62
    122021.04.05 22:00close60.201725.680.001742.62-74.801131.35
    132021.04.19 06:15buy70.201778.720.001785.24
    142021.04.19 07:15close70.201776.750.001785.24-39.401091.95
    152021.04.26 21:00buy80.201780.010.001781.77
    162021.04.26 23:39t/p80.201781.770.001781.7735.201127.15
    172021.05.18 23:45buy90.201870.210.001872.99
    182021.05.19 05:00close90.201867.630.001872.99-60.311066.84
    192021.05.20 08:15buy100.201876.090.001877.07
    202021.05.20 08:30t/p100.201877.070.001877.0719.601086.44
    212021.05.21 11:30buy110.201876.530.001882.65
    222021.05.21 15:21t/p110.201882.650.001882.65122.401208.84
    232021.05.24 19:15buy120.201884.010.001887.27
    242021.05.25 01:15close120.201880.910.001887.27-70.711138.14
    252021.05.25 10:45buy130.201884.160.001898.74
    262021.05.25 21:06t/p130.201898.740.001898.74291.601429.74
    272021.06.28 20:30buy140.201780.510.001785.35
    282021.06.28 21:15close140.201778.020.001785.35-49.801379.94
    292021.07.06 04:15buy150.201792.940.001796.10
    302021.07.06 04:53t/p150.201796.100.001796.1063.201443.14
    312021.07.09 17:45buy160.201806.390.001814.91
    322021.07.12 07:16close160.201801.870.001814.91-99.111344.03
    332021.07.12 19:30buy170.201805.330.001808.45
    342021.07.13 04:34t/p170.201808.450.001808.4553.691397.72
    352021.08.12 23:00buy180.201753.790.001757.21
    362021.08.13 09:09t/p180.201757.210.001757.2159.691457.41
    372021.09.01 22:30buy190.201815.330.001820.69
    382021.09.02 02:45close190.201813.220.001820.69-68.321389.09
    392021.09.03 05:15buy200.201813.490.001819.35
    402021.09.03 15:34t/p200.201819.350.001819.35117.201506.29
    412021.09.29 06:00buy210.201740.530.001751.43
    422021.09.29 16:24close210.201736.210.001751.43-86.401419.89
    432021.11.16 04:45buy220.201867.860.001877.40
    442021.11.16 09:45close220.201863.300.001877.40-91.201328.69
    452021.12.07 04:30buy230.201781.010.001785.23
    462021.12.07 05:45close230.201778.500.001785.23-50.201278.49
    472021.12.07 20:30buy240.201784.430.001788.51
    482021.12.08 04:07t/p240.201788.510.001788.5172.891351.38
    492021.12.28 08:15buy250.201813.150.001819.37
    502021.12.28 15:37t/p250.201819.370.001819.37124.401475.78
    512022.01.10 21:30buy260.201801.220.001805.98
    522022.01.11 04:24t/p260.201805.980.001805.9886.491562.27
    532022.01.19 11:15buy270.201816.130.001824.95
    542022.01.19 15:54t/p270.201824.950.001824.95176.401738.67
    552022.01.24 23:15buy280.201843.380.001853.74
    562022.01.25 11:04close280.201838.270.001853.74-110.911627.76
    572022.01.31 11:30buy290.201791.280.001798.92
    582022.01.31 16:39t/p290.201798.920.001798.92152.801780.56
    592022.02.16 09:30buy300.201856.110.001860.85
    602022.02.16 15:00close300.201852.740.001860.85-67.401713.16
    612022.03.03 22:15buy310.201937.410.001946.73
    622022.03.04 02:36t/p310.201946.730.001946.73177.691890.86
    632022.03.04 13:00buy320.201947.630.001961.75
    642022.03.04 18:09t/p320.201961.750.001961.75282.402173.26
    652022.03.11 21:30buy330.201986.950.001999.25
    662022.03.14 00:45close330.201972.860.001999.25-290.511882.75
    672022.03.24 13:30buy340.201946.500.001957.42
    682022.03.24 14:03t/p340.201957.420.001957.42218.402101.15
    692022.04.05 16:15buy350.201935.270.001956.63
    702022.04.05 18:45close350.201925.680.001956.63-191.801909.35
    712022.04.13 08:30buy360.201969.860.001973.40
    722022.04.13 11:19t/p360.201973.400.001973.4070.801980.15
    732022.05.20 09:45buy370.201848.340.001859.62
    742022.05.20 16:30close370.201840.610.001859.62-154.601825.55
    752022.05.23 01:15buy380.201845.310.001848.55
    762022.05.23 02:07t/p380.201848.550.001848.5564.801890.35
    772022.06.08 15:15buy390.201851.320.001858.82
    782022.06.08 18:07t/p390.201858.820.001858.82150.002040.35
    792022.07.05 02:15buy400.201810.010.001814.79
    802022.07.05 10:30close400.201806.730.001814.79-65.601974.75
    812022.10.26 07:45buy410.201656.860.001658.96
    822022.10.26 08:41t/p410.201658.960.001658.9642.002016.75
    832022.10.27 08:45buy420.201669.970.001683.09
    842022.10.27 09:45close420.201661.850.001683.09-162.401854.35
    852022.11.02 04:00buy430.201650.460.001653.36
    862022.11.02 10:00t/p430.201653.360.001653.3658.001912.35
    872022.11.14 17:45buy440.201770.180.001784.24
    882022.11.15 08:45close440.201769.440.001784.24-23.511888.84
    892022.11.30 05:45buy450.201754.150.001759.19
    902022.11.30 10:57t/p450.201759.190.001759.19100.801989.64
    912023.01.11 06:30buy460.201877.620.001882.84
    922023.01.11 07:37t/p460.201882.840.001882.84104.402094.04
    932023.02.09 05:00buy470.201879.530.001889.99
    942023.02.09 16:01t/p470.201889.990.001889.99209.202303.24
    952023.02.16 21:30buy480.201843.520.001847.54
    962023.02.17 01:15close480.201835.010.001847.54-178.912124.33
    972023.02.22 05:15buy490.201837.180.001840.68
    982023.02.22 10:03t/p490.201840.680.001840.6870.002194.33
    992023.03.28 17:00buy500.201963.690.001968.77
    1002023.03.28 17:57t/p500.201968.770.001968.77101.602295.93
    1012023.03.30 10:45buy510.201969.560.001976.42
    1022023.03.30 19:01t/p510.201976.420.001976.42137.202433.13
    1032023.04.26 13:30buy520.202000.140.002005.44
    1042023.04.26 16:24t/p520.202005.440.002005.44106.002539.13
    1052023.04.27 06:00buy530.201999.160.002014.50
    1062023.04.27 15:45close530.201983.780.002014.50-307.602231.53
    1072023.05.15 19:45buy540.202020.300.002031.78
    1082023.05.15 22:00close540.202014.590.002031.78-114.202117.33
    1092023.06.09 17:30buy550.201967.630.001988.83
    1102023.06.09 18:30close550.201962.630.001988.83-100.002017.33
    1112023.06.13 03:15buy560.201961.000.001966.36
    1122023.06.13 15:30t/p560.201966.360.001966.36107.202124.53
    1132023.07.12 03:45buy570.201936.100.001941.76
    1142023.07.12 15:30t/p570.201941.760.001941.76113.202237.73
    1152023.07.19 23:00buy580.201978.780.001982.56
    1162023.07.20 04:30t/p580.201982.560.001982.5649.482287.21
    +
    diff --git a/Docs/Reports/Tests/XR/StrategyTester 3.gif b/Docs/Reports/Tests/XR/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..b615ee31627ecae9d03966daf1da6d4df378fe16 GIT binary patch literal 8417 zcmch5^8{b;rAWs< zyx!mc;d>wVp2vAS&+|ObIrsi{6_wveNPc=w&<)rC0B|@Q008Lk@5j~lL6CoIEi7v9 zpjrzEau#rRaJX3{CfwbW6PylB3e<~IjfW* z>j;O0K<>04|5-@wU4H<;>|Hk&$lALyNJ#DMopWbe?lO^gU>^X|cgMP`gS;c%&GcUr zck%y_+Sys;?DU;yaTfz%?xgNSEg=8Rc{i-Zop(3-|L4Vfcl&_<-U2{`g8~ABfX zU~oiuL}XMnGA1@IJ|Qs)m7J2AmY$KBm7SBDmtRm=R9sS8hAywbRDQ3juBol7Z)j|4 zZfR|6|MBxzM`zdX?w;Ph{(-@v;WE6j@rlW)Y3$7G-2B4g((=mc+WN-k*7nZs-u}Vi z(VxG^|4vTNjxczc_}8}?H-Ot+TIAA8jr&xO=i-seuhhv{U-Z+)tSG3_3Ej?~A#&vc zSY#3J8DrO!!q~Jj;!&~dD&c&eTE`jV3VweO&)uHusVaOc|3Kh=>w)Efqx$wuI{E z+V7O`T*_k+RscM;`=qd5#10@(o`{;0a!u4g|1}9CDTIg1o~^eW3EHG2e``3ZFhaU7pfd%I-N6EY^SaYlbOfha`^ z{SsS~7cz*#Kz~SkpvQr=?mNeF#=W|erxPx_m#4O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QQ3)wFxH!vvR&A!CmD;=)xQaGT zBQRDidVCpXT7Dp@E=_f0;@B={{I8JW=cM*q(I585I+-~3os?Lqyg8Cj+82IPlp!UxXD|Vo_Z-nvWBGs~cRXiL2?uG{(3S*; z1+R#N|9d07a73)}t(cJiJm3k-QF12f8i{OjHG2~k^0#z@Xj^`oqS=wtr1Vz)j2r6h zBswYa#^~J;sGR%FixxZa6U2zm+oN#*>otM4i=pV-f2F4C0RVv1{{aq>Dw_ZR literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XR/StrategyTester 3.htm b/Docs/Reports/Tests/XR/StrategyTester 3.htm new file mode 100644 index 0000000..d2417ad --- /dev/null +++ b/Docs/Reports/Tests/XR/StrategyTester 3.htm @@ -0,0 +1,183 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.xr.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
    Bars in test62709Ticks modelled71719330Modelling qualityn/a
    Mismatched charts errors777
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit1930.81Gross profit5962.79Gross loss-4031.98
    Profit factor1.48Expected payoff33.29
    Absolute drawdown274.52Maximal drawdown1158.30 (33.79%)Relative drawdown39.80% (479.56)
    Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
    Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
    Largestprofit trade437.40loss trade-461.40
    Averageprofit trade175.38loss trade-168.00
    Maximumconsecutive wins (profit in money)4 (690.28)consecutive losses (loss in money)3 (-782.70)
    Maximalconsecutive profit (count of wins)690.28 (4)consecutive loss (count of losses)-782.70 (3)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.301841.440.001845.90
    22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
    32020.12.08 18:30buy20.301870.350.001886.13
    42020.12.09 05:19close20.301864.070.001886.13-201.46919.28
    52020.12.30 03:45buy30.301883.290.001893.75
    62020.12.30 10:00close30.301878.490.001893.75-144.00775.28
    72020.12.30 18:00buy40.301885.860.001895.62
    82020.12.31 02:15t/p40.301895.620.001895.62253.611028.89
    92021.01.05 11:30buy50.301944.710.001954.49
    102021.01.06 03:09t/p50.301954.490.001954.49280.341309.23
    112021.04.05 17:30buy60.301729.420.001742.62
    122021.04.05 22:00close60.301725.680.001742.62-112.201197.03
    132021.04.19 06:15buy70.301778.720.001785.24
    142021.04.19 07:15close70.301776.750.001785.24-59.101137.93
    152021.04.26 21:00buy80.301780.010.001781.77
    162021.04.26 23:39t/p80.301781.770.001781.7752.801190.73
    172021.05.18 23:45buy90.301870.210.001872.99
    182021.05.19 05:00close90.301867.630.001872.99-90.461100.27
    192021.05.20 08:15buy100.301876.090.001877.07
    202021.05.20 08:30t/p100.301877.070.001877.0729.401129.67
    212021.05.21 11:30buy110.301876.530.001882.65
    222021.05.21 15:21t/p110.301882.650.001882.65183.601313.27
    232021.05.24 19:15buy120.301884.010.001887.27
    242021.05.25 01:15close120.301880.910.001887.27-106.061207.20
    252021.05.25 10:45buy130.301884.160.001898.74
    262021.05.25 21:06t/p130.301898.740.001898.74437.401644.60
    272021.06.28 20:30buy140.301780.510.001785.35
    282021.06.28 21:15close140.301778.020.001785.35-74.701569.90
    292021.07.06 04:15buy150.301792.940.001796.10
    302021.07.06 04:53t/p150.301796.100.001796.1094.801664.70
    312021.07.09 17:45buy160.301806.390.001814.91
    322021.07.12 07:16close160.301801.870.001814.91-148.661516.04
    332021.07.12 19:30buy170.301805.330.001808.45
    342021.07.13 04:34t/p170.301808.450.001808.4580.541596.58
    352021.08.12 23:00buy180.301753.790.001757.21
    362021.08.13 09:09t/p180.301757.210.001757.2189.541686.12
    372021.09.01 22:30buy190.301815.330.001820.69
    382021.09.02 02:45close190.301813.220.001820.69-102.491583.63
    392021.09.03 05:15buy200.301813.490.001819.35
    402021.09.03 15:34t/p200.301819.350.001819.35175.801759.43
    412021.09.29 06:00buy210.301740.530.001751.43
    422021.09.29 16:24close210.301736.210.001751.43-129.601629.83
    432021.11.16 04:45buy220.301867.860.001877.40
    442021.11.16 09:45close220.301863.300.001877.40-136.801493.03
    452021.12.07 04:30buy230.301781.010.001785.23
    462021.12.07 05:45close230.301778.500.001785.23-75.301417.73
    472021.12.07 20:30buy240.301784.430.001788.51
    482021.12.08 04:07t/p240.301788.510.001788.51109.341527.07
    492021.12.28 08:15buy250.301813.150.001819.37
    502021.12.28 15:37t/p250.301819.370.001819.37186.601713.67
    512022.01.10 21:30buy260.301801.220.001805.98
    522022.01.11 04:24t/p260.301805.980.001805.98129.741843.41
    532022.01.19 11:15buy270.301816.130.001824.95
    542022.01.19 15:54t/p270.301824.950.001824.95264.602108.01
    552022.01.24 23:15buy280.301843.380.001853.74
    562022.01.25 11:04close280.301838.270.001853.74-166.361941.65
    572022.01.31 11:30buy290.301791.280.001798.92
    582022.01.31 16:39t/p290.301798.920.001798.92229.202170.85
    592022.02.16 09:30buy300.301856.110.001860.85
    602022.02.16 15:00close300.301852.740.001860.85-101.102069.75
    612022.03.03 22:15buy310.301937.410.001946.73
    622022.03.04 02:36t/p310.301946.730.001946.73266.542336.28
    632022.03.04 13:00buy320.301947.630.001961.75
    642022.03.04 18:09t/p320.301961.750.001961.75423.602759.88
    652022.03.11 21:30buy330.301986.950.001999.25
    662022.03.14 00:45close330.301972.860.001999.25-435.762324.12
    672022.03.24 13:30buy340.301946.500.001957.42
    682022.03.24 14:03t/p340.301957.420.001957.42327.602651.72
    692022.04.05 16:15buy350.301935.270.001956.63
    702022.04.05 18:45close350.301925.680.001956.63-287.702364.02
    712022.04.13 08:30buy360.301969.860.001973.40
    722022.04.13 11:19t/p360.301973.400.001973.40106.202470.22
    732022.05.20 09:45buy370.301848.340.001859.62
    742022.05.20 16:30close370.301840.610.001859.62-231.902238.32
    752022.05.23 01:15buy380.301845.310.001848.55
    762022.05.23 02:07t/p380.301848.550.001848.5597.202335.52
    772022.06.08 15:15buy390.301851.320.001858.82
    782022.06.08 18:07t/p390.301858.820.001858.82225.002560.52
    792022.07.05 02:15buy400.301810.010.001814.79
    802022.07.05 10:30close400.301806.730.001814.79-98.402462.12
    812022.10.26 07:45buy410.301656.860.001658.96
    822022.10.26 08:41t/p410.301658.960.001658.9663.002525.12
    832022.10.27 08:45buy420.301669.970.001683.09
    842022.10.27 09:45close420.301661.850.001683.09-243.602281.52
    852022.11.02 04:00buy430.301650.460.001653.36
    862022.11.02 10:00t/p430.301653.360.001653.3687.002368.52
    872022.11.14 17:45buy440.301770.180.001784.24
    882022.11.15 08:45close440.301769.440.001784.24-35.262333.26
    892022.11.30 05:45buy450.301754.150.001759.19
    902022.11.30 10:57t/p450.301759.190.001759.19151.202484.46
    912023.01.11 06:30buy460.301877.620.001882.84
    922023.01.11 07:37t/p460.301882.840.001882.84156.602641.06
    932023.02.09 05:00buy470.301879.530.001889.99
    942023.02.09 16:01t/p470.301889.990.001889.99313.802954.86
    952023.02.16 21:30buy480.301843.520.001847.54
    962023.02.17 01:15close480.301835.010.001847.54-268.362686.50
    972023.02.22 05:15buy490.301837.180.001840.68
    982023.02.22 10:03t/p490.301840.680.001840.68105.002791.50
    992023.03.28 17:00buy500.301963.690.001968.77
    1002023.03.28 17:57t/p500.301968.770.001968.77152.402943.90
    1012023.03.30 10:45buy510.301969.560.001976.42
    1022023.03.30 19:01t/p510.301976.420.001976.42205.803149.70
    1032023.04.26 13:30buy520.302000.140.002005.44
    1042023.04.26 16:24t/p520.302005.440.002005.44159.003308.70
    1052023.04.27 06:00buy530.301999.160.002014.50
    1062023.04.27 15:45close530.301983.780.002014.50-461.402847.30
    1072023.05.15 19:45buy540.302020.300.002031.78
    1082023.05.15 22:00close540.302014.590.002031.78-171.302676.00
    1092023.06.09 17:30buy550.301967.630.001988.83
    1102023.06.09 18:30close550.301962.630.001988.83-150.002526.00
    1112023.06.13 03:15buy560.301961.000.001966.36
    1122023.06.13 15:30t/p560.301966.360.001966.36160.802686.80
    1132023.07.12 03:45buy570.301936.100.001941.76
    1142023.07.12 15:30t/p570.301941.760.001941.76169.802856.60
    1152023.07.19 23:00buy580.301978.780.001982.56
    1162023.07.20 04:30t/p580.301982.560.001982.5674.212930.81
    +
    diff --git a/Docs/Reports/Tests/XR/StrategyTester 4.gif b/Docs/Reports/Tests/XR/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..2f235e8c29db3f76a4f4b019e3b945dc6e973c5b GIT binary patch literal 8374 zcmch5g;!MH_x1pa4Bd?&(jg!c4yk~IlqeEPiZqC#bPPQ~4BZU_4BbP6bT zwywK_>a0NsEa2|K;jjqM9aLw1$GkHEI4lMPr~upz5a$2!aDNe?{{eu(x;rNbgZ&>7 z0I;sR3%v`zgX*j+KrIN|Z)?z5rA9no@^ z;m&zi5e@+Y-D!dTn?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TPO3>@_saLqU_DUdsWj{0o7W?t_WDByr&VB+st*Idd3 zGn`B#(%@8~ZE$$_L>oljDQ6a8tHRGb9IoA&!#vFLO6u}Wlxa`NXKh*)KmM8r`sEeqYg}>PDi zm7J}em=jdJ;GzZ(y&WR4lT!@xs;ZO(7iqD~zh^O@mVQ(zK%l=X;hQ(AnweC9o>rn+UuM#oYe6WWcR)~@Fq%PH<7=`Pvb z0&%MTJw2=C4yZtcBs^uAKh*})>e)NuRQs^Y>HKa&3Cah$WAsZ==2GnxkpRmF*IfN4 z`@TwFd5p6RhAoPuqdN8WqgamDqSUB5SpuA*+`Z=}XLPb@Zl+^JIDZW)pHxs$ew(%L zDXgpr*Xj=cIy|+2Ce=a*{}}kkuH>nxsL)s{^7x-hTK}e$KTkjRsw+~5b%!eKa{6`7 z%#Y%$*-zytqmhpvs?Yg%+w^4!wl9CE9B=J?uJ2lCV{>%j1n&{g$}IeAO-OHJrE%$P z!Vpjt64A&P`71QPj$JzQq==u06cse4W+%xVN#9gqYo1Joo&Nduwl>nBedG0)3*RW2 zqO1a+$9g(mSp$BjHRUaPU!txSc3Aw*nh#nI{3)(iNc_*cL|TucqON}l`d + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.xr.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +marketLength=50; swingLength=7; riskToRewardRatio=2; alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.3; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +
    Bars in test62709Ticks modelled71719330Modelling qualityn/a
    Mismatched charts errors777
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit2201.41Gross profit5962.79Gross loss-3761.38
    Profit factor1.59Expected payoff37.96
    Absolute drawdown274.52Maximal drawdown997.50 (28.19%)Relative drawdown39.80% (479.56)
    Total trades58Short positions (won %)0 (0.00%)Long positions (won %)58 (58.62%)
    Profit trades (% of total)34 (58.62%)Loss trades (% of total)24 (41.38%)
    Largestprofit trade437.40loss trade-313.66
    Averageprofit trade175.38loss trade-156.72
    Maximumconsecutive wins (profit in money)4 (690.28)consecutive losses (loss in money)3 (-621.90)
    Maximalconsecutive profit (count of wins)690.28 (4)consecutive loss (count of losses)-621.90 (3)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.301841.440.001845.90
    22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
    32020.12.08 18:30buy20.301870.350.001886.13
    42020.12.09 05:19close20.301864.070.001886.13-201.46919.28
    52020.12.30 03:45buy30.301883.290.001893.75
    62020.12.30 10:00close30.301878.490.001893.75-144.00775.28
    72020.12.30 18:00buy40.301885.860.001895.62
    82020.12.31 02:15t/p40.301895.620.001895.62253.611028.89
    92021.01.05 11:30buy50.301944.710.001954.49
    102021.01.06 03:09t/p50.301954.490.001954.49280.341309.23
    112021.04.05 17:30buy60.301729.420.001742.62
    122021.04.05 22:00close60.301725.680.001742.62-112.201197.03
    132021.04.19 06:15buy70.301778.720.001785.24
    142021.04.19 07:15close70.301776.750.001785.24-59.101137.93
    152021.04.26 21:00buy80.301780.010.001781.77
    162021.04.26 23:39t/p80.301781.770.001781.7752.801190.73
    172021.05.18 23:45buy90.301870.210.001872.99
    182021.05.19 05:00close90.301867.630.001872.99-90.461100.27
    192021.05.20 08:15buy100.301876.090.001877.07
    202021.05.20 08:30t/p100.301877.070.001877.0729.401129.67
    212021.05.21 11:30buy110.301876.530.001882.65
    222021.05.21 15:21t/p110.301882.650.001882.65183.601313.27
    232021.05.24 19:15buy120.301884.010.001887.27
    242021.05.25 01:15close120.301880.910.001887.27-106.061207.20
    252021.05.25 10:45buy130.301884.160.001898.74
    262021.05.25 21:06t/p130.301898.740.001898.74437.401644.60
    272021.06.28 20:30buy140.301780.510.001785.35
    282021.06.28 21:15close140.301778.020.001785.35-74.701569.90
    292021.07.06 04:15buy150.301792.940.001796.10
    302021.07.06 04:53t/p150.301796.100.001796.1094.801664.70
    312021.07.09 17:45buy160.301806.390.001814.91
    322021.07.12 07:16close160.301801.870.001814.91-148.661516.04
    332021.07.12 19:30buy170.301805.330.001808.45
    342021.07.13 04:34t/p170.301808.450.001808.4580.541596.58
    352021.08.12 23:00buy180.301753.790.001757.21
    362021.08.13 09:09t/p180.301757.210.001757.2189.541686.12
    372021.09.01 22:30buy190.301815.330.001820.69
    382021.09.02 02:45close190.301813.220.001820.69-102.491583.63
    392021.09.03 05:15buy200.301813.490.001819.35
    402021.09.03 15:34t/p200.301819.350.001819.35175.801759.43
    412021.09.29 06:00buy210.301740.530.001751.43
    422021.09.29 16:24close210.301736.210.001751.43-129.601629.83
    432021.11.16 04:45buy220.301867.860.001877.40
    442021.11.16 09:45close220.301863.300.001877.40-136.801493.03
    452021.12.07 04:30buy230.301781.010.001785.23
    462021.12.07 05:45close230.301778.500.001785.23-75.301417.73
    472021.12.07 20:30buy240.301784.430.001788.51
    482021.12.08 04:07t/p240.301788.510.001788.51109.341527.07
    492021.12.28 08:15buy250.301813.150.001819.37
    502021.12.28 15:37t/p250.301819.370.001819.37186.601713.67
    512022.01.10 21:30buy260.301801.220.001805.98
    522022.01.11 04:24t/p260.301805.980.001805.98129.741843.41
    532022.01.19 11:15buy270.301816.130.001824.95
    542022.01.19 15:54t/p270.301824.950.001824.95264.602108.01
    552022.01.24 23:15buy280.301843.380.001853.74
    562022.01.25 11:04close280.301838.270.001853.74-166.361941.65
    572022.01.31 11:30buy290.301791.280.001798.92
    582022.01.31 16:39t/p290.301798.920.001798.92229.202170.85
    592022.02.16 09:30buy300.301856.110.001860.85
    602022.02.16 15:00close300.301852.740.001860.85-101.102069.75
    612022.03.03 22:15buy310.301937.410.001946.73
    622022.03.04 02:36t/p310.301946.730.001946.73266.542336.28
    632022.03.04 13:00buy320.301947.630.001961.75
    642022.03.04 18:09t/p320.301961.750.001961.75423.602759.88
    652022.03.11 21:30buy330.301986.950.001999.25
    662022.03.14 00:22close330.301976.930.001999.25-313.662446.22
    672022.03.24 13:30buy340.301946.500.001957.42
    682022.03.24 14:03t/p340.301957.420.001957.42327.602773.82
    692022.04.05 16:15buy350.301935.270.001956.63
    702022.04.05 18:24close350.301925.270.001956.63-300.002473.82
    712022.04.13 08:30buy360.301969.860.001973.40
    722022.04.13 11:19t/p360.301973.400.001973.40106.202580.02
    732022.05.20 09:45buy370.301848.340.001859.62
    742022.05.20 16:30close370.301840.610.001859.62-231.902348.12
    752022.05.23 01:15buy380.301845.310.001848.55
    762022.05.23 02:07t/p380.301848.550.001848.5597.202445.32
    772022.06.08 15:15buy390.301851.320.001858.82
    782022.06.08 18:07t/p390.301858.820.001858.82225.002670.32
    792022.07.05 02:15buy400.301810.010.001814.79
    802022.07.05 10:30close400.301806.730.001814.79-98.402571.92
    812022.10.26 07:45buy410.301656.860.001658.96
    822022.10.26 08:41t/p410.301658.960.001658.9663.002634.92
    832022.10.27 08:45buy420.301669.970.001683.09
    842022.10.27 09:45close420.301661.850.001683.09-243.602391.32
    852022.11.02 04:00buy430.301650.460.001653.36
    862022.11.02 10:00t/p430.301653.360.001653.3687.002478.32
    872022.11.14 17:45buy440.301770.180.001784.24
    882022.11.15 08:45close440.301769.440.001784.24-35.262443.06
    892022.11.30 05:45buy450.301754.150.001759.19
    902022.11.30 10:57t/p450.301759.190.001759.19151.202594.26
    912023.01.11 06:30buy460.301877.620.001882.84
    922023.01.11 07:37t/p460.301882.840.001882.84156.602750.86
    932023.02.09 05:00buy470.301879.530.001889.99
    942023.02.09 16:01t/p470.301889.990.001889.99313.803064.66
    952023.02.16 21:30buy480.301843.520.001847.54
    962023.02.17 01:15close480.301835.010.001847.54-268.362796.30
    972023.02.22 05:15buy490.301837.180.001840.68
    982023.02.22 10:03t/p490.301840.680.001840.68105.002901.30
    992023.03.28 17:00buy500.301963.690.001968.77
    1002023.03.28 17:57t/p500.301968.770.001968.77152.403053.70
    1012023.03.30 10:45buy510.301969.560.001976.42
    1022023.03.30 19:01t/p510.301976.420.001976.42205.803259.50
    1032023.04.26 13:30buy520.302000.140.002005.44
    1042023.04.26 16:24t/p520.302005.440.002005.44159.003418.50
    1052023.04.27 06:00buy530.301999.160.002014.50
    1062023.04.27 15:35close530.301989.140.002014.50-300.603117.90
    1072023.05.15 19:45buy540.302020.300.002031.78
    1082023.05.15 22:00close540.302014.590.002031.78-171.302946.60
    1092023.06.09 17:30buy550.301967.630.001988.83
    1102023.06.09 18:30close550.301962.630.001988.83-150.002796.60
    1112023.06.13 03:15buy560.301961.000.001966.36
    1122023.06.13 15:30t/p560.301966.360.001966.36160.802957.40
    1132023.07.12 03:45buy570.301936.100.001941.76
    1142023.07.12 15:30t/p570.301941.760.001941.76169.803127.20
    1152023.07.19 23:00buy580.301978.780.001982.56
    1162023.07.20 04:30t/p580.301982.560.001982.5674.213201.41
    +
    diff --git a/Docs/Reports/Tests/XR/StrategyTester 5.gif b/Docs/Reports/Tests/XR/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..905a6a2169f0b5c39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docs/Reports/Tests/XR/StrategyTester 5.htm new file mode 100644 index 0000000..1f7f2fa --- /dev/null +++ b/Docs/Reports/Tests/XR/StrategyTester 5.htm @@ -0,0 +1,213 @@ + + + + Strategy Tester: x-saherelm.xr.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.xr.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.21 23:45 (2020.01.01 - 2023.07.22)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0003; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.3; minBalancePercent=0.5; maxEquityPercent=0.1; closeAllOpenTradesAfterCandle=252; closeAllInProfitOpenTradesWhenMaxOpenTradesReached=false; +xrR2R=2; xrMarketLength=7; xrMarketRangeMult=7; xrFastMult=3; xrSlowMult=7; xrSwingLength=7;
    Bars in test62709Ticks modelled71719330Modelling qualityn/a
    Mismatched charts errors777
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit2656.05Gross profit8026.93Gross loss-5370.88
    Profit factor1.49Expected payoff36.38
    Absolute drawdown169.22Maximal drawdown954.90 (24.18%)Relative drawdown31.06% (374.26)
    Total trades73Short positions (won %)0 (0.00%)Long positions (won %)73 (56.16%)
    Profit trades (% of total)41 (56.16%)Loss trades (% of total)32 (43.84%)
    Largestprofit trade528.00loss trade-313.66
    Averageprofit trade195.78loss trade-167.84
    Maximumconsecutive wins (profit in money)4 (991.20)consecutive losses (loss in money)3 (-208.69)
    Maximalconsecutive profit (count of wins)991.20 (4)consecutive loss (count of losses)-493.50 (2)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.301841.440.001845.90
    22020.12.04 15:31t/p10.301845.900.001845.90120.741120.74
    32020.12.08 18:30buy20.301870.350.001886.13
    42020.12.09 03:19close20.301867.580.001886.13-96.161024.58
    52020.12.30 03:45buy30.301883.290.001893.75
    62020.12.30 10:00close30.301878.490.001893.75-144.00880.58
    72020.12.30 18:00buy40.301885.860.001895.62
    82020.12.31 02:15t/p40.301895.620.001895.62253.611134.19
    92020.12.31 13:45buy50.301894.880.001901.64
    102021.01.04 01:00t/p50.301901.640.001901.64176.681310.87
    112021.01.05 11:30buy60.301944.710.001954.49
    122021.01.06 03:09t/p60.301954.490.001954.49280.341591.20
    132021.04.05 17:30buy70.301729.420.001742.62
    142021.04.05 22:00close70.301725.680.001742.62-112.201479.00
    152021.04.26 21:00buy80.301780.010.001781.77
    162021.04.26 23:39t/p80.301781.770.001781.7752.801531.80
    172021.05.11 09:00buy90.301837.410.001840.21
    182021.05.11 09:51close90.301834.840.001840.21-77.101454.70
    192021.05.18 23:45buy100.301870.210.001872.99
    202021.05.19 05:00close100.301867.630.001872.99-90.461364.24
    212021.05.20 08:15buy110.301876.090.001877.07
    222021.05.20 08:30t/p110.301877.070.001877.0729.401393.64
    232021.05.21 11:30buy120.301876.530.001882.65
    242021.05.21 15:21t/p120.301882.650.001882.65183.601577.24
    252021.05.24 19:15buy130.301884.010.001887.27
    262021.05.25 01:15close130.301880.910.001887.27-106.061471.18
    272021.05.25 10:45buy140.301884.160.001898.74
    282021.05.25 21:06t/p140.301898.740.001898.74437.401908.58
    292021.06.28 20:30buy150.301780.510.001785.35
    302021.06.28 21:15close150.301778.020.001785.35-74.701833.88
    312021.07.02 02:00buy160.301776.630.001777.79
    322021.07.02 03:39t/p160.301777.790.001777.7934.801868.68
    332021.07.06 04:15buy170.301792.940.001796.10
    342021.07.06 04:53t/p170.301796.100.001796.1094.801963.48
    352021.07.09 17:45buy180.301806.390.001814.91
    362021.07.12 07:16close180.301801.870.001814.91-148.661814.82
    372021.07.13 17:45buy190.301811.870.001825.27
    382021.07.13 21:07close190.301806.200.001825.27-170.101644.72
    392021.08.11 05:30buy200.301732.250.001747.61
    402021.08.11 18:06t/p200.301747.610.001747.61460.802105.52
    412021.08.12 23:00buy210.301753.790.001757.21
    422021.08.13 09:09t/p210.301757.210.001757.2189.542195.06
    432021.08.18 04:30buy220.301789.150.001796.39
    442021.08.18 12:30close220.301787.880.001796.39-38.102156.96
    452021.09.01 22:30buy230.301815.330.001820.69
    462021.09.02 02:45close230.301813.220.001820.69-102.492054.47
    472021.09.02 03:15buy240.301815.430.001819.79
    482021.09.02 05:30close240.301813.160.001819.79-68.101986.37
    492021.09.03 05:15buy250.301813.490.001819.35
    502021.09.03 15:34t/p250.301819.350.001819.35175.802162.17
    512021.09.27 03:45buy260.301753.930.001763.97
    522021.09.27 12:49close260.301749.120.001763.97-144.302017.87
    532021.10.22 02:15buy270.301786.030.001793.21
    542021.10.22 09:54t/p270.301793.210.001793.21215.402233.27
    552021.11.16 04:45buy280.301867.860.001877.40
    562021.11.16 09:45close280.301863.300.001877.40-136.802096.47
    572021.12.07 04:30buy290.301781.010.001785.23
    582021.12.07 05:45close290.301778.500.001785.23-75.302021.17
    592021.12.07 20:30buy300.301784.430.001788.51
    602021.12.08 04:07t/p300.301788.510.001788.51109.342130.51
    612021.12.28 08:15buy310.301813.150.001819.37
    622021.12.28 15:37t/p310.301819.370.001819.37186.602317.11
    632022.01.10 21:30buy320.301801.220.001805.98
    642022.01.11 04:24t/p320.301805.980.001805.98129.742446.85
    652022.01.19 11:15buy330.301816.130.001824.95
    662022.01.19 15:54t/p330.301824.950.001824.95264.602711.45
    672022.01.24 23:15buy340.301843.380.001853.74
    682022.01.25 12:36close340.301836.700.001853.74-213.462497.98
    692022.01.31 11:30buy350.301791.280.001798.92
    702022.01.31 16:39t/p350.301798.920.001798.92229.202727.18
    712022.02.16 09:30buy360.301856.110.001860.85
    722022.02.16 15:00close360.301852.740.001860.85-101.102626.08
    732022.02.28 16:15buy370.301914.460.001926.88
    742022.02.28 18:09close370.301904.460.001926.88-300.002326.08
    752022.03.03 22:15buy380.301937.410.001946.73
    762022.03.04 02:36t/p380.301946.730.001946.73266.542592.62
    772022.03.04 13:00buy390.301947.630.001961.75
    782022.03.04 18:09t/p390.301961.750.001961.75423.603016.22
    792022.03.11 21:30buy400.301986.950.001999.25
    802022.03.14 00:22close400.301976.930.001999.25-313.662702.56
    812022.03.21 06:45buy410.301928.320.001933.60
    822022.03.21 14:30close410.301923.730.001933.60-137.702564.86
    832022.03.24 13:30buy420.301946.500.001957.42
    842022.03.24 14:03t/p420.301957.420.001957.42327.602892.46
    852022.04.05 16:15buy430.301935.270.001956.63
    862022.04.05 18:24close430.301925.270.001956.63-300.002592.46
    872022.04.13 08:30buy440.301969.860.001973.40
    882022.04.13 11:19t/p440.301973.400.001973.40106.202698.66
    892022.05.04 11:30buy450.301869.680.001876.04
    902022.05.04 17:15close450.301863.310.001876.04-191.102507.56
    912022.05.20 09:45buy460.301848.340.001859.62
    922022.05.20 16:31close460.301840.590.001859.62-232.502275.06
    932022.05.23 01:15buy470.301845.310.001848.55
    942022.05.23 02:07t/p470.301848.550.001848.5597.202372.26
    952022.05.30 06:45buy480.301859.800.001862.94
    962022.05.30 08:42t/p480.301862.940.001862.9494.202466.46
    972022.06.08 15:15buy490.301851.320.001858.82
    982022.06.08 18:07t/p490.301858.820.001858.82225.002691.46
    992022.07.05 02:15buy500.301810.010.001814.79
    1002022.07.05 10:30close500.301806.730.001814.79-98.402593.06
    1012022.09.09 04:30buy510.301715.930.001727.53
    1022022.09.09 10:22t/p510.301727.530.001727.53348.002941.06
    1032022.10.27 08:45buy520.301669.970.001683.09
    1042022.10.27 09:45close520.301661.850.001683.09-243.602697.46
    1052022.11.02 04:00buy530.301650.460.001653.36
    1062022.11.02 10:00t/p530.301653.360.001653.3687.002784.46
    1072022.11.16 12:15buy540.301783.620.001796.96
    1082022.11.16 16:37close540.301773.620.001796.96-300.002484.46
    1092022.11.30 05:45buy550.301754.150.001759.19
    1102022.11.30 10:57t/p550.301759.190.001759.19151.202635.66
    1112022.12.08 15:15buy560.301787.360.001794.56
    1122022.12.08 17:28t/p560.301794.560.001794.56216.002851.66
    1132022.12.21 16:45buy570.301818.300.001822.80
    1142022.12.21 17:37t/p570.301822.800.001822.80135.002986.66
    1152023.01.09 18:45buy580.301876.980.001885.82
    1162023.01.10 02:26close580.301868.360.001885.82-271.662715.00
    1172023.01.11 06:30buy590.301877.620.001882.84
    1182023.01.11 07:37t/p590.301882.840.001882.84156.602871.60
    1192023.02.09 05:00buy600.301879.530.001889.99
    1202023.02.09 16:01t/p600.301889.990.001889.99313.803185.40
    1212023.02.16 21:30buy610.301843.520.001847.54
    1222023.02.17 01:15close610.301835.010.001847.54-268.362917.04
    1232023.02.22 05:15buy620.301837.180.001840.68
    1242023.02.22 10:03t/p620.301840.680.001840.68105.003022.04
    1252023.03.17 04:45buy630.301929.140.001946.74
    1262023.03.17 15:02t/p630.301946.740.001946.74528.003550.04
    1272023.03.28 17:00buy640.301963.690.001968.77
    1282023.03.28 17:57t/p640.301968.770.001968.77152.403702.44
    1292023.03.30 10:45buy650.301969.560.001976.42
    1302023.03.30 19:01t/p650.301976.420.001976.42205.803908.24
    1312023.04.26 13:30buy660.302000.140.002005.44
    1322023.04.26 15:30close660.301993.710.002005.44-192.903715.34
    1332023.04.27 06:00buy670.301999.160.002014.50
    1342023.04.27 15:35close670.301989.140.002014.50-300.603414.74
    1352023.05.09 08:15buy680.302027.060.002032.32
    1362023.05.09 14:30t/p680.302032.320.002032.32157.803572.54
    1372023.05.15 19:45buy690.302020.300.002031.78
    1382023.05.15 22:00close690.302014.590.002031.78-171.303401.24
    1392023.06.09 17:30buy700.301967.630.001988.83
    1402023.06.09 18:30close700.301962.630.001988.83-150.003251.24
    1412023.06.13 03:15buy710.301961.000.001966.36
    1422023.06.13 15:30t/p710.301966.360.001966.36160.803412.04
    1432023.07.12 03:45buy720.301936.100.001941.76
    1442023.07.12 15:30t/p720.301941.760.001941.76169.803581.84
    1452023.07.19 23:00buy730.301978.780.001982.56
    1462023.07.20 04:30t/p730.301982.560.001982.5674.213656.05
    +
    diff --git a/Docs/Reports/Tests/XTPW/Full/StrategyTester 1.gif b/Docs/Reports/Tests/XTPW/Full/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..dabf25d4cfc60174ad3603702df31da6b9706319 GIT binary patch literal 7717 zcmch6g;N{f_jb?*cZwG;ZY>tH)XWYCcR`X3FA@Fqla3$hi} z*52{+S7%puPj6rUz#w{Pcx1E^Z(?$4dS-TReqnKGd1ZBNePeTLduMkKvwv`SbbNAp z_WRHI#ov=!yd3DYZl6AGRrM7S4aZ_q+?tvW1(!0KK7Rd~HiP8d!r#b(CxM(Q zk?)uiHr2!V-oTR561Fs>L_f7nG9?!GevmELTkQW)^7<*WI8o!{2E8|$FCX$HH$2vR ztB&`*Iw8^;fTvAF9x)J!0R%n0M=Ln7@OJDRU4W+Bx5 z_xq^e2PMY|Ul+rhwYG?VdOBM)YJ?=T{7^p2bJ|eSL{XED4*6hi3RV_V7&?zYnks{F zl@I9^7ffYjIHEVy|COt${^1&ou<4v<>ihong&jnOhmw<)PQ_ADHefLH1y4eC>-BJV zDN8t$utja|K+3EUlVmduWHfTtS>VlGf&=oNZffJL8>0N`g5E3uZHCJ~V1e?m%Zz{d?CD3!>^6RxE; zBol)gM34xOOPP7nw|2}CvvdGdV|lwc35Xw!>IQQ%q74eL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spUEI%ZE$yM0>=sm^t$EGXy$!MfUk-o^fmu(^ zH%clgTQF8+^&rW{*suTQN=i5)H>)}c8WAO%LOu)cpZ!E0zKeT>hO30r?$3uDbKVM$ zxpPSWncSyPlboSDYkjz)pdv5W<^P)eG}zMdj)2^0R7na$VCpB(m1wSw*p)R`{8tz< z7`UaxV{$^8a~We5uv(^O(?{2JqyAI1;ki>Fkeu^3Wkf6fG!>Tagf#?zh3oOpc(rfc zP5~6vCxM$~zXGn1)1zoB0(kmKP+Hm=r@dS&6Mk+m-{hx>gxp^`v!kZ2pIIm&c?h2E z=G%;=@up)_Q2m`q-VxUEg+D zu(6gseKtQFYuvfMFL%}V^!oI3(mVEt&3u|f)@QElOoj|fG@2S}XE9ZT`drL{5MA3N ze{x_U-i6$tX2@V_gTfbquyi#`;xXC*UP}P^9?6%ZdiO-^O%dXFb16f`d@R(@i2O0 z=HzFi5~Qt;S0l85Y+}iHE^&L>PMc&C%WK8vDiK=l(hr5^R9ii7^(H3+VIf~$LNM>X zs-4I5nCx<=%r_J@)+Qn>w>OKu&|iJEO2#Iq8!O9!=6+5df?XJTBG0#Qey2)NS1YLz zqfs3LyQ;%WQvs1)*&34ikQSjWE_raT&a4oC+`vB4LUhewF#26xy+x&EGlZm<)Fm+4 z_ko4Jx;UYnTUH)Q#AYfKFp+>?n;*(;{idREV%)Z&;!Bn-c0jJ0c{&%mV0t}UTG1ay z6O(uAfLXUyUM2q6bfJ~!Xy+~5ZsgE1Syk;?6SZ_;>yBJJtafiFTRw?&Z`~BF@f?X- U{!{LbI&i4*UfEAm1ppNO4>l~Z)c^nh literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Full/StrategyTester 1.htm b/Docs/Reports/Tests/XTPW/Full/StrategyTester 1.htm new file mode 100644 index 0000000..e6ae90d --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Full/StrategyTester 1.htm @@ -0,0 +1,169 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit209.11Gross profit297.85Gross loss-88.73
    Profit factor3.36Expected payoff4.18
    Absolute drawdown5.97Maximal drawdown30.04 (2.64%)Relative drawdown2.64% (30.04)
    Total trades50Short positions (won %)35 (85.71%)Long positions (won %)15 (93.33%)
    Profit trades (% of total)44 (88.00%)Loss trades (% of total)6 (12.00%)
    Largestprofit trade22.02loss trade-15.49
    Averageprofit trade6.77loss trade-14.79
    Maximumconsecutive wins (profit in money)10 (74.81)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)74.81 (10)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins6consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 17:39sell10.011836.610.001825.20
    22020.12.07 10:37t/p10.011825.200.001825.2011.631011.63
    32021.01.29 16:54sell20.011865.800.001855.99
    42021.01.29 19:22t/p20.011855.990.001855.999.811021.44
    52021.02.09 17:45sell30.011841.990.001838.33
    62021.02.09 18:09t/p30.011838.330.001838.333.661025.10
    72021.02.10 17:00sell40.011841.300.001827.41
    82021.02.11 19:09t/p40.011827.410.001827.4114.551039.65
    92021.02.16 17:09sell50.011804.040.001801.47
    102021.02.16 18:49t/p50.011801.470.001801.472.571042.22
    112021.03.03 16:51sell60.011712.530.001708.07
    122021.03.03 17:36t/p60.011708.070.001708.074.461046.68
    132021.03.11 16:48buy70.011719.900.001728.00
    142021.03.11 20:09t/p70.011728.000.001728.008.101054.78
    152021.03.17 13:48buy80.011728.340.001737.00
    162021.03.17 20:06t/p80.011737.000.001737.008.661063.44
    172021.04.19 15:15buy90.011775.900.001781.90
    182021.04.21 04:39t/p90.011781.900.001781.905.031068.46
    192021.04.27 18:24buy100.011778.420.001784.35
    202021.04.28 12:24close100.011763.420.001784.35-15.491052.98
    212021.05.10 17:45sell110.011839.580.001833.85
    222021.05.11 03:39t/p110.011833.850.001833.855.951058.93
    232021.05.19 22:00buy120.011863.460.001881.95
    242021.05.20 19:49t/p120.011881.950.001881.9517.031075.96
    252021.07.06 19:07buy130.011794.080.001807.68
    262021.07.07 13:24t/p130.011807.680.001807.6813.111089.07
    272021.07.08 18:04buy140.011801.930.001814.59
    282021.07.13 15:39t/p140.011814.590.001814.5911.201100.27
    292021.07.13 17:21sell150.011811.750.001808.46
    302021.07.13 20:37t/p150.011808.460.001808.463.291103.56
    312021.08.17 17:15buy160.011782.680.001787.76
    322021.08.18 04:09t/p160.011787.760.001787.764.591108.16
    332021.08.20 17:39sell170.011781.750.001777.75
    342021.08.23 03:16t/p170.011777.750.001777.754.221112.38
    352021.08.31 15:30sell180.011811.860.001809.11
    362021.08.31 16:04t/p180.011809.110.001809.112.751115.13
    372021.10.27 18:09sell190.011793.560.001789.11
    382021.10.28 16:30close190.011808.560.001789.11-14.341100.78
    392021.11.03 04:00sell200.011783.060.001779.26
    402021.11.03 08:15t/p200.011779.260.001779.263.801104.58
    412021.11.30 17:48sell210.011794.770.001781.02
    422021.11.30 18:04t/p210.011781.020.001781.0213.751118.33
    432021.12.13 16:49sell220.011785.140.001782.99
    442021.12.14 10:24t/p220.011782.990.001782.992.371120.70
    452021.12.15 16:54sell230.011769.740.001766.01
    462021.12.15 17:39t/p230.011766.010.001766.013.731124.43
    472021.12.20 17:01sell240.011793.800.001789.41
    482021.12.20 22:09t/p240.011789.410.001789.414.391128.82
    492021.12.21 16:52buy250.011793.790.001799.79
    502021.12.22 20:09t/p250.011799.790.001799.795.511134.34
    512022.01.18 18:19sell260.011813.030.001806.19
    522022.01.19 16:51close260.011828.030.001806.19-14.781119.55
    532022.02.15 11:19buy270.011856.930.001866.99
    542022.02.16 19:19t/p270.011866.990.001866.999.571129.13
    552022.02.18 17:33sell280.011895.770.001893.21
    562022.02.18 17:37t/p280.011893.210.001893.212.561131.69
    572022.03.02 18:16sell290.011921.470.001907.56
    582022.03.03 13:34close290.011936.470.001907.56-14.341117.35
    592022.04.22 19:22sell300.011936.790.001932.93
    602022.04.22 20:28t/p300.011932.930.001932.933.861121.21
    612022.04.26 16:08sell310.011905.800.001905.21
    622022.04.26 16:57t/p310.011905.210.001905.210.591121.80
    632022.06.10 16:01sell320.011839.900.001834.17
    642022.06.10 16:18t/p320.011834.170.001834.175.731127.53
    652022.07.20 16:52sell330.011708.520.001702.79
    662022.07.20 19:48t/p330.011702.790.001702.795.731133.26
    672022.08.02 18:02sell340.011776.930.001767.92
    682022.08.02 21:02t/p340.011767.920.001767.929.011142.27
    692022.09.30 20:35buy350.011663.130.001667.34
    702022.10.03 04:30t/p350.011667.340.001667.343.721145.99
    712022.11.02 21:03sell360.011647.760.001626.40
    722022.11.03 10:26t/p360.011626.400.001626.4022.021168.01
    732022.11.30 17:18buy370.011751.890.001763.12
    742022.11.30 21:20t/p370.011763.120.001763.1211.231179.24
    752022.12.09 17:23buy380.011791.230.001800.19
    762022.12.09 18:20t/p380.011800.190.001800.198.961188.20
    772023.01.11 17:38buy390.011870.980.001874.94
    782023.01.11 19:21t/p390.011874.940.001874.943.961192.16
    792023.01.12 17:10sell400.011884.680.001867.96
    802023.01.12 21:03close400.011899.680.001867.96-15.001177.16
    812023.02.07 16:32sell410.011869.860.001868.93
    822023.02.07 16:45t/p410.011868.930.001868.930.931178.09
    832023.02.09 17:00sell420.011879.160.001868.22
    842023.02.09 18:03t/p420.011868.220.001868.2210.941189.03
    852023.03.02 20:35sell430.011835.870.001834.80
    862023.03.03 21:27close430.011850.870.001834.80-14.781174.25
    872023.04.26 19:17buy440.011989.040.001995.12
    882023.04.27 05:13t/p440.011995.120.001995.124.621178.87
    892023.05.15 17:34sell450.012016.660.002011.32
    902023.05.16 09:04t/p450.012011.320.002011.325.561184.43
    912023.05.26 17:09sell460.011951.200.001949.72
    922023.05.26 17:19t/p460.011949.720.001949.721.481185.91
    932023.06.07 17:32sell470.011958.950.001947.93
    942023.06.07 18:51t/p470.011947.930.001947.9311.021196.93
    952023.07.13 18:04sell480.011959.610.001957.54
    962023.07.13 18:51t/p480.011957.540.001957.542.071199.00
    972023.07.19 18:12sell490.011974.940.001970.18
    982023.07.20 17:35t/p490.011970.180.001970.185.421204.41
    992023.07.25 15:30sell500.011958.580.001953.88
    1002023.07.25 17:00t/p500.011953.880.001953.884.701209.11
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..46ab045c6bb86c092cefa4e41825befa227d8f06 GIT binary patch literal 5941 zcmd5-`9IX(|9wei21O}bND5_1CB@i9wg#yzSyN3y(jsIVV;f@|`!HkQjb&_O9b_H5 zvKu=w_BA{6_5S=7-}|`tai8a$$2s@;c-$YJ>Y7ibW!^lbCj)Z;K%>zB0O;uGpb^_4 z=uILFMm(h`LlA%foNmYv0LUo^oR+5*06{|_u>XNm4gmg>PdOL>ft)I*5CTI}{)_mp@&ETr?6i5{ zzrO$&Xm9}G?c?j`j|@Ns1_g(NqQk-?BBP>XFtKr1Tzo=eQgTXaT6#uiR(1|PH!r_{ zP*_x4Qc5f19S z|IW=*7Z#V6S60{7H#WDn|LyFq6X+7p9GxT_11C#Y(346!=PvP$Mxv)wpcif^bX*CW zR(*E${t0Clm8$H;uZVid89uAwFZetm5)=McD^UDRO&@1OMvKAY)H`j?0hxk{QE>gs zkbtaPsbOdp{R3q7&CKAW2jP{-#jZg4!jnGk@2Lvv^dL(SOQp==V(Z=n)8WOXXxj4Cg}vQ{69m5d7xt@O#O5Qw>NqQFEN=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De!`@b*g~$3 z972bR2Jq(5i)r3e%;``Fp%3Dl+ zSV0HO#J7^oyZpX-@yjYL=U>i>*A6v_&$=~dC9iWOL@&4h1Z3(rK7A4V549YusR<7cqpUwXT`OanQKY+Khd!koo4Ti>r6K=a+gFu1jq0kT>G_^3Qk61wz&)a~1*J zEoln^2Q5=NVN3M-w%d)Z@bwiwi!Hklu)>qg@JUG)T_#h7Md~>9hVJsw__84jn41Os zO=pH3ysFc^ioLrnrWj^Y0E!F=ds&;+0oi(_IG4XT`l=ShqWEuTmFw*U=s6AbF%;xZ zTkf^rg-Hy{*T!x8f8H}=*@NlsKFH^CrGan*yT$915%*e1IxC#rU_>qWek}Ou_1QJ~ zJ$ebt*fkI)bU)=ff${v`T*V2^1RFeYf8g#R1$q#GJ}9p_$oVn0Bu}1xMu3j{kB=v>pG+&B%vzkxd7e-c OPZn!WKvzM4?EeARk!wu= literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.htm new file mode 100644 index 0000000..e268a6f --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 1.htm @@ -0,0 +1,75 @@ + + + + Strategy Tester: + + + + + + + +
    +
    Strategy Tester Report
    +
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    Symbol
    Period 1970.01.01 00:00 - 1970.01.01 00:00
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.15; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    - 1970.01.01 00:00
    +Graph
    + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.08 11:00sell10.101888.710.001857.17
    22021.01.08 16:49sell20.101868.640.001837.14
    32021.01.08 17:09t/p10.101857.170.001857.17315.401315.40
    42021.01.08 20:21t/p20.101837.140.001837.14315.001630.40
    52022.01.18 10:30sell30.101814.210.001808.80
    62022.01.18 15:09t/p30.101808.800.001808.8054.101684.50
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..6bb225d6b14316b559444b9e86b0f7ad3621a95e GIT binary patch literal 8537 zcmch5^;?wP_w^9M&?q4xEz&6p3@NB|iAuN9Ee*oZ4MTU=3`2J}GIYzp(9$I(4fEys zy#K>{$93;(t+m(L=bT^8z2y`>iinyBVIcrp000_|1^@sfBO~aBVG!iB!Q8yz5o$08 zK~R9l7mY?iK#x#^`J?hN1fWq!5TFY1_<)fAPlrB*fc^&nh8rG95EAu2Apl_B@R<6T z40??I^Fx~h0FQKoc@?M~g5ER-Jz@}Z^G6KyAJbso4gd^;K<(&94p4>qpRaipzb2P%%N*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%$*1=ce zU!etB^fJ#|s^uRlme2PZnc&xP9Zl^JA+b|T(s{Ax9@}wuGA)I^{P)MN^Wi#lMGCOs z0KQ`}Hb)BMU#g6QF}ZWG?w?Cfm)kq7CKx~Y;{NXUAqhHwux=HH7SWB1&+hftI~z|e ztcP3?)Bhho_S9!!FV&EvC-=d7L2mbE>OIF$aa&!YV8H~V52S$%=d0)_k@rOOabZfI zO`maSzkelp;zS)}N>(n?KYPbdhJi4lfKh#5b5oBnBQF5PX@BG{ej26q&5V+bQbZ(M zHHJ)ilv04XkH7RJ>f1&EwJcDc6#rSY@1hwao+m=`)oE@(+Cw`T(h#}+t=p(XqPR4@-*ci+TSpmP67VTMF1y% zO=D;?D^HrIs#P&r#^kqcAw5qO>%FP0{lx9pyE+J+t=FkhVVYPQmjt*@Bv=Q!Z9oIt5nxCK)#VKjHUwsv3h zn?_cwdWhU0ynD{!;SI$S##>!P}d$wePrFB(z@y#{fx~~CW%^+_mu%C@H;V3R+ z8sO*VeGhJ;>cSxX+^e~%QqDCYW_T*euC_DF7et@FqS1FriuH>-fKbE8l-p7qHwH&% z1x{E|Ge_Z)pAg9CVssIbLIHTN4SW~3N+jDv#`HD0gmZCO>7__F(E?xCtX>H&zj1H6 zu>fGXbyWj-^~H+LDcZ!x5GVJlf2+O9GYajKQ1R?fd4*$AEoAoFH;K>rV7hnyNo$;J zWW9sRs=-+@u4e4sX}Ipr&`hXp1eZ}-&*7|~p)9TO{M&QVqVK_9Npj&&3X`flAIQ_X zGb1>>r3YU~p5N2cspe<``88phF-eqE@G*9d?JDN#xkx5E~ua-3Y zyHEXXwhP?>0K7j}`5U{WPxe4V-&-?HkS_yo(dJ}Gp|)i5WNuBk literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.htm new file mode 100644 index 0000000..5246318 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 2.htm @@ -0,0 +1,357 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.15; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test61155Ticks modelled69617088Modelling quality40.15%
    Mismatched charts errors30
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit2713.39Gross profit7938.41Gross loss-5225.02
    Profit factor1.52Expected payoff18.84
    Absolute drawdown53.20Maximal drawdown1492.43 (28.67%)Relative drawdown28.67% (1492.43)
    Total trades144Short positions (won %)144 (75.00%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)108 (75.00%)Loss trades (% of total)36 (25.00%)
    Largestprofit trade355.53loss trade-150.20
    Averageprofit trade73.50loss trade-145.14
    Maximumconsecutive wins (profit in money)16 (692.04)consecutive losses (loss in money)4 (-598.28)
    Maximalconsecutive profit (count of wins)1621.17 (8)consecutive loss (count of losses)-598.28 (4)
    Averageconsecutive wins4consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.101793.480.001772.09
    22020.11.30 02:30sell20.101783.130.001773.23
    32020.11.30 04:51t/p20.101773.230.001773.2399.001099.00
    42020.11.30 04:51t/p10.101772.090.001772.09215.811314.82
    52021.01.08 11:00sell30.101888.710.001857.17
    62021.01.08 15:15sell40.101882.460.001865.86
    72021.01.08 16:45sell50.101871.560.001840.06
    82021.01.08 16:51t/p40.101865.860.001865.86166.001480.82
    92021.01.08 17:09t/p30.101857.170.001857.17315.401796.22
    102021.01.08 18:15sell60.101854.120.001827.81
    112021.01.08 19:33t/p50.101840.060.001840.06315.002111.22
    122021.01.11 02:30sell70.101842.650.001823.57
    132021.01.11 03:21t/p60.101827.810.001827.81265.022376.23
    142021.01.11 03:24t/p70.101823.570.001823.57190.802567.03
    152021.01.27 17:06sell80.101841.520.001836.68
    162021.01.28 03:24t/p80.101836.680.001836.6854.142621.18
    172021.01.28 08:15sell90.101835.080.001828.99
    182021.01.28 15:45close90.101850.080.001828.99-150.002471.18
    192021.02.02 13:45sell100.101845.320.001834.90
    202021.02.02 15:22t/p100.101834.900.001834.90104.202575.38
    212021.02.02 20:45sell110.101835.300.001831.00
    222021.02.03 17:39t/p110.101831.000.001831.0044.912620.29
    232021.02.04 03:15sell120.101832.970.001830.68
    242021.02.04 03:45t/p120.101830.680.001830.6822.902643.19
    252021.02.04 11:30sell130.101815.010.001798.05
    262021.02.04 16:09t/p130.101798.050.001798.05169.602812.79
    272021.02.12 03:00sell140.101823.920.001818.13
    282021.02.12 09:54t/p140.101818.130.001818.1357.902870.69
    292021.02.16 19:45sell150.101797.010.001776.58
    302021.02.17 15:39t/p150.101776.580.001776.58206.223076.91
    312021.02.17 21:15sell160.101774.560.001766.84
    322021.02.18 15:09close160.101789.560.001766.84-144.252932.65
    332021.02.19 02:15sell170.101770.450.001760.93
    342021.02.19 16:06close170.101785.450.001760.93-150.002782.65
    352021.02.24 21:30sell180.101798.290.001796.22
    362021.02.25 04:52t/p180.101796.220.001796.2226.452809.10
    372021.02.25 14:00sell190.101786.660.001774.05
    382021.02.25 17:24t/p190.101774.050.001774.05126.102935.20
    392021.02.25 22:15sell200.101771.510.001759.80
    402021.02.26 07:39t/p200.101759.800.001759.80119.023054.21
    412021.03.05 02:00sell210.101693.980.001684.40
    422021.03.08 01:19close210.101708.980.001684.40-148.092906.12
    432021.03.24 00:15sell220.101727.230.001725.33
    442021.03.24 03:09t/p220.101725.330.001725.3319.002925.12
    452021.03.29 17:30sell230.101707.730.001680.13
    462021.03.30 15:39t/p230.101680.130.001680.13277.923203.04
    472021.04.09 16:15sell240.101732.680.001711.65
    482021.04.13 16:39close240.101747.680.001711.65-146.173056.87
    492021.04.28 08:30sell250.101769.950.001767.06
    502021.04.28 10:09t/p250.101767.060.001767.0628.903085.77
    512021.05.04 23:15sell260.101779.150.001778.25
    522021.05.05 01:09t/p260.101778.250.001778.2510.913096.68
    532021.05.12 22:15sell270.101820.200.001814.22
    542021.05.12 23:24t/p270.101814.220.001814.2259.803156.49
    552021.06.03 17:00sell280.101867.560.001836.48
    562021.06.03 23:15sell290.101870.990.001867.96
    572021.06.04 04:46t/p290.101867.960.001867.9632.223188.70
    582021.06.04 15:39close280.101882.560.001836.48-148.093040.62
    592021.06.10 07:30sell300.101885.380.001881.69
    602021.06.10 10:24t/p300.101881.690.001881.6936.903077.52
    612021.06.10 14:15sell310.101878.470.001873.43
    622021.06.10 15:01t/p310.101873.430.001873.4350.403127.92
    632021.06.14 01:58sell320.101874.070.001872.72
    642021.06.14 03:07t/p320.101872.720.001872.7213.503141.42
    652021.06.14 09:45sell330.101860.600.001852.50
    662021.06.14 15:07t/p330.101852.500.001852.5081.003222.42
    672021.06.28 15:00sell340.101774.390.001767.54
    682021.06.29 14:15t/p340.101767.540.001767.5470.423292.83
    692021.06.29 14:30sell350.101766.840.001758.70
    702021.06.29 15:39t/p350.101758.700.001758.7081.403374.23
    712021.07.27 02:30sell360.101797.120.001795.91
    722021.07.27 04:52t/p360.101795.910.001795.9112.103386.33
    732021.08.02 02:45sell370.101812.650.001810.25
    742021.08.02 04:37t/p370.101810.250.001810.2524.003410.33
    752021.08.05 21:45sell380.101803.280.001798.02
    762021.08.06 01:30sell390.101804.200.001803.39
    772021.08.06 03:04t/p390.101803.390.001803.398.103418.43
    782021.08.06 10:15t/p380.101798.020.001798.0254.523472.95
    792021.08.06 23:15sell400.101760.350.001754.70
    802021.08.09 01:24t/p400.101754.700.001754.7058.413531.36
    812021.08.25 10:30sell410.101792.620.001785.48
    822021.08.25 17:24t/p410.101785.480.001785.4871.403602.76
    832021.09.07 17:15sell420.101800.260.001778.41
    842021.09.10 08:34close420.101800.280.001778.419.383612.14
    852021.09.17 20:45sell430.101750.470.001744.77
    862021.09.20 05:24t/p430.101744.770.001744.7758.913671.05
    872021.09.23 22:45sell440.101748.240.001742.87
    882021.09.23 23:21t/p440.101742.870.001742.8753.703724.75
    892021.10.15 19:30sell450.101768.100.001757.75
    902021.10.15 22:30sell460.101768.170.001767.38
    912021.10.15 23:24t/p460.101767.380.001767.387.903732.65
    922021.10.19 10:48close450.101783.100.001757.75-146.173586.48
    932021.10.26 17:00sell470.101789.760.001773.22
    942021.10.28 15:21close470.101804.760.001773.22-142.343444.14
    952021.11.03 04:00sell480.101783.060.001777.36
    962021.11.03 07:30sell490.101781.540.001779.14
    972021.11.03 08:16t/p490.101779.140.001779.1424.003468.14
    982021.11.03 14:39t/p480.101777.360.001777.3657.003525.14
    992021.11.19 01:45sell500.101858.430.001855.42
    1002021.11.19 10:24t/p500.101855.420.001855.4230.103555.24
    1012021.11.19 19:45sell510.101843.510.001819.38
    1022021.11.22 16:24t/p510.101819.380.001819.38243.223798.45
    1032021.11.22 17:30sell520.101814.950.001779.78
    1042021.11.24 16:09t/p520.101779.780.001779.78355.534153.98
    1052021.12.02 10:00sell530.101775.250.001769.99
    1062021.12.02 10:24t/p530.101769.990.001769.9952.604206.59
    1072021.12.09 15:00sell540.101776.180.001766.13
    1082021.12.13 14:49close540.101791.180.001766.13-146.174060.41
    1092021.12.20 17:00sell550.101791.570.001781.64
    1102021.12.20 20:30sell560.101793.970.001791.36
    1112021.12.20 21:52t/p560.101791.360.001791.3626.104086.51
    1122021.12.22 22:30close550.101804.160.001781.64-122.073964.44
    1132022.01.06 15:00sell570.101791.640.001778.65
    1142022.01.10 20:30close570.101800.000.001778.65-79.773884.67
    1152022.01.18 10:30sell580.101814.210.001808.80
    1162022.01.18 15:09t/p580.101808.800.001808.8054.103938.77
    1172022.01.27 03:54sell590.101815.180.001809.30
    1182022.01.27 13:37t/p590.101809.300.001809.3058.803997.57
    1192022.01.28 17:00sell600.101786.250.001779.25
    1202022.02.01 07:19close600.101801.260.001779.25-146.273851.30
    1212022.02.23 07:15sell610.101896.100.001890.40
    1222022.02.23 10:45sell620.101894.500.001889.54
    1232022.02.23 11:39t/p610.101890.400.001890.4057.003908.30
    1242022.02.23 19:04close620.101909.500.001889.54-150.003758.30
    1252022.03.14 16:15sell630.101954.460.001935.80
    1262022.03.14 20:45sell640.101953.900.001942.16
    1272022.03.15 03:23t/p640.101942.160.001942.16119.323877.62
    1282022.03.15 07:04t/p630.101935.800.001935.80188.514066.13
    1292022.03.15 12:15sell650.101929.500.001921.27
    1302022.03.15 13:00t/p650.101921.270.001921.2782.304148.43
    1312022.04.06 02:51sell660.101920.800.001917.88
    1322022.04.06 04:01t/p660.101917.880.001917.8829.204177.63
    1332022.04.21 18:15sell670.101944.300.001940.78
    1342022.04.21 18:33t/p670.101940.780.001940.7835.204212.83
    1352022.04.22 19:15sell680.101936.670.001930.70
    1362022.04.22 21:30sell690.101933.750.001929.55
    1372022.04.25 01:37t/p680.101930.700.001930.7061.624274.45
    1382022.04.25 03:18t/p690.101929.550.001929.5543.914318.36
    1392022.04.25 13:15sell700.101915.100.001909.24
    1402022.04.25 13:58t/p700.101909.240.001909.2458.604376.96
    1412022.05.09 18:00sell710.101860.370.001848.81
    1422022.05.10 17:47t/p710.101848.810.001848.81117.524494.48
    1432022.05.10 22:30sell720.101841.470.001833.64
    1442022.05.11 02:53t/p720.101833.640.001833.6480.224574.69
    1452022.05.13 01:30sell730.101819.570.001813.17
    1462022.05.13 01:33t/p730.101813.170.001813.1764.004638.69
    1472022.05.31 18:30sell740.101840.860.001825.53
    1482022.05.31 22:00sell750.101840.650.001832.73
    1492022.06.01 07:48t/p750.101832.730.001832.7381.124719.81
    1502022.06.02 13:21close740.101855.880.001825.53-142.544577.27
    1512022.06.06 18:15sell760.101843.240.001831.57
    1522022.06.08 18:06close760.101858.240.001831.57-146.174431.10
    1532022.06.13 21:31sell770.101826.480.001820.66
    1542022.06.13 22:18t/p770.101820.660.001820.6658.204489.30
    1552022.06.22 02:30sell780.101830.550.001827.37
    1562022.06.22 03:39t/p780.101827.370.001827.3731.804521.10
    1572022.06.22 08:00sell790.101825.550.001818.68
    1582022.06.22 14:09close790.101840.560.001818.68-150.104371.00
    1592022.06.24 05:00sell800.101823.760.001821.83
    1602022.06.24 09:48t/p800.101821.830.001821.8319.304390.30
    1612022.06.29 02:00sell810.101819.490.001817.69
    1622022.06.29 09:37t/p810.101817.690.001817.6918.004408.30
    1632022.07.06 01:05sell820.101766.830.001765.11
    1642022.07.06 08:37t/p820.101765.110.001765.1117.204425.50
    1652022.07.06 18:15sell830.101737.520.001697.74
    1662022.07.07 01:45sell840.101738.940.001736.45
    1672022.07.07 21:30sell850.101740.140.001736.17
    1682022.07.08 10:39t/p840.101736.450.001736.4526.814452.31
    1692022.07.08 10:39t/p850.101736.170.001736.1741.624493.93
    1702022.07.08 17:47close830.101752.520.001697.74-142.344351.59
    1712022.07.13 03:15sell860.101724.330.001721.62
    1722022.07.13 15:31t/p860.101721.620.001721.6227.104378.69
    1732022.07.26 22:00sell870.101716.990.001713.68
    1742022.07.27 16:55t/p870.101713.680.001713.6835.024413.70
    1752022.08.15 18:00sell880.101778.820.001774.55
    1762022.08.16 11:13t/p880.101774.550.001774.5544.624458.32
    1772022.08.17 17:45sell890.101766.350.001755.96
    1782022.08.17 23:45sell900.101762.750.001756.66
    1792022.08.18 20:03t/p900.101756.660.001756.6666.644524.96
    1802022.08.18 20:13t/p890.101755.960.001755.96109.654634.61
    1812022.08.19 01:30sell910.101757.740.001755.12
    1822022.08.19 03:38t/p910.101755.120.001755.1226.204660.81
    1832022.08.19 21:30sell920.101748.960.001747.36
    1842022.08.19 21:57t/p920.101747.360.001747.3616.004676.81
    1852022.08.22 03:00sell930.101745.490.001741.80
    1862022.08.22 10:02t/p930.101741.800.001741.8036.904713.71
    1872022.08.22 15:00sell940.101733.070.001728.18
    1882022.08.22 15:46t/p940.101728.180.001728.1848.904762.61
    1892022.08.26 23:15sell950.101737.430.001736.52
    1902022.08.29 01:05t/p950.101736.520.001736.5211.024773.62
    1912022.08.29 02:15sell960.101735.270.001730.05
    1922022.08.29 04:18t/p960.101730.050.001730.0552.204825.82
    1932022.08.29 10:45sell970.101720.470.001712.78
    1942022.08.29 15:51close970.101735.470.001712.78-150.004675.82
    1952022.08.31 16:30sell980.101711.710.001705.47
    1962022.09.01 04:13t/p980.101705.470.001705.4768.144743.97
    1972022.09.01 08:00sell990.101702.760.001697.87
    1982022.09.01 15:42t/p990.101697.870.001697.8748.904792.87
    1992022.09.13 19:15sell1000.101703.670.001698.42
    2002022.09.14 04:21t/p1000.101698.420.001698.4254.414847.28
    2012022.09.15 04:00sell1010.101695.360.001691.36
    2022022.09.15 06:02t/p1010.101691.360.001691.3640.004887.28
    2032022.09.15 14:15sell1020.101684.980.001675.74
    2042022.09.15 17:50t/p1020.101675.740.001675.7492.404979.68
    2052022.09.15 22:15sell1030.101662.930.001656.57
    2062022.09.16 02:15sell1040.101662.860.001660.10
    2072022.09.16 09:33t/p1040.101660.100.001660.1027.605007.28
    2082022.09.16 10:52t/p1030.101656.570.001656.5765.525072.80
    2092022.09.22 09:45sell1050.101658.320.001650.51
    2102022.09.22 11:17close1050.101673.330.001650.51-150.104922.70
    2112022.09.23 18:00sell1060.101643.300.001628.59
    2122022.09.23 21:15sell1070.101643.750.001637.05
    2132022.09.26 03:55t/p1070.101637.050.001637.0568.924991.61
    2142022.09.26 03:58t/p1060.101628.590.001628.59149.015140.63
    2152022.09.26 23:45sell1080.101621.840.001612.14
    2162022.09.27 09:23close1080.101636.840.001612.14-148.094992.54
    2172022.09.28 03:15sell1090.101629.530.001628.51
    2182022.09.28 03:32t/p1090.101628.510.001628.5110.205002.74
    2192022.10.19 18:45sell1100.101631.310.001621.95
    2202022.10.21 06:43t/p1100.101621.950.001621.95101.265104.00
    2212022.10.28 15:47sell1110.101644.000.001634.01
    2222022.10.31 15:30t/p1110.101634.010.001634.01101.825205.82
    2232022.11.01 02:15sell1120.101631.870.001629.43
    2242022.11.01 08:57close1120.101646.880.001629.43-150.105055.72
    2252022.11.03 16:00sell1130.101619.240.001612.94
    2262022.11.04 03:58close1130.101634.250.001612.94-148.194907.53
    2272022.11.21 03:30sell1140.101745.070.001733.52
    2282022.11.21 18:53t/p1140.101733.520.001733.52115.505023.03
    2292022.12.15 10:15sell1150.101782.220.001761.51
    2302022.12.15 15:30sell1160.101774.400.001766.02
    2312022.12.16 16:53close1160.101789.400.001766.02-148.094874.95
    2322022.12.19 05:11close1150.101797.220.001761.51-146.174728.78
    2332023.01.05 22:45sell1170.101833.790.001831.47
    2342023.01.06 15:42close1170.101848.790.001831.47-148.094580.69
    2352023.01.17 09:00sell1180.101906.990.001899.81
    2362023.01.17 12:00sell1190.101906.380.001899.56
    2372023.01.18 05:40t/p1180.101899.810.001899.8173.724654.41
    2382023.01.18 05:41t/p1190.101899.560.001899.5670.124724.52
    2392023.02.10 05:00sell1200.101859.730.001853.61
    2402023.02.10 07:12t/p1200.101853.610.001853.6161.204785.72
    2412023.02.13 23:00sell1210.101854.060.001853.76
    2422023.02.13 23:33t/p1210.101853.760.001853.763.004788.72
    2432023.02.23 03:00sell1220.101824.280.001821.66
    2442023.02.23 15:33t/p1220.101821.660.001821.6626.204814.92
    2452023.02.24 14:15sell1230.101817.100.001808.45
    2462023.02.24 20:15sell1240.101809.770.001804.12
    2472023.02.27 05:40t/p1230.101808.450.001808.4588.424903.34
    2482023.02.28 17:03close1240.101824.770.001804.12-146.174757.17
    2492023.04.03 05:45sell1250.101956.480.001944.75
    2502023.04.03 13:43close1250.101971.490.001944.75-150.104607.07
    2512023.04.17 01:15sell1260.102002.520.001996.13
    2522023.04.17 04:11t/p1260.101996.130.001996.1363.904670.97
    2532023.04.18 01:30sell1270.101993.970.001990.58
    2542023.04.18 17:09close1270.102008.990.001990.58-150.204520.77
    2552023.04.21 15:15sell1280.101983.310.001971.73
    2562023.04.21 16:39close1280.101998.310.001971.73-150.004370.77
    2572023.04.28 15:30sell1290.101980.640.001974.58
    2582023.05.01 09:15sell1300.101981.460.001976.42
    2592023.05.01 15:23close1290.101995.640.001974.58-148.094222.68
    2602023.05.01 15:23close1300.101996.460.001976.42-150.004072.68
    2612023.05.17 16:00sell1310.101984.710.001979.03
    2622023.05.17 16:56t/p1310.101979.030.001979.0356.804129.48
    2632023.05.18 15:00sell1320.101973.960.001967.99
    2642023.05.18 15:33t/p1320.101967.990.001967.9959.704189.18
    2652023.05.18 16:30sell1330.101959.750.001936.53
    2662023.05.18 23:15sell1340.101957.230.001956.86
    2672023.05.19 04:22t/p1340.101956.860.001956.865.624194.80
    2682023.05.19 18:17close1330.101974.770.001936.53-148.284046.51
    2692023.05.23 09:00sell1350.101960.850.001955.81
    2702023.05.23 10:28t/p1350.101955.810.001955.8150.404096.91
    2712023.05.23 13:45sell1360.101955.890.001949.59
    2722023.05.23 16:47close1360.101970.910.001949.59-150.203946.71
    2732023.05.25 04:00sell1370.101959.150.001958.01
    2742023.05.25 04:08t/p1370.101958.010.001958.0111.403958.11
    2752023.06.05 03:30sell1380.101947.180.001943.28
    2762023.06.05 08:18t/p1380.101943.280.001943.2839.003997.11
    2772023.06.07 22:30sell1390.101941.790.001937.49
    2782023.06.08 15:38close1390.101956.790.001937.49-144.253852.86
    2792023.06.15 08:15sell1400.101931.360.001924.67
    2802023.06.15 10:30sell1410.101933.280.001926.98
    2812023.06.15 15:28t/p1410.101926.980.001926.9863.003915.86
    2822023.06.15 16:43close1400.101946.380.001924.67-150.203765.66
    2832023.06.20 23:15sell1420.101935.890.001932.07
    2842023.06.21 09:05t/p1420.101932.070.001932.0740.123805.77
    2852023.06.22 15:15sell1430.101925.870.001920.29
    2862023.06.22 16:09t/p1430.101920.290.001920.2955.803861.57
    2872023.06.22 17:30sell1440.101916.120.001899.52
    2882023.06.23 16:06close1440.101931.130.001899.52-148.193713.39
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..69684cdddb27986c4d3a39caf0199ceebff5826f GIT binary patch literal 8256 zcmch5^;eYN+x1W~GztpRASI0;F{BDeBcjqJ-4fCgLk&H242^UP3=KnfNe)AIH`2_* z=llK-?;UGh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NwH zohjo;rFPAqqF0OkipVd>E#mVLjV1!QVGlM!r!A85*7q#r@%sNvTgR%d>sY=Ic6QU9 zyN$i76E z6r?CgO-vzfVoukgv~|u-WDibkY1UJIgGk96(qsvz?3e0Re6Je&VtuxL6IJQx&dnxU zJ-ED`3oAi;;q47s#w?vi!y#xy=-iF zwP$ab*xdQTjrkjGj+NVWeKRW@M9wjsS8J}F#YPOkk|gg3zevN_^X9Z4g#ZF^#Y-2v zpzRurCn`(Awa+v!;(4P^qVlg>NgJ}eXSfxD*7;x65DV&9o8! os|^3OZ_3+*9F6){Q}XM;)}aZtM0{C4`0LQ6qG`eGB@iI?f6Tet{Qv*} literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.htm new file mode 100644 index 0000000..5d27c1f --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 3.htm @@ -0,0 +1,359 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.06.28 23:45 (2020.01.01 - 2023.06.29)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test61155Ticks modelled69617088Modelling quality40.15%
    Mismatched charts errors30
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit3492.92Gross profit7525.28Gross loss-4032.36
    Profit factor1.87Expected payoff24.09
    Absolute drawdown53.20Maximal drawdown1011.44 (18.56%)Relative drawdown21.55% (321.80)
    Total trades145Short positions (won %)145 (71.72%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)104 (71.72%)Loss trades (% of total)41 (28.28%)
    Largestprofit trade355.53loss trade-100.10
    Averageprofit trade72.36loss trade-98.35
    Maximumconsecutive wins (profit in money)16 (692.04)consecutive losses (loss in money)4 (-400.20)
    Maximalconsecutive profit (count of wins)1140.36 (5)consecutive loss (count of losses)-400.20 (4)
    Averageconsecutive wins4consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.101793.480.001772.09
    22020.11.30 02:30sell20.101783.130.001773.23
    32020.11.30 04:51t/p20.101773.230.001773.2399.001099.00
    42020.11.30 04:51t/p10.101772.090.001772.09215.811314.82
    52021.01.08 11:00sell30.101888.710.001857.17
    62021.01.08 15:15sell40.101882.460.001865.86
    72021.01.08 16:01close40.101892.460.001865.86-100.001214.82
    82021.01.08 16:45sell50.101871.560.001840.06
    92021.01.08 17:09t/p30.101857.170.001857.17315.401530.22
    102021.01.08 18:15sell60.101854.120.001827.81
    112021.01.08 19:33t/p50.101840.060.001840.06315.001845.22
    122021.01.11 02:30sell70.101842.650.001823.57
    132021.01.11 03:21t/p60.101827.810.001827.81265.022110.23
    142021.01.11 03:24t/p70.101823.570.001823.57190.802301.03
    152021.01.27 17:06sell80.101841.520.001836.68
    162021.01.28 03:24t/p80.101836.680.001836.6854.142355.18
    172021.01.28 08:15sell90.101835.080.001828.99
    182021.01.28 15:39close90.101845.080.001828.99-100.002255.18
    192021.02.02 13:45sell100.101845.320.001834.90
    202021.02.02 15:22t/p100.101834.900.001834.90104.202359.38
    212021.02.02 20:45sell110.101835.300.001831.00
    222021.02.03 17:39t/p110.101831.000.001831.0044.912404.29
    232021.02.04 03:15sell120.101832.970.001830.68
    242021.02.04 03:45t/p120.101830.680.001830.6822.902427.19
    252021.02.04 11:30sell130.101815.010.001798.05
    262021.02.04 16:09t/p130.101798.050.001798.05169.602596.79
    272021.02.12 03:00sell140.101823.920.001818.13
    282021.02.12 09:54t/p140.101818.130.001818.1357.902654.69
    292021.02.16 19:45sell150.101797.010.001776.58
    302021.02.17 15:39t/p150.101776.580.001776.58206.222860.91
    312021.02.17 21:15sell160.101774.560.001766.84
    322021.02.18 05:06close160.101784.560.001766.84-94.252766.65
    332021.02.19 02:15sell170.101770.450.001760.93
    342021.02.19 15:52close170.101780.460.001760.93-100.102666.55
    352021.02.24 21:30sell180.101798.290.001796.22
    362021.02.25 04:52t/p180.101796.220.001796.2226.452693.00
    372021.02.25 14:00sell190.101786.660.001774.05
    382021.02.25 17:24t/p190.101774.050.001774.05126.102819.10
    392021.02.25 22:15sell200.101771.510.001759.80
    402021.02.26 07:39t/p200.101759.800.001759.80119.022938.11
    412021.03.05 02:00sell210.101693.980.001684.40
    422021.03.05 16:21close210.101703.980.001684.40-100.002838.11
    432021.03.24 00:15sell220.101727.230.001725.33
    442021.03.24 03:09t/p220.101725.330.001725.3319.002857.11
    452021.03.29 17:30sell230.101707.730.001680.13
    462021.03.30 15:39t/p230.101680.130.001680.13277.923135.03
    472021.04.09 16:15sell240.101732.680.001711.65
    482021.04.09 17:22close240.101742.680.001711.65-100.003035.03
    492021.04.28 08:30sell250.101769.950.001767.06
    502021.04.28 10:09t/p250.101767.060.001767.0628.903063.93
    512021.05.04 23:15sell260.101779.150.001778.25
    522021.05.05 01:09t/p260.101778.250.001778.2510.913074.84
    532021.05.12 22:15sell270.101820.200.001814.22
    542021.05.12 23:24t/p270.101814.220.001814.2259.803134.64
    552021.06.03 17:00sell280.101867.560.001836.48
    562021.06.03 23:15sell290.101870.990.001867.96
    572021.06.04 04:46t/p290.101867.960.001867.9632.223166.86
    582021.06.04 15:36close280.101877.560.001836.48-98.083068.77
    592021.06.10 07:30sell300.101885.380.001881.69
    602021.06.10 10:24t/p300.101881.690.001881.6936.903105.67
    612021.06.10 14:15sell310.101878.470.001873.43
    622021.06.10 15:01t/p310.101873.430.001873.4350.403156.07
    632021.06.14 01:58sell320.101874.070.001872.72
    642021.06.14 03:07t/p320.101872.720.001872.7213.503169.57
    652021.06.14 09:45sell330.101860.600.001852.50
    662021.06.14 15:07t/p330.101852.500.001852.5081.003250.57
    672021.06.28 15:00sell340.101774.390.001767.54
    682021.06.29 14:15t/p340.101767.540.001767.5470.423320.99
    692021.06.29 14:30sell350.101766.840.001758.70
    702021.06.29 15:39t/p350.101758.700.001758.7081.403402.39
    712021.07.27 02:30sell360.101797.120.001795.91
    722021.07.27 04:52t/p360.101795.910.001795.9112.103414.49
    732021.08.02 02:45sell370.101812.650.001810.25
    742021.08.02 04:37t/p370.101810.250.001810.2524.003438.49
    752021.08.05 21:45sell380.101803.280.001798.02
    762021.08.06 01:30sell390.101804.200.001803.39
    772021.08.06 03:04t/p390.101803.390.001803.398.103446.59
    782021.08.06 10:15t/p380.101798.020.001798.0254.523501.10
    792021.08.06 23:15sell400.101760.350.001754.70
    802021.08.09 01:24t/p400.101754.700.001754.7058.413559.52
    812021.08.25 10:30sell410.101792.620.001785.48
    822021.08.25 17:24t/p410.101785.480.001785.4871.403630.92
    832021.09.07 17:15sell420.101800.260.001778.41
    842021.09.10 08:34close420.101800.280.001778.419.383640.29
    852021.09.17 20:45sell430.101750.470.001744.77
    862021.09.20 05:24t/p430.101744.770.001744.7758.913699.21
    872021.09.23 22:45sell440.101748.240.001742.87
    882021.09.23 23:21t/p440.101742.870.001742.8753.703752.91
    892021.10.15 19:30sell450.101768.100.001757.75
    902021.10.15 22:30sell460.101768.170.001767.38
    912021.10.15 23:24t/p460.101767.380.001767.387.903760.81
    922021.10.19 09:03close450.101778.100.001757.75-96.173664.64
    932021.10.26 17:00sell470.101789.760.001773.22
    942021.10.28 05:09close470.101799.760.001773.22-92.343572.30
    952021.11.03 04:00sell480.101783.060.001777.36
    962021.11.03 07:30sell490.101781.540.001779.14
    972021.11.03 08:16t/p490.101779.140.001779.1424.003596.30
    982021.11.03 14:39t/p480.101777.360.001777.3657.003653.30
    992021.11.19 01:45sell500.101858.430.001855.42
    1002021.11.19 10:24t/p500.101855.420.001855.4230.103683.39
    1012021.11.19 19:45sell510.101843.510.001819.38
    1022021.11.22 16:24t/p510.101819.380.001819.38243.223926.61
    1032021.11.22 17:30sell520.101814.950.001779.78
    1042021.11.24 16:09t/p520.101779.780.001779.78355.534282.14
    1052021.12.02 10:00sell530.101775.250.001769.99
    1062021.12.02 10:24t/p530.101769.990.001769.9952.604334.74
    1072021.12.09 15:00sell540.101776.180.001766.13
    1082021.12.10 16:04close540.101786.180.001766.13-98.084236.66
    1092021.12.20 17:00sell550.101791.570.001781.64
    1102021.12.20 20:30sell560.101793.970.001791.36
    1112021.12.20 21:52t/p560.101791.360.001791.3626.104262.76
    1122021.12.22 20:24close550.101801.570.001781.64-96.174166.59
    1132022.01.06 15:00sell570.101791.640.001778.65
    1142022.01.10 13:22close570.101801.640.001778.65-96.174070.42
    1152022.01.18 10:30sell580.101814.210.001808.80
    1162022.01.18 15:09t/p580.101808.800.001808.8054.104124.52
    1172022.01.27 03:54sell590.101815.180.001809.30
    1182022.01.27 13:37t/p590.101809.300.001809.3058.804183.32
    1192022.01.28 17:00sell600.101786.250.001779.25
    1202022.01.31 15:52close600.101796.250.001779.25-98.084085.23
    1212022.02.23 07:15sell610.101896.100.001890.40
    1222022.02.23 10:45sell620.101894.500.001889.54
    1232022.02.23 11:39t/p610.101890.400.001890.4057.004142.23
    1242022.02.23 15:24close620.101904.500.001889.54-100.004042.23
    1252022.03.14 16:15sell630.101954.460.001935.80
    1262022.03.14 20:45sell640.101953.900.001942.16
    1272022.03.15 03:23t/p640.101942.160.001942.16119.324161.55
    1282022.03.15 07:04t/p630.101935.800.001935.80188.514350.06
    1292022.03.15 12:15sell650.101929.500.001921.27
    1302022.03.15 13:00t/p650.101921.270.001921.2782.304432.36
    1312022.04.06 02:51sell660.101920.800.001917.88
    1322022.04.06 04:01t/p660.101917.880.001917.8829.204461.56
    1332022.04.21 18:15sell670.101944.300.001940.78
    1342022.04.21 18:33t/p670.101940.780.001940.7835.204496.76
    1352022.04.22 19:15sell680.101936.670.001930.70
    1362022.04.22 21:30sell690.101933.750.001929.55
    1372022.04.25 01:37t/p680.101930.700.001930.7061.624558.38
    1382022.04.25 03:18t/p690.101929.550.001929.5543.914602.29
    1392022.04.25 13:15sell700.101915.100.001909.24
    1402022.04.25 13:58t/p700.101909.240.001909.2458.604660.89
    1412022.05.09 18:00sell710.101860.370.001848.81
    1422022.05.10 17:47t/p710.101848.810.001848.81117.524778.41
    1432022.05.10 22:30sell720.101841.470.001833.64
    1442022.05.11 02:53t/p720.101833.640.001833.6480.224858.62
    1452022.05.13 01:30sell730.101819.570.001813.17
    1462022.05.13 01:33t/p730.101813.170.001813.1764.004922.62
    1472022.05.31 18:30sell740.101840.860.001825.53
    1482022.05.31 22:00sell750.101840.650.001832.73
    1492022.06.01 07:48t/p750.101832.730.001832.7381.125003.74
    1502022.06.02 09:23close740.101850.860.001825.53-92.344911.40
    1512022.06.06 18:15sell760.101843.240.001831.57
    1522022.06.07 16:53close760.101853.250.001831.57-98.184813.21
    1532022.06.13 21:31sell770.101826.480.001820.66
    1542022.06.13 22:18t/p770.101820.660.001820.6658.204871.41
    1552022.06.22 02:30sell780.101830.550.001827.37
    1562022.06.22 03:39t/p780.101827.370.001827.3731.804903.21
    1572022.06.22 08:00sell790.101825.550.001818.68
    1582022.06.22 14:04close790.101835.560.001818.68-100.104803.11
    1592022.06.24 05:00sell800.101823.760.001821.83
    1602022.06.24 09:48t/p800.101821.830.001821.8319.304822.41
    1612022.06.29 02:00sell810.101819.490.001817.69
    1622022.06.29 09:37t/p810.101817.690.001817.6918.004840.41
    1632022.07.06 01:05sell820.101766.830.001765.11
    1642022.07.06 08:37t/p820.101765.110.001765.1117.204857.61
    1652022.07.06 18:15sell830.101737.520.001697.74
    1662022.07.07 01:45sell840.101738.940.001736.45
    1672022.07.07 08:37close830.101747.530.001697.74-94.354763.26
    1682022.07.07 16:51close840.101748.940.001736.45-100.004663.26
    1692022.07.07 21:30sell850.101740.140.001736.17
    1702022.07.08 02:02sell860.101738.950.001737.03
    1712022.07.08 10:39t/p860.101737.030.001737.0319.204682.46
    1722022.07.08 10:39t/p850.101736.170.001736.1741.624724.07
    1732022.07.13 03:15sell870.101724.330.001721.62
    1742022.07.13 15:31t/p870.101721.620.001721.6227.104751.17
    1752022.07.26 22:00sell880.101716.990.001713.68
    1762022.07.27 16:55t/p880.101713.680.001713.6835.024786.19
    1772022.08.15 18:00sell890.101778.820.001774.55
    1782022.08.16 11:13t/p890.101774.550.001774.5544.624830.80
    1792022.08.17 17:45sell900.101766.350.001755.96
    1802022.08.17 23:45sell910.101762.750.001756.66
    1812022.08.18 20:03t/p910.101756.660.001756.6666.644897.45
    1822022.08.18 20:13t/p900.101755.960.001755.96109.655007.09
    1832022.08.19 01:30sell920.101757.740.001755.12
    1842022.08.19 03:38t/p920.101755.120.001755.1226.205033.29
    1852022.08.19 21:30sell930.101748.960.001747.36
    1862022.08.19 21:57t/p930.101747.360.001747.3616.005049.29
    1872022.08.22 03:00sell940.101745.490.001741.80
    1882022.08.22 10:02t/p940.101741.800.001741.8036.905086.19
    1892022.08.22 15:00sell950.101733.070.001728.18
    1902022.08.22 15:46t/p950.101728.180.001728.1848.905135.09
    1912022.08.26 23:15sell960.101737.430.001736.52
    1922022.08.29 01:05t/p960.101736.520.001736.5211.025146.11
    1932022.08.29 02:15sell970.101735.270.001730.05
    1942022.08.29 04:18t/p970.101730.050.001730.0552.205198.31
    1952022.08.29 10:45sell980.101720.470.001712.78
    1962022.08.29 15:22close980.101730.480.001712.78-100.105098.21
    1972022.08.31 16:30sell990.101711.710.001705.47
    1982022.08.31 17:28close990.101721.710.001705.47-100.004998.21
    1992022.09.01 08:00sell1000.101702.760.001697.87
    2002022.09.01 15:42t/p1000.101697.870.001697.8748.905047.11
    2012022.09.13 19:15sell1010.101703.670.001698.42
    2022022.09.14 04:21t/p1010.101698.420.001698.4254.415101.52
    2032022.09.15 04:00sell1020.101695.360.001691.36
    2042022.09.15 06:02t/p1020.101691.360.001691.3640.005141.52
    2052022.09.15 14:15sell1030.101684.980.001675.74
    2062022.09.15 17:50t/p1030.101675.740.001675.7492.405233.92
    2072022.09.15 22:15sell1040.101662.930.001656.57
    2082022.09.16 02:15sell1050.101662.860.001660.10
    2092022.09.16 09:33t/p1050.101660.100.001660.1027.605261.52
    2102022.09.16 10:52t/p1040.101656.570.001656.5765.525327.04
    2112022.09.22 09:45sell1060.101658.320.001650.51
    2122022.09.22 11:15close1060.101668.320.001650.51-100.005227.04
    2132022.09.23 18:00sell1070.101643.300.001628.59
    2142022.09.23 21:15sell1080.101643.750.001637.05
    2152022.09.26 03:55t/p1080.101637.050.001637.0568.925295.95
    2162022.09.26 03:58t/p1070.101628.590.001628.59149.015444.97
    2172022.09.26 23:45sell1090.101621.840.001612.14
    2182022.09.27 04:02close1090.101631.840.001612.14-98.085346.88
    2192022.09.28 03:15sell1100.101629.530.001628.51
    2202022.09.28 03:32t/p1100.101628.510.001628.5110.205357.08
    2212022.10.19 18:45sell1110.101631.310.001621.95
    2222022.10.20 17:21close1110.101641.310.001621.95-94.255262.83
    2232022.10.28 15:47sell1120.101644.000.001634.01
    2242022.10.31 15:30t/p1120.101634.010.001634.01101.825364.64
    2252022.11.01 02:15sell1130.101631.870.001629.43
    2262022.11.01 07:48close1130.101641.870.001629.43-100.005264.64
    2272022.11.03 16:00sell1140.101619.240.001612.94
    2282022.11.03 16:51close1140.101629.240.001612.94-100.005164.64
    2292022.11.21 03:30sell1150.101745.070.001733.52
    2302022.11.21 18:53t/p1150.101733.520.001733.52115.505280.14
    2312022.12.15 10:15sell1160.101782.220.001761.51
    2322022.12.15 15:30sell1170.101774.400.001766.02
    2332022.12.15 16:22close1170.101784.400.001766.02-100.005180.14
    2342022.12.16 16:57close1160.101792.230.001761.51-98.185081.95
    2352023.01.05 22:45sell1180.101833.790.001831.47
    2362023.01.06 15:33close1180.101843.800.001831.47-98.184983.77
    2372023.01.17 09:00sell1190.101906.990.001899.81
    2382023.01.17 12:00sell1200.101906.380.001899.56
    2392023.01.17 16:12close1200.101916.380.001899.56-100.004883.77
    2402023.01.18 05:40t/p1190.101899.810.001899.8173.724957.48
    2412023.02.10 05:00sell1210.101859.730.001853.61
    2422023.02.10 07:12t/p1210.101853.610.001853.6161.205018.68
    2432023.02.13 23:00sell1220.101854.060.001853.76
    2442023.02.13 23:33t/p1220.101853.760.001853.763.005021.68
    2452023.02.23 03:00sell1230.101824.280.001821.66
    2462023.02.23 15:33t/p1230.101821.660.001821.6626.205047.88
    2472023.02.24 14:15sell1240.101817.100.001808.45
    2482023.02.24 20:15sell1250.101809.770.001804.12
    2492023.02.27 05:40t/p1240.101808.450.001808.4588.425136.30
    2502023.02.27 17:03close1250.101819.770.001804.12-98.085038.21
    2512023.04.03 05:45sell1260.101956.480.001944.75
    2522023.04.03 11:53close1260.101966.490.001944.75-100.104938.11
    2532023.04.17 01:15sell1270.102002.520.001996.13
    2542023.04.17 04:11t/p1270.101996.130.001996.1363.905002.01
    2552023.04.18 01:30sell1280.101993.970.001990.58
    2562023.04.18 10:36close1280.102003.980.001990.58-100.104901.91
    2572023.04.21 15:15sell1290.101983.310.001971.73
    2582023.04.21 16:18close1290.101993.320.001971.73-100.104801.81
    2592023.04.28 15:30sell1300.101980.640.001974.58
    2602023.04.28 17:38close1300.101990.640.001974.58-100.004701.81
    2612023.05.01 09:15sell1310.101981.460.001976.42
    2622023.05.01 15:14close1310.101991.460.001976.42-100.004601.81
    2632023.05.17 16:00sell1320.101984.710.001979.03
    2642023.05.17 16:56t/p1320.101979.030.001979.0356.804658.61
    2652023.05.18 15:00sell1330.101973.960.001967.99
    2662023.05.18 15:33t/p1330.101967.990.001967.9959.704718.31
    2672023.05.18 16:30sell1340.101959.750.001936.53
    2682023.05.18 23:15sell1350.101957.230.001956.86
    2692023.05.19 04:22t/p1350.101956.860.001956.865.624723.93
    2702023.05.19 18:15close1340.101969.760.001936.53-98.184625.74
    2712023.05.23 09:00sell1360.101960.850.001955.81
    2722023.05.23 10:28t/p1360.101955.810.001955.8150.404676.14
    2732023.05.23 13:45sell1370.101955.890.001949.59
    2742023.05.23 16:17close1370.101965.900.001949.59-100.104576.04
    2752023.05.25 04:00sell1380.101959.150.001958.01
    2762023.05.25 04:08t/p1380.101958.010.001958.0111.404587.44
    2772023.06.05 03:30sell1390.101947.180.001943.28
    2782023.06.05 08:18t/p1390.101943.280.001943.2839.004626.44
    2792023.06.07 22:30sell1400.101941.790.001937.49
    2802023.06.08 15:30close1400.101951.790.001937.49-94.254532.19
    2812023.06.15 08:15sell1410.101931.360.001924.67
    2822023.06.15 10:30sell1420.101933.280.001926.98
    2832023.06.15 15:28t/p1420.101926.980.001926.9863.004595.19
    2842023.06.15 16:26close1410.101941.370.001924.67-100.104495.09
    2852023.06.20 23:15sell1430.101935.890.001932.07
    2862023.06.21 09:05t/p1430.101932.070.001932.0740.124535.20
    2872023.06.22 15:15sell1440.101925.870.001920.29
    2882023.06.22 16:09t/p1440.101920.290.001920.2955.804591.00
    2892023.06.22 17:30sell1450.101916.120.001899.52
    2902023.06.23 15:47close1450.101926.120.001899.52-98.084492.92
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 4.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..74f9b491442ac2bb3990fb75e620af8e5f88432e GIT binary patch literal 8156 zcmch5^U7y z2x$z4VF7m=hr`0acM#I}j(HaXa99i&P!70zz?lEX!yUoE{{sO1$h#yMgZ&>705C@0 zN$!$Yz_2i5W569~3c!@6PVt{=wnV z@yY4g`9V2e2L8=$`ai(!Us~9rlrj-D>ufA+Nk)m{vBUsv)UxcS2ZFcQb7;1-51S-Z zogsQvF6gOhdTe6!nnEbQQOh_(OkS^saQ4Pow+VOhTr&ImD2tI z&th9U|LrJ$*V$>#Ow4Sd=Wp=d>>Px@+qetQ-v}EN$dRuHtj3rb64?QlnA-6F*b@XZ zNc+eF8lQe(c{EHW$kWZ)kq+dOt9)8Rry^w?+fl_{!=gUW`Z{IL=g*J9Njlp?LOHg_ zb)5# z+*m4Tb)o?3nx9EONyfp)iAPSXvc>@;=sL*8dpWSkfTMVGqtyp`flsvnp~b+aiJ4{r zQt{l2Fal!mPMaSaofzXUPj!uTDN2r;2i}y#dt*~$nO^cj+aG{-2^GerZ>;54yzGhBdo@o`Hin&?V zy=16)e&Ll=7o`NPpia(A2V%1%cWD|yU8>Q`ORzy)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0zDhf~q%Y2p<5n+Y->DigOD6Wn zpAp8CebTx0jP2FRtBC1O?dB=cVvymq=WMb3sU())pW!l;5a*ydL3h@HkdxyX$8OBi zX^(vE=E&+t<1>85M?uc^)Bf@Hy?c~2?0HtA(oMD{@;MnkE9)TpBVwXb& n7-j)kVcD + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.29 23:45 (2020.01.01 - 2021.04.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.01; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test9971Ticks modelled11845786Modelling quality24.76%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (56)
    Total net profit8.71Gross profit110.01Gross loss-101.30
    Profit factor1.09Expected payoff0.41
    Absolute drawdown21.07Maximal drawdown82.19 (7.75%)Relative drawdown7.75% (82.19)
    Total trades21Short positions (won %)0 (0.00%)Long positions (won %)21 (52.38%)
    Profit trades (% of total)11 (52.38%)Loss trades (% of total)10 (47.62%)
    Largestprofit trade14.87loss trade-11.30
    Averageprofit trade10.00loss trade-10.13
    Maximumconsecutive wins (profit in money)5 (56.63)consecutive losses (loss in money)7 (-71.30)
    Maximalconsecutive profit (count of wins)56.63 (5)consecutive loss (count of losses)-71.30 (7)
    Averageconsecutive wins3consecutive losses3
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 16:16buy10.011847.830.001863.25
    22020.12.04 17:09close10.011837.830.001863.25-10.00990.00
    32020.12.08 10:33buy20.011867.410.001873.98
    42020.12.08 16:39t/p20.011873.980.001873.986.57996.57
    52020.12.16 10:45buy30.011860.720.001871.43
    62020.12.16 15:22close30.011850.720.001871.43-10.00986.57
    72020.12.16 21:49buy40.011857.510.001873.44
    82020.12.17 09:39t/p40.011873.440.001873.4414.631001.20
    92020.12.24 16:52buy50.011876.490.001883.23
    102020.12.28 01:00t/p50.011883.230.001883.235.881007.08
    112021.01.08 16:00buy60.011891.260.001912.92
    122021.01.08 16:36close60.011881.260.001912.92-10.00997.08
    132021.01.11 16:45buy70.011839.580.001854.88
    142021.01.12 07:36t/p70.011854.880.001854.8814.871011.95
    152021.01.12 20:15buy80.011844.180.001853.53
    162021.01.12 21:24t/p80.011853.530.001853.539.351021.30
    172021.01.14 10:00buy90.011842.170.001850.63
    182021.01.14 16:30t/p90.011850.630.001850.638.461029.76
    192021.02.05 15:45buy100.011803.570.001818.12
    202021.02.08 01:09t/p100.011818.120.001818.1214.121043.88
    212021.02.10 15:15buy110.011844.680.001854.51
    222021.02.10 15:39t/p110.011854.510.001854.519.831053.71
    232021.02.16 17:15buy120.011806.790.001832.11
    242021.02.16 18:54close120.011796.790.001832.11-10.001043.71
    252021.02.24 12:45buy130.011808.580.001816.34
    262021.02.24 15:39close130.011798.580.001816.34-10.001033.71
    272021.02.25 16:45buy140.011786.940.001799.20
    282021.02.25 17:07close140.011776.940.001799.20-10.001023.71
    292021.02.26 12:45buy150.011767.160.001774.12
    302021.02.26 16:37close150.011757.160.001774.12-10.001013.71
    312021.03.03 18:04buy160.011718.110.001739.20
    322021.03.04 01:33close160.011708.110.001739.20-11.301002.41
    332021.03.04 12:00buy170.011715.570.001729.07
    342021.03.04 19:24close170.011705.570.001729.07-10.00992.41
    352021.03.11 15:00buy180.011736.230.001744.48
    362021.03.11 16:22close180.011726.230.001744.48-10.00982.41
    372021.03.31 15:45buy190.011689.230.001699.06
    382021.03.31 17:18t/p190.011699.060.001699.069.83992.24
    392021.04.13 14:15buy200.011730.150.001737.89
    402021.04.13 15:39t/p200.011737.890.001737.897.74999.98
    412021.04.15 15:15buy210.011750.780.001759.51
    422021.04.15 17:06t/p210.011759.510.001759.518.731008.71
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..d83c6886e8d04de06e993938778af9ba50f4ab83 GIT binary patch literal 9238 zcmch+_dna;|2`f&R#B~8RXR|*t=OtHit?=5Rch3#+A~JX1R-|pEwOjR-g{Go*n6+q zR6bts@Bi>Ux5v4i^SJKUb=~jx$K$ti6qG)SiW$En=?1I;00aU7008v&_Y*LEAjA>I z+#GWYVa!1YJm7W`2zUhO7Q&d{GH+jEatljf+PnBqk-Nq^6~3WM*aOCqXIFPmZ(skw;Lva((b%8yiAmhlG=64wZhm2LX?bOJZGB^NYkOyR zZ~x%%=DfUkQ5x~}P3k|u&GtRSf{Yp&1LsT(Vo^?&_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pTk zx`U-#0wyAZr)3?;Bi(&PgUG9cHM$rPD}GQ#rT#9)`7S`26O^0?M*hk*3h4;_>0Zig zhZKQLYJaj)bU{Z#<=s4}nxVSu&QF*>g<3cO+u2-!pQIyUXTE`EXg?D)qXbb%`Mcmg ztq?sFR2v-{&#Qz+hb@%CQo2K>Ux$@IL&LDJ=JQZj4H(t}lFt%qf`d6AIrLZpUSh+9 z(e!Q*M-SKVYEk-KD5Ls8FfWTTtrMA3WEej9*NP%t-A2Sg*T)(hR9Xb_2o1Z$hFXe{ zok5+j=)eO}xPc-ecxwaxN(b7(684K3v1t@Ai3vPH(+&dZiXTN?Ala^PcOJq3)U429 z3kSIc1bRKvY$Nb)UgUEp#JplCUtV-O`ayA*|8f^GnONi&I^gRhy!0MyzMAdRg`eHy z7#awS1Luij@+2p6^h3mwA1Xg~r|apG`*;z-fsK{diBX}98A69ULT(R#{l2(In&BdM z5PqUlv0^>3I#ZCnR{<5kxaXUpUu)nVVxNF^acniQ6&vvEvQr`X-r zVege76Lv7+>NsQ82Pj+&e$vToGQJ+DfMktL)^ShMrE9CC-D8PJrA$&_QTUUQK+LKD zjZY#&dOC_ShiFtgk9Hwh-5AFquDN2~T|EG7USelY0yZJCQTIWvZc>tNN)BJrA9ruN zfTX^j1gi^|g@hDEisa&+JA<1ER!XS@?ucGk%3e)U8zp39DsfEA@ggtnsweH=W*UJq eorpi3L^++zDxD%Eoiab2x;LFR!~p^Ti2pxeq`ZUx literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.htm new file mode 100644 index 0000000..f8de3e0 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 5.htm @@ -0,0 +1,443 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.29 23:45 (2020.01.01 - 2021.04.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.01; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test9971Ticks modelled11845786Modelling quality24.76%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit-306.00Gross profit601.23Gross loss-907.24
    Profit factor0.66Expected payoff-1.64
    Absolute drawdown321.14Maximal drawdown390.59 (36.52%)Relative drawdown36.52% (390.59)
    Total trades187Short positions (won %)0 (0.00%)Long positions (won %)187 (51.87%)
    Profit trades (% of total)97 (51.87%)Loss trades (% of total)90 (48.13%)
    Largestprofit trade30.74loss trade-11.76
    Averageprofit trade6.20loss trade-10.08
    Maximumconsecutive wins (profit in money)12 (96.08)consecutive losses (loss in money)12 (-123.06)
    Maximalconsecutive profit (count of wins)96.08 (12)consecutive loss (count of losses)-123.06 (12)
    Averageconsecutive wins3consecutive losses3
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 02:09buy10.011810.440.001811.73
    22020.11.27 02:25t/p10.011811.730.001811.731.291001.29
    32020.11.27 03:30buy20.011811.060.001814.56
    42020.11.27 10:00buy30.011810.750.001815.55
    52020.11.27 15:06close20.011801.060.001814.56-10.00991.29
    62020.11.27 15:06close30.011800.750.001815.55-10.00981.29
    72020.11.27 18:45buy40.011786.120.001794.93
    82020.11.30 04:46close40.011776.120.001794.93-10.43970.86
    92020.11.30 09:06buy50.011776.090.001788.74
    102020.11.30 12:54close50.011766.070.001788.74-10.02960.84
    112020.11.30 16:30buy60.011777.020.001791.89
    122020.11.30 18:31buy70.011780.130.001793.69
    132020.12.01 03:09buy80.011780.300.001784.10
    142020.12.01 04:30buy90.011781.750.001787.41
    152020.12.01 05:21t/p80.011784.100.001784.103.80964.64
    162020.12.01 06:00buy100.011784.870.001790.09
    172020.12.01 07:54t/p90.011787.410.001787.415.66970.30
    182020.12.01 07:54buy110.011788.060.001791.06
    192020.12.01 09:51t/p100.011790.090.001790.095.22975.52
    202020.12.01 09:54t/p110.011791.060.001791.063.00978.52
    212020.12.01 10:06t/p60.011791.890.001791.8914.44992.96
    222020.12.01 10:09t/p70.011793.690.001793.6913.131006.08
    232020.12.01 10:51buy120.011793.660.001801.97
    242020.12.01 12:24buy130.011798.150.001804.09
    252020.12.01 13:01t/p120.011801.970.001801.978.311014.39
    262020.12.01 13:04t/p130.011804.090.001804.095.941020.33
    272020.12.01 13:45buy140.011805.830.001821.94
    282020.12.01 15:52buy150.011811.350.001818.34
    292020.12.01 20:07buy160.011815.240.001821.95
    302020.12.02 08:54buy170.011813.760.001821.83
    312020.12.02 10:34t/p150.011818.340.001818.346.561026.89
    322020.12.02 10:37t/p170.011821.830.001821.838.071034.96
    332020.12.02 10:37t/p140.011821.940.001821.9415.681050.64
    342020.12.02 10:37t/p160.011821.950.001821.956.281056.92
    352020.12.02 12:00buy180.011825.320.001837.29
    362020.12.02 13:30buy190.011829.210.001836.56
    372020.12.02 14:45close190.011819.210.001836.56-10.001046.92
    382020.12.02 15:52close180.011815.320.001837.29-10.001036.92
    392020.12.02 18:00buy200.011826.780.001845.77
    402020.12.02 21:39buy210.011830.220.001835.23
    412020.12.03 01:37buy220.011831.390.001833.90
    422020.12.03 05:22t/p220.011833.900.001833.902.511039.43
    432020.12.03 05:24t/p210.011835.230.001835.233.711043.14
    442020.12.03 05:30buy230.011835.100.001847.61
    452020.12.03 10:00buy240.011842.740.001860.47
    462020.12.03 14:00buy250.011842.780.001854.24
    472020.12.03 16:49close250.011832.780.001854.24-10.001033.14
    482020.12.03 16:49close240.011832.740.001860.47-10.001023.14
    492020.12.03 18:09close230.011825.090.001847.61-10.011013.13
    502020.12.03 20:15buy260.011839.010.001851.48
    512020.12.03 21:54buy270.011840.490.001847.41
    522020.12.04 05:15buy280.011843.550.001851.40
    532020.12.04 15:31t/p200.011845.770.001845.7717.261030.40
    542020.12.04 15:33t/p270.011847.410.001847.416.491036.89
    552020.12.04 15:39close280.011833.540.001851.40-10.011026.88
    562020.12.04 16:45buy290.011846.380.001866.11
    572020.12.04 17:21close290.011836.380.001866.11-10.001016.88
    582020.12.04 17:54close260.011829.010.001851.48-10.431006.44
    592020.12.04 21:24buy300.011837.090.001839.27
    602020.12.07 01:03buy310.011838.260.001840.35
    612020.12.07 03:30buy320.011837.430.001841.09
    622020.12.07 05:03t/p300.011839.270.001839.271.751008.19
    632020.12.07 06:15buy330.011839.640.001844.52
    642020.12.07 07:24t/p310.011840.350.001840.352.091010.28
    652020.12.07 07:49t/p320.011841.090.001841.093.661013.94
    662020.12.07 07:51buy340.011841.920.001848.45
    672020.12.07 10:30close340.011831.920.001848.45-10.001003.94
    682020.12.07 10:31close330.011829.630.001844.52-10.01993.93
    692020.12.07 15:30buy350.011835.000.001843.33
    702020.12.07 16:36t/p350.011843.330.001843.338.331002.26
    712020.12.07 18:30buy360.011866.190.001879.98
    722020.12.08 15:30buy370.011865.640.001871.60
    732020.12.08 15:46t/p370.011871.600.001871.605.961008.22
    742020.12.08 17:00buy380.011870.460.001879.15
    752020.12.08 19:52buy390.011873.330.001882.39
    762020.12.09 05:22close390.011863.330.001882.39-10.43997.79
    772020.12.09 05:39close380.011860.450.001879.15-10.44987.35
    782020.12.09 06:07close360.011856.190.001879.98-10.86976.49
    792020.12.09 08:30buy400.011863.150.001870.85
    802020.12.09 11:00buy410.011864.960.001874.88
    812020.12.09 13:39close410.011854.950.001874.88-10.01966.48
    822020.12.09 13:39close400.011853.150.001870.85-10.00956.48
    832020.12.09 15:45buy420.011861.950.001871.84
    842020.12.09 16:30close420.011851.950.001871.84-10.00946.48
    852020.12.09 23:24buy430.011839.400.001850.02
    862020.12.10 11:09close430.011829.390.001850.02-11.31935.17
    872020.12.10 15:34buy440.011841.850.001850.34
    882020.12.10 17:00buy450.011848.090.001862.46
    892020.12.10 17:39close450.011838.090.001862.46-10.00925.17
    902020.12.10 18:16close440.011831.840.001850.34-10.01915.16
    912020.12.11 02:08buy460.011839.630.001842.11
    922020.12.11 03:37buy470.011839.750.001843.56
    932020.12.11 12:15buy480.011837.330.001845.70
    942020.12.11 13:04close470.011829.750.001843.56-10.00905.16
    952020.12.11 13:04close460.011829.630.001842.11-10.00895.16
    962020.12.11 13:21close480.011827.330.001845.70-10.00885.16
    972020.12.11 15:30buy490.011836.350.001844.41
    982020.12.11 17:00buy500.011841.550.001851.09
    992020.12.11 17:09t/p490.011844.410.001844.418.06893.22
    1002020.12.11 18:30buy510.011844.760.001852.85
    1012020.12.14 03:09close510.011834.760.001852.85-10.43882.79
    1022020.12.14 10:19close500.011831.540.001851.09-10.44872.35
    1032020.12.14 16:00buy520.011833.090.001848.96
    1042020.12.14 18:39close520.011823.090.001848.96-10.00862.35
    1052020.12.15 04:15buy530.011831.990.001841.29
    1062020.12.15 07:34buy540.011837.510.001839.57
    1072020.12.15 07:45t/p540.011839.570.001839.572.06864.41
    1082020.12.15 09:00buy550.011840.410.001847.70
    1092020.12.15 09:07t/p530.011841.290.001841.299.30873.71
    1102020.12.15 10:30buy560.011843.850.001849.61
    1112020.12.15 12:09buy570.011847.580.001851.23
    1122020.12.15 14:24t/p550.011847.700.001847.707.29881.00
    1132020.12.15 15:08t/p560.011849.610.001849.615.76886.76
    1142020.12.15 15:15buy580.011849.690.001860.15
    1152020.12.15 15:31t/p570.011851.230.001851.233.65890.41
    1162020.12.15 21:09buy590.011853.210.001858.03
    1172020.12.16 04:37buy600.011857.600.001862.48
    1182020.12.16 04:46t/p590.011858.030.001858.034.39894.80
    1192020.12.16 10:39t/p580.011860.150.001860.1510.03904.82
    1202020.12.16 11:00buy610.011862.080.001874.91
    1212020.12.16 11:19t/p600.011862.480.001862.484.88909.70
    1222020.12.16 12:37buy620.011863.200.001864.96
    1232020.12.16 13:15t/p620.011864.960.001864.961.76911.46
    1242020.12.16 15:22close610.011852.080.001874.91-10.00901.46
    1252020.12.16 23:30buy630.011863.700.001868.61
    1262020.12.17 03:30buy640.011866.400.001871.70
    1272020.12.17 06:39buy650.011868.410.001873.65
    1282020.12.17 07:51t/p630.011868.610.001868.613.61905.08
    1292020.12.17 08:03buy660.011870.640.001875.74
    1302020.12.17 09:09t/p640.011871.700.001871.705.30910.38
    1312020.12.17 09:36buy670.011872.780.001877.58
    1322020.12.17 09:39t/p650.011873.650.001873.655.24915.62
    1332020.12.17 10:19t/p660.011875.740.001875.745.10920.72
    1342020.12.17 10:22t/p670.011877.580.001877.584.80925.52
    1352020.12.17 11:00buy680.011879.030.001891.30
    1362020.12.17 14:34buy690.011879.450.001884.46
    1372020.12.17 15:37t/p690.011884.460.001884.465.01930.53
    1382020.12.17 16:00buy700.011888.140.001908.05
    1392020.12.17 16:36t/p680.011891.300.001891.3012.27942.80
    1402020.12.17 17:53buy710.011893.460.001899.78
    1412020.12.17 19:18close710.011883.460.001899.78-10.00932.80
    1422020.12.18 06:54buy720.011885.460.001887.97
    1432020.12.18 10:09close700.011878.140.001908.05-10.43922.37
    1442020.12.18 14:09t/p720.011887.970.001887.972.51924.88
    1452020.12.18 14:15buy730.011887.860.001902.08
    1462020.12.18 16:54close730.011877.860.001902.08-10.00914.88
    1472020.12.21 01:15buy740.011884.030.001891.23
    1482020.12.21 03:06t/p740.011891.230.001891.237.20922.08
    1492020.12.21 07:00buy750.011900.140.001909.13
    1502020.12.21 08:30buy760.011906.870.001918.32
    1512020.12.21 08:54close760.011896.870.001918.32-10.00912.08
    1522020.12.21 11:49close750.011890.130.001909.13-10.01902.07
    1532020.12.21 15:00buy770.011879.950.001891.61
    1542020.12.21 16:45buy780.011881.210.001895.00
    1552020.12.22 08:51close780.011871.210.001895.00-10.43891.64
    1562020.12.22 08:52close770.011869.940.001891.61-10.44881.19
    1572020.12.22 13:00buy790.011873.050.001877.78
    1582020.12.22 14:39buy800.011875.310.001882.09
    1592020.12.22 15:24t/p790.011877.780.001877.784.73885.92
    1602020.12.22 16:00buy810.011879.160.001890.80
    1612020.12.22 17:49close810.011869.160.001890.80-10.00875.92
    1622020.12.22 17:52close800.011865.300.001882.09-10.01865.91
    1632020.12.23 02:54buy820.011864.010.001866.14
    1642020.12.23 03:09t/p820.011866.140.001866.142.13868.04
    1652020.12.23 10:22buy830.011868.900.001874.32
    1662020.12.23 14:07close830.011858.890.001874.32-10.01858.03
    1672020.12.23 16:15buy840.011868.730.001880.43
    1682020.12.24 03:09buy850.011876.100.001879.48
    1692020.12.24 04:30buy860.011879.130.001888.64
    1702020.12.24 04:39t/p850.011879.480.001879.483.38861.41
    1712020.12.24 10:09buy870.011879.050.001880.81
    1722020.12.24 11:30buy880.011878.210.001881.48
    1732020.12.24 20:15t/p840.011880.430.001880.4310.40871.82
    1742020.12.24 20:15t/p870.011880.810.001880.811.76873.58
    1752020.12.24 20:15t/p880.011881.480.001881.483.27876.85
    1762020.12.28 01:39t/p860.011888.640.001888.648.65885.50
    1772020.12.28 03:01buy890.011890.380.001892.75
    1782020.12.28 03:04t/p890.011892.750.001892.752.37887.87
    1792020.12.28 04:30buy900.011897.560.001912.50
    1802020.12.28 07:39close900.011887.560.001912.50-10.00877.87
    1812020.12.28 15:45buy910.011885.830.001902.57
    1822020.12.28 17:15buy920.011893.820.001906.57
    1832020.12.28 17:51close920.011883.810.001906.57-10.01867.86
    1842020.12.28 19:37close910.011875.820.001902.57-10.01857.85
    1852020.12.29 03:04buy930.011880.640.001886.52
    1862020.12.29 06:01buy940.011880.880.001887.50
    1872020.12.29 10:03buy950.011881.740.001887.89
    1882020.12.29 11:31buy960.011880.610.001886.03
    1892020.12.29 17:09close950.011871.730.001887.89-10.01847.84
    1902020.12.29 18:39t/p960.011886.030.001886.035.42853.26
    1912020.12.29 19:15buy970.011880.650.001884.22
    1922020.12.30 03:06buy980.011881.250.001885.50
    1932020.12.30 05:07t/p970.011884.220.001884.223.14856.39
    1942020.12.30 06:06buy990.011885.320.001888.11
    1952020.12.30 06:09t/p980.011885.500.001885.504.25860.64
    1962020.12.30 13:30buy1000.011880.600.001884.74
    1972020.12.30 16:03t/p1000.011884.740.001884.744.14864.78
    1982020.12.30 16:54t/p930.011886.520.001886.525.45870.23
    1992020.12.30 16:54t/p940.011887.500.001887.506.19876.42
    2002020.12.30 17:15buy1010.011886.150.001896.14
    2012020.12.30 19:00buy1020.011887.170.001892.09
    2022020.12.30 19:37t/p990.011888.110.001888.112.79879.21
    2032020.12.30 20:30buy1030.011889.690.001896.32
    2042020.12.30 22:23buy1040.011892.230.001894.83
    2052020.12.30 22:50t/p1020.011892.090.001892.094.92884.13
    2062020.12.30 23:45buy1050.011894.150.001898.10
    2072020.12.31 01:16t/p1040.011894.830.001894.831.30885.44
    2082020.12.31 03:04t/p1010.011896.140.001896.148.69894.13
    2092020.12.31 03:04t/p1030.011896.320.001896.325.33899.46
    2102020.12.31 03:06buy1060.011897.490.001901.03
    2112020.12.31 03:07t/p1050.011898.100.001898.102.65902.12
    2122020.12.31 05:15close1060.011887.490.001901.03-10.00892.12
    2132020.12.31 09:45buy1070.011893.890.001905.40
    2142020.12.31 11:18buy1080.011894.830.001900.25
    2152020.12.31 15:37buy1090.011897.920.001904.27
    2162020.12.31 17:30buy1100.011899.440.001908.56
    2172021.01.04 01:00t/p1070.011905.400.001905.4010.65902.77
    2182021.01.04 01:00t/p1080.011900.250.001900.254.56907.32
    2192021.01.04 01:00t/p1090.011904.270.001904.275.49912.81
    2202021.01.04 01:00t/p1100.011908.560.001908.568.26921.07
    2212021.01.04 01:34buy1110.011912.570.001943.31
    2222021.01.04 03:00buy1120.011913.800.001919.76
    2232021.01.04 04:30buy1130.011918.770.001928.16
    2242021.01.04 04:49t/p1120.011919.760.001919.765.96927.03
    2252021.01.04 10:09t/p1130.011928.160.001928.169.39936.42
    2262021.01.04 10:22buy1140.011932.800.001940.78
    2272021.01.04 15:37t/p1140.011940.780.001940.787.98944.40
    2282021.01.04 15:38buy1150.011942.350.001953.36
    2292021.01.04 16:48t/p1110.011943.310.001943.3130.74975.14
    2302021.01.04 17:15close1150.011932.340.001953.36-10.01965.13
    2312021.01.05 05:30buy1160.011942.070.001949.68
    2322021.01.05 09:30buy1170.011943.880.001953.78
    2332021.01.05 11:06buy1180.011943.810.001948.31
    2342021.01.05 12:37buy1190.011945.890.001950.75
    2352021.01.05 13:21t/p1180.011948.310.001948.314.50969.63
    2362021.01.05 13:54t/p1160.011949.680.001949.687.61977.24
    2372021.01.05 14:00buy1200.011950.270.001958.99
    2382021.01.05 15:45t/p1190.011950.750.001950.754.86982.10
    2392021.01.05 16:07buy1210.011950.450.001956.36
    2402021.01.05 17:07close1210.011940.450.001956.36-10.00972.10
    2412021.01.05 17:07close1200.011940.270.001958.99-10.00962.10
    2422021.01.05 19:15buy1220.011950.140.001960.64
    2432021.01.05 21:00buy1230.011951.580.001955.86
    2442021.01.06 02:24buy1240.011951.770.001953.78
    2452021.01.06 03:07t/p1170.011953.780.001953.789.47971.56
    2462021.01.06 03:07t/p1240.011953.780.001953.782.01973.57
    2472021.01.06 06:09close1230.011941.580.001955.86-10.43963.14
    2482021.01.06 08:18buy1250.011946.670.001952.46
    2492021.01.06 09:45buy1260.011947.850.001954.12
    2502021.01.06 10:37t/p1250.011952.460.001952.465.79968.93
    2512021.01.06 10:39t/p1260.011954.120.001954.126.27975.20
    2522021.01.06 11:30buy1270.011955.760.001969.71
    2532021.01.06 13:57close1270.011945.760.001969.71-10.00965.20
    2542021.01.06 14:34close1220.011940.130.001960.64-10.44954.76
    2552021.01.06 21:37buy1280.011918.110.001929.57
    2562021.01.06 23:07buy1290.011920.670.001927.90
    2572021.01.07 12:30close1290.011910.670.001927.90-11.30943.47
    2582021.01.07 16:39close1280.011908.110.001929.57-11.30932.17
    2592021.01.07 18:45buy1300.011914.660.001919.58
    2602021.01.07 21:15buy1310.011916.460.001925.07
    2612021.01.08 06:39close1310.011906.450.001925.07-10.44921.73
    2622021.01.08 09:54close1300.011904.650.001919.58-10.44911.29
    2632021.01.11 17:45buy1320.011848.660.001877.66
    2642021.01.12 05:00buy1330.011847.670.001855.01
    2652021.01.12 06:54buy1340.011851.050.001852.27
    2662021.01.12 07:31t/p1340.011852.270.001852.271.22912.51
    2672021.01.12 07:37t/p1330.011855.010.001855.017.34919.85
    2682021.01.12 08:15buy1350.011856.450.001867.30
    2692021.01.12 10:03buy1360.011862.090.001867.25
    2702021.01.12 12:30buy1370.011862.060.001871.99
    2712021.01.12 15:22close1360.011852.090.001867.25-10.00909.85
    2722021.01.12 15:22close1370.011852.050.001871.99-10.01899.84
    2732021.01.12 15:37close1350.011846.450.001867.30-10.00889.84
    2742021.01.12 16:09close1320.011838.650.001877.66-10.44879.40
    2752021.01.12 21:15buy1380.011851.380.001871.21
    2762021.01.12 22:47buy1390.011855.090.001861.96
    2772021.01.13 02:04buy1400.011859.130.001866.59
    2782021.01.13 03:37buy1410.011861.500.001869.38
    2792021.01.13 03:40t/p1390.011861.960.001861.966.44885.83
    2802021.01.13 09:30buy1420.011861.860.001865.97
    2812021.01.13 11:09close1420.011851.850.001865.97-10.01875.82
    2822021.01.13 11:09close1410.011851.500.001869.38-10.00865.82
    2832021.01.13 11:18close1400.011849.130.001866.59-10.00855.82
    2842021.01.13 15:45buy1430.011859.330.001873.43
    2852021.01.13 17:15buy1440.011859.450.001869.29
    2862021.01.13 22:51close1440.011849.440.001869.29-10.01845.81
    2872021.01.13 22:51close1430.011849.320.001873.43-10.01835.80
    2882021.01.14 03:19buy1450.011851.230.001860.34
    2892021.01.14 04:24close1380.011841.350.001871.21-11.76824.05
    2902021.01.14 04:24close1450.011841.220.001860.34-10.01814.04
    2912021.01.14 07:39buy1460.011845.190.001850.52
    2922021.01.14 14:48buy1470.011843.950.001850.72
    2932021.01.14 16:15buy1480.011845.240.001856.30
    2942021.01.14 16:30t/p1460.011850.520.001850.525.33819.37
    2952021.01.14 16:30t/p1470.011850.720.001850.726.77826.14
    2962021.01.14 17:45buy1490.011847.070.001855.23
    2972021.01.14 19:53t/p1490.011855.230.001855.238.16834.30
    2982021.01.14 20:00buy1500.011855.620.001870.47
    2992021.01.14 20:00t/p1480.011856.300.001856.3011.06845.36
    3002021.01.14 21:49close1500.011845.610.001870.47-10.01835.35
    3012021.01.15 02:30buy1510.011852.620.001862.93
    3022021.01.15 10:34buy1520.011852.500.001857.29
    3032021.01.15 12:00buy1530.011855.490.001862.71
    3042021.01.15 14:09close1530.011845.490.001862.71-10.00825.35
    3052021.01.15 15:39close1510.011842.610.001862.93-10.01815.34
    3062021.01.15 15:39close1520.011842.490.001857.29-10.01805.33
    3072021.01.18 04:37buy1540.011830.630.001842.45
    3082021.01.18 07:39buy1550.011837.550.001842.26
    3092021.01.18 09:00buy1560.011838.530.001850.92
    3102021.01.18 18:31buy1570.011839.430.001847.74
    3112021.01.19 03:21t/p1550.011842.260.001842.264.28809.61
    3122021.01.19 03:21t/p1540.011842.450.001842.4511.39820.99
    3132021.01.19 03:24buy1580.011843.480.001851.55
    3142021.01.19 09:00buy1590.011841.010.001847.75
    3152021.01.19 15:09close1580.011833.480.001851.55-10.00810.99
    3162021.01.19 18:45buy1600.011841.640.001853.49
    3172021.01.20 04:07t/p1570.011847.740.001847.747.45818.44
    3182021.01.20 04:07t/p1590.011847.750.001847.756.31824.75
    3192021.01.20 05:00buy1610.011850.140.001858.36
    3202021.01.20 07:08buy1620.011850.760.001853.40
    3212021.01.20 07:54t/p1560.011850.920.001850.9211.53836.28
    3222021.01.20 08:30buy1630.011852.720.001859.19
    3232021.01.20 08:39t/p1620.011853.400.001853.402.64838.92
    3242021.01.20 08:39t/p1600.011853.490.001853.4911.42850.33
    3252021.01.20 10:00buy1640.011856.230.001862.46
    3262021.01.20 14:51close1640.011846.220.001862.46-10.01840.32
    3272021.01.20 14:54close1630.011842.720.001859.19-10.00830.32
    3282021.01.20 15:04close1610.011840.140.001858.36-10.00820.32
    3292021.01.20 18:15buy1650.011865.840.001883.45
    3302021.01.21 21:00buy1660.011867.890.001874.70
    3312021.01.21 22:30buy1670.011868.830.001870.89
    3322021.01.21 22:46t/p1670.011870.890.001870.892.06822.38
    3332021.01.22 07:30buy1680.011863.720.001865.70
    3342021.01.22 08:24close1660.011857.890.001874.70-10.43811.95
    3352021.01.22 11:15buy1690.011863.040.001868.70
    3362021.01.22 12:24close1650.011855.840.001883.45-11.73800.23
    3372021.01.22 12:34close1680.011853.720.001865.70-10.00790.23
    3382021.01.22 12:36close1690.011853.040.001868.70-10.00780.23
    3392021.01.22 17:15buy1700.011852.810.001874.17
    3402021.01.25 03:03buy1710.011859.980.001864.39
    3412021.01.25 08:30close1710.011849.970.001864.39-10.01770.22
    3422021.01.25 11:39buy1720.011856.770.001863.43
    3432021.01.25 13:00buy1730.011863.240.001876.28
    3442021.01.25 13:04t/p1720.011863.430.001863.436.66776.88
    3452021.01.25 15:22buy1740.011867.180.001874.10
    3462021.01.25 16:54close1740.011857.170.001874.10-10.01766.87
    3472021.01.25 17:07close1730.011853.240.001876.28-10.00756.87
    3482021.01.25 20:00buy1750.011858.520.001868.84
    3492021.01.26 04:15buy1760.011858.730.001866.25
    3502021.01.26 12:54close1760.011848.730.001866.25-10.00746.87
    3512021.01.26 12:54close1750.011848.520.001868.84-10.43736.43
    3522021.01.26 14:45buy1770.011855.890.001863.35
    3532021.01.26 16:15buy1780.011857.300.001864.43
    3542021.01.26 22:45close1700.011852.770.001874.17-0.90735.53
    3552021.01.27 03:06close1780.011847.300.001864.43-10.43725.10
    3562021.01.27 03:09close1770.011845.890.001863.35-10.43714.67
    3572021.01.27 07:45buy1790.011850.070.001856.27
    3582021.01.27 10:00buy1800.011851.400.001856.16
    3592021.01.27 13:37close1800.011841.400.001856.16-10.00704.67
    3602021.01.27 13:39close1790.011840.070.001856.27-10.00694.67
    3612021.01.27 16:30buy1810.011844.550.001854.17
    3622021.01.27 16:39close1810.011834.550.001854.17-10.00684.67
    3632021.01.28 11:00buy1820.011838.690.001845.07
    3642021.01.28 12:30buy1830.011842.100.001847.64
    3652021.01.28 15:39t/p1820.011845.070.001845.076.38691.05
    3662021.01.28 15:45t/p1830.011847.640.001847.645.54696.59
    3672021.01.28 17:45buy1840.011862.050.001875.73
    3682021.01.28 18:49close1840.011852.050.001875.73-10.00686.59
    3692021.01.28 22:39buy1850.011843.700.001846.09
    3702021.01.29 07:54t/p1850.011846.090.001846.091.96688.55
    3712021.01.29 08:51buy1860.011849.110.001852.43
    3722021.01.29 11:09t/p1860.011852.430.001852.433.32691.87
    3732021.01.29 11:15buy1870.011852.640.001867.58
    3742021.01.29 12:43close at stop1870.011854.770.001867.582.13694.00
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..da959bc34e7cf730851120a836e910a018ad354f GIT binary patch literal 7534 zcmch6hc}z=|9}UJkfrvplBsag#)Yt0Aw;5008v&_meSw z5a>R}+8T2SVXPrgBH(h8$wVmR62e$tGB1|^GLZlQpaGW`gz*1(7^I~um=3k>+*JKe96FAqajUD^2+4{lnAx923&&H5C8;Y-2?#iK_E@! z%NPJn{GYWo8eqLbz7#<(gXqiPWtn6s1ag_+Qij1;6EBOihGH(WLLnI9ovknX{{KJ3FW)}kzr6s^k^KRI zLBS!RVc`*xQPDB6anSgL#2-n?DX`QuczOmRGb=kMH!r`S5Lr}Qf+{U5M^{uRFFw>`ler-N zi_Fys5KxPJ!I7}66?W?x;s-2YMJGzas`)2JVnNTV`?(u4y;X%zjX0%fYGkXQKht?~ z=T=g+?DN+2k}N?kb$}5CRZdwB#D9J`fEq;oB}V?$2qkS0UI$_xQDUb3nM{FVI&r4h_ZwtqhU6{LW!*^;Y()$U6)JoUtR~o6(tH6f zaJ5p7x=@94Xaqb2G~9a3!#@O;5$(F&jsS{lRo<$(Zm90`qrFP7hUZ0pi!6L6VD$aK z#C7LlYAt~qSb7}L$@xZ>fKYSx?fIbK#z$5+*dHg{xXpcgkw4&bssDnLU-lyku*8e| zI9nd90KyfBwpI^Y9!Exc6lSqcfQ7_wQ!vmPt_VS?I`?uZ?)J}fkQwF9OmHA6N|rhA zYXs;NE!PY{Jy~QPN<|CVY7G*&uF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! z++U;ZdMdx2RdnAkPyLE3`{wO}SJOTDlBXnw-ygZ#Fj_^)@vBj1jBG2YtTXof3FCgh zP=|xgn8v+~1N>NE>F>S|adom2hD6jM%=qbF5x_wirO0@7e@s-Xgfkv#r?!-S@U+)7nv<#k6g22wrvUiLjgFWm zmWX@T-qFS49@6|23x@oB$a>>dd$Zh?aI>36FmFtxn2s30uzK+-O+}{x!H`881tfo{ zRehgs7{u9^Mju5NMYH(M>0d%Oj~lQ_mh$;?M}|d#3wL@7!BN&Dp_jCBKoyntXBJWE z54q>UnZkcg;O%o=6^r1v*A<(oucDDE`JcITL%So$s|W?-kjOXhj4f@ zUC+2n%a%W)+jc9+y_ba`d6g4q`oQID`Pq#P29a<}5VQH0F|RyHeGknOM)AaZy1Yj@ z3gP-@m8qlDpA;U!K<286KV(tM3ZEY9eP?Zlg`8R(v1A#9DKkcAf)l%5$m2J%jjq32 zy0i4$mZ2(UFEgHajY{-zz!&nuL0HqO6QrZrdHlzXVjQWNnf$2F@kIh-3`eIR2ox!3 znaRl;qH}{w_oYm6u4Ix37oFLd{(x*qfxF0q_r*pb1rPG?gwQ;;ss}|E|FqI`EH=sn wjU#nji(ix$zbua&N7=cSyxuN0ZUIf8BVAD+BuY$&A}6YgT}yL;)BvUb1Gfiewg3PC literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.htm new file mode 100644 index 0000000..fc35a3d --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 6.htm @@ -0,0 +1,81 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.29 23:45 (2020.01.01 - 2021.04.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.01; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test9971Ticks modelled11845786Modelling quality24.76%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit-2.82Gross profit17.18Gross loss-20.00
    Profit factor0.86Expected payoff-0.47
    Absolute drawdown23.71Maximal drawdown25.89 (2.58%)Relative drawdown2.58% (25.89)
    Total trades6Short positions (won %)0 (0.00%)Long positions (won %)6 (66.67%)
    Profit trades (% of total)4 (66.67%)Loss trades (% of total)2 (33.33%)
    Largestprofit trade7.50loss trade-10.00
    Averageprofit trade4.29loss trade-10.00
    Maximumconsecutive wins (profit in money)3 (15.00)consecutive losses (loss in money)2 (-20.00)
    Maximalconsecutive profit (count of wins)15.00 (3)consecutive loss (count of losses)-20.00 (2)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.02.03 02:15buy10.011837.980.001840.16
    22021.02.03 02:39t/p10.011840.160.001840.162.181002.18
    32021.02.12 08:00buy20.011824.340.001827.91
    42021.02.12 10:19close20.011814.340.001827.91-10.00992.18
    52021.02.12 12:45buy30.011821.410.001829.72
    62021.02.12 15:30close30.011811.410.001829.72-10.00982.18
    72021.03.09 01:30buy40.011685.840.001693.34
    82021.03.09 08:45t/p40.011693.340.001693.347.50989.68
    92021.03.31 02:45buy50.011685.480.001689.02
    102021.03.31 08:45buy60.011681.540.001685.50
    112021.03.31 09:34t/p60.011685.500.001685.503.96993.64
    122021.03.31 15:39t/p50.011689.020.001689.023.54997.18
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.gif new file mode 100644 index 0000000000000000000000000000000000000000..99369a19e6f3d286a47e7680809995ad6fe33acd GIT binary patch literal 7375 zcmcg}hdUeI`*y5~t=g(xrNeB|)<{vbTC1q4J*ri;YPMElZ-Q7wkl2LS#NI0;b`fIl zO$$fWuq`K?LIehyZ{U z=1O`c1_7)9|MR-qu8gl37^^Z+6O6QSb%7CKR#t#3&@T%r3=9RP6Rp0;rhsf3I1OEF905!=E5D*v?91FQj{!B_vfv2XWBaj)HS=l+cdHDsX!Xk8WNoiSmMP*errlz*8zM-+H zxuvzOy`!_My9e9bhr{;|3=W~mMt_ZsPY@=jh|@E(bMp&}OUo;(YwH`ETiZLkd;7ot z{5|-0c(h+eh9p0~L|gzaw{F7b6*Q@?^Gqke7L?vH+?B`Qj9q-CaZCJ?codPX=+FBi zLYFOWSta!TJ48Zq+=^PHs73QHw)ngrJ*n)C>E6nGt@rGYsj8n=>AX{W^YDIR)l;3; zw4w|?4h6t_GK#E{ERf&)kUu3YrE`>|-Z1&Kz&Q>$yd##i*I?Fy6Zpkxqq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}x-NVt2`lbi~_xgSN>l^G(oe<(w4s<$d{U$g@HiY>Rx z@j3GvWo^$#MgB-g=X0rdGc=q(p%8u8QQBV&kv&i*-GmoJP{<{xLB|aAXF9ImIYz4u z&1(Bm5+?I%{00i4#}VUf=B7`l>m8cHiH@Vi;lxih4DOweaZT2fkUM>nrSCh`&@;p2 z8PXN}20PW02*3KHMN9Q&ngZ&KVmE;dR-Y%+QLfyDP0TbJ|K>c9f9@@6JehBuC{&UW zmhuUd-I4fE-&{GJeZ(U~Ekv(gU(3DE2q~`))vOKWzO8jI-&F$M-!I_56R}@&sTpyY z{0Z6guMB6_ME?HKT*MKiJFBU&GgR(;m->#c)Y(DgbI9w^Crkr7nI@c%?2ZS`1Hd7z ztbk@c`XLs#CB(z+Jo(G(pZw#kxv01oFk7mRNlwWPK~%A;G+oG z13LAN)Y#;1@)i2sYaAoH;Smlj*}HYq<)eT=PDfa$M!>Wm?AfOYMIE;C54@16AUIIs z<+q_w&p>155Ba~VW#wRXE1}8FRR3Z#B>*E z)oY(VeWVsq?#FyfsystjY1!y6ZI>7Mkc^IO5zLU^T!QsPK61EBk4yo1!E96hm-i1W zyo&PSSZVA{q*`bOoFZJ)mPPVq i2Ezxw7rLfz+vh)@qZ#z*b447W^X2x~;R*o2^Zx^52`#$- literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.htm new file mode 100644 index 0000000..abd9d0f --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 7.htm @@ -0,0 +1,81 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.04.29 23:45 (2020.01.01 - 2021.04.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.015; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test9971Ticks modelled11845786Modelling quality24.76%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit29.06Gross profit29.06Gross loss-0.00
    Profit factorExpected payoff4.84
    Absolute drawdown22.81Maximal drawdown24.99 (2.49%)Relative drawdown2.49% (24.99)
    Total trades6Short positions (won %)0 (0.00%)Long positions (won %)6 (100.00%)
    Profit trades (% of total)6 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade8.31loss trade-0.00
    Averageprofit trade4.84loss trade-0.00
    Maximumconsecutive wins (profit in money)6 (29.06)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)29.06 (6)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins6consecutive losses0
    +Graph
    + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.02.03 02:15buy10.011837.980.001840.16
    22021.02.03 02:39t/p10.011840.160.001840.162.181002.18
    32021.02.12 08:00buy20.011824.340.001827.91
    42021.02.12 12:45buy30.011821.410.001829.72
    52021.02.12 17:54t/p20.011827.910.001827.913.571005.75
    62021.02.12 17:54t/p30.011829.720.001829.728.311014.06
    72021.03.09 01:30buy40.011685.840.001693.34
    82021.03.09 08:45t/p40.011693.340.001693.347.501021.56
    92021.03.31 02:45buy50.011685.480.001689.02
    102021.03.31 08:45buy60.011681.540.001685.50
    112021.03.31 09:34t/p60.011685.500.001685.503.961025.52
    122021.03.31 15:39t/p50.011689.020.001689.023.541029.06
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.gif new file mode 100644 index 0000000000000000000000000000000000000000..33bc5a2c96ec2b7699541d9927fd77cd17040f6e GIT binary patch literal 6777 zcmaJ__d6Tj{|&WQ?5(OrZCV`>wdt^{HEUPZrlqJ=)ZQzIy?0O}w%Q}HN{JY;XY3j= z^Y#Ax0pI(>ea`E=&N=tqpI*;%U%hz=lCpSmX80O0X>001yFG=zs+gX3o5*4FS_ z<`&`cvvJ_t0&ab)xrKoLZMXP89l#oX+q`XC0|5W?;la0-xZBDa3AB=1N|Qchmc0YW21(D{!SQ7 zPXBIkp6lycTv$ddt*(r$ZElQj?O>;N5B6sck1>vC@fVj@*EcWGl|*%qt5p?*NQ-%s zY9v&Z1Uipk@nKc~0uf@WoL`<+9Rx&*AVqp8Z$KaqZ+>cp<)crGDZD0mtv1#Q{)u>N zS-Qa-0!{pVHdhL+84VOIDUjb+9A?pYUz%tFCRvqq>2Kk~>NFQ`rIbqX2H;k09;bYFbK`J=H9c zAWL><8VP^n0|s%X1Zcjct&pp{Zp@d75#66&Ptn<>kQ_)}^4d&l<;VS#A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hDbeVpzogDX@DDcl3+zADvVlpN$*?V|VZW z@Rrp&j*LE1Ju!Ksc@n#OEXsW{vv;z8cMh*Kdh*=P(;&7@DErtvc8>>m#0@;L%>DVn5{ai3vjk2d^H zEBSk_oc?hS&iA{fWR3% z`_l9!u9EvSZXXwqzjWrl>H%K$We4)bUKB4}I>=r1Yn>zT$G!VkGrl9A+xgjZN2+Ol zvHm{!vv4vbx1W)XTl$S#!w>y49<}(wgloO-D7ic^Yr^Dg?H-X}@Q0!@rppMj9!kfmceT(~4qA-#ZqJNf&!%qeC&F>exqFRKck&@C?ghRM%c@ zo8H4jW32YI`)@6AxKnCX)M|3D0Z-u_w)YK$Ma^&*1U!rfJ?!O?Fy9)_A&R;B>aQO}LV(Vid1(Q&=%di08e$y2*m!OiV+*BhUx zUoVM_@2m9$`CoM_pP2_0ARa06lFIBD*A;XDcbg(|C)e-Ou$s8g@vF;MuEcl$NIrfX z^9=7fswvx7yCzSB@6_t+9->Of7K6-5mMXUJa{YxXa3o|ren z<0BQslBTU=MAliQW^+s8bRJ9xC`BGdP#JIQxaWpI$%TyPq8GuTem3v9B~IrjF($>7 zhs?l(K9C&1N*~K$?LixhO+(SfbKP{WL~z+kQHRTM1p=a^Nyt}I6dpq}vwUyZHgkgS zrfud$%d&43KupuNiZcD!w@V7M(zeTB?d;f!dQ2L&vh9X_r@HrU`cBQTEXQu$q-pvt SeBO^^uW>DlBlaEuApL)R-P*YT literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.htm new file mode 100644 index 0000000..16be30e --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester 8.htm @@ -0,0 +1,70 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2021.08.02 01:00 - 2021.10.29 23:45 (2021.08.01 - 2021.10.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test6965Ticks modelled5220361Modelling quality25.00%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (58)
    Total net profit-11.75Gross profit18.25Gross loss-30.00
    Profit factor0.61Expected payoff-1.68
    Absolute drawdown14.47Maximal drawdown30.83 (3.03%)Relative drawdown3.03% (30.83)
    Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (71.43%)
    Profit trades (% of total)5 (71.43%)Loss trades (% of total)2 (28.57%)
    Largestprofit trade8.78loss trade-15.00
    Averageprofit trade3.65loss trade-15.00
    Maximumconsecutive wins (profit in money)3 (13.04)consecutive losses (loss in money)1 (-15.00)
    Maximalconsecutive profit (count of wins)13.04 (3)consecutive loss (count of losses)-15.00 (1)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.08.09 08:30buy10.011743.630.001752.41
    22021.08.09 10:48t/p10.011752.410.001752.418.781008.78
    32021.08.12 20:45buy20.011751.600.001753.99
    42021.08.13 04:22t/p20.011753.990.001753.991.961010.74
    52021.08.18 02:00buy30.011786.860.001789.16
    62021.08.18 04:33t/p30.011789.160.001789.162.301013.04
    72021.09.08 04:04buy40.011798.630.001803.76
    82021.09.08 16:54close40.011783.630.001803.76-15.00998.04
    92021.09.13 05:45buy50.011789.150.001792.95
    102021.09.13 08:54t/p50.011792.950.001792.953.801001.84
    112021.09.16 03:15buy60.011795.080.001796.87
    122021.09.16 12:51close60.011780.080.001796.87-15.00986.84
    132021.09.27 02:15buy70.011749.620.001751.03
    142021.09.27 03:13t/p70.011751.030.001751.031.41988.25
    +
    diff --git a/Docs/Reports/Tests/XTPW/In Test/StrategyTester.gif b/Docs/Reports/Tests/XTPW/In Test/StrategyTester.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf95b4f905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XTPW/In Test/StrategyTester.htm b/Docs/Reports/Tests/XTPW/In Test/StrategyTester.htm new file mode 100644 index 0000000..89eff88 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/In Test/StrategyTester.htm @@ -0,0 +1,81 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.12.30 23:45 (2020.01.01 - 2021.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=6; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.0001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.15; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xR2R=2.5; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xrR2R=2; xRMaximumCandlesPerTrade=252; xrOscillatorLength=7; xrFastLength=20; xrSlowLength=50; xrRangeMarketLength=50; xrSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWR2R=1.5; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test25902Ticks modelled27850269Modelling quality24.91%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit687.00Gross profit952.41Gross loss-265.41
    Profit factor3.59Expected payoff114.50
    Absolute drawdown61.80Maximal drawdown283.01 (14.41%)Relative drawdown14.64% (163.90)
    Total trades6Short positions (won %)6 (66.67%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)4 (66.67%)Loss trades (% of total)2 (33.33%)
    Largestprofit trade315.40loss trade-142.34
    Averageprofit trade238.10loss trade-132.71
    Maximumconsecutive wins (profit in money)3 (895.41)consecutive losses (loss in money)1 (-142.34)
    Maximalconsecutive profit (count of wins)895.41 (3)consecutive loss (count of losses)-142.34 (1)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.08 11:00sell10.101888.710.001857.17
    22021.01.08 16:45sell20.101871.560.001840.06
    32021.01.08 17:09t/p10.101857.170.001857.17315.401315.40
    42021.01.08 18:15sell30.101854.120.001827.81
    52021.01.08 19:33t/p20.101840.060.001840.06315.001630.40
    62021.01.11 03:21t/p30.101827.810.001827.81265.021895.42
    72021.10.26 17:00sell40.101789.760.001773.22
    82021.10.28 15:21close40.101804.760.001773.22-142.341753.08
    92021.11.03 04:00sell50.101783.060.001777.36
    102021.11.03 14:39t/p50.101777.360.001777.3657.001810.08
    112021.12.20 17:00sell60.101791.570.001781.64
    122021.12.22 22:30close60.101804.260.001781.64-123.071687.01
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..d4767e5f9236961c75a3110a957b3218af7734af GIT binary patch literal 7384 zcmch5_d6WS_x2)KErdw)nrKlY5>^cnZIv|9BP6;IM2}u}_0H;jS8uWGuHJhmSc~XZ zjYJLh>-oI@!#mf^TxZUGpL@=k`DLzA(|9Q@^YIBuA7BFjAP@)u0AOfnh=3df#T_B7 ztdKV@q!lO*3%D5s0yY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=*j&RLf t6Nbx-LPy+6U9)x_;Ic~;qn-n<*?-I7@(0jSU%YG1IeP#A literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.htm b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.htm new file mode 100644 index 0000000..cb9b5b7 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 1.htm @@ -0,0 +1,103 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2021.01.04 01:00 - 2021.01.29 23:45 (2021.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test2825Ticks modelled1863423Modelling quality25.00%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit37.17Gross profit45.89Gross loss-8.72
    Profit factor5.26Expected payoff2.19
    Absolute drawdown1.08Maximal drawdown14.81 (1.42%)Relative drawdown1.42% (14.81)
    Total trades17Short positions (won %)0 (0.00%)Long positions (won %)17 (94.12%)
    Profit trades (% of total)16 (94.12%)Loss trades (% of total)1 (5.88%)
    Largestprofit trade3.02loss trade-8.72
    Averageprofit trade2.87loss trade-8.72
    Maximumconsecutive wins (profit in money)16 (45.89)consecutive losses (loss in money)1 (-8.72)
    Maximalconsecutive profit (count of wins)45.89 (16)consecutive loss (count of losses)-8.72 (1)
    Averageconsecutive wins16consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.05 17:08buy10.011939.900.001942.92
    22021.01.05 17:19t/p10.011942.920.001942.923.021003.02
    32021.01.05 22:24buy20.011949.670.001952.69
    42021.01.06 01:31t/p20.011952.690.001952.692.531005.55
    52021.01.06 04:54buy30.011944.020.001947.04
    62021.01.06 05:15t/p30.011947.040.001947.043.021008.57
    72021.01.12 15:39buy40.011844.020.001847.04
    82021.01.12 16:31t/p40.011847.040.001847.043.021011.59
    92021.01.12 18:46buy50.011841.920.001844.94
    102021.01.12 20:34t/p50.011844.940.001844.943.021014.61
    112021.01.15 15:54buy60.011839.140.001842.16
    122021.01.15 16:09t/p60.011842.160.001842.163.021017.63
    132021.01.19 14:54buy70.011836.230.001839.25
    142021.01.19 15:52t/p70.011839.250.001839.253.021020.65
    152021.01.19 16:54buy80.011835.490.001838.51
    162021.01.19 17:03t/p80.011838.510.001838.513.021023.67
    172021.01.19 20:48buy90.011840.410.001843.43
    182021.01.20 02:54t/p90.011843.430.001843.432.531026.21
    192021.01.20 14:54buy100.011842.620.001845.64
    202021.01.20 15:39t/p100.011845.640.001845.643.021029.23
    212021.01.20 19:24buy110.011863.200.001866.22
    222021.01.20 20:21t/p110.011866.220.001866.223.021032.25
    232021.01.25 17:09buy120.011851.970.001854.99
    242021.01.25 17:24t/p120.011854.990.001854.993.021035.27
    252021.01.25 21:22buy130.011855.430.001858.45
    262021.01.26 03:54t/p130.011858.450.001858.452.531037.80
    272021.01.28 19:06buy140.011845.620.001848.64
    282021.01.28 23:01buy150.011841.300.001844.32
    292021.01.29 01:39t/p150.011844.320.001844.322.531040.33
    302021.01.29 08:51t/p140.011848.640.001848.642.531042.87
    312021.01.29 16:39buy160.011855.920.001858.94
    322021.01.29 16:49t/p160.011858.940.001858.943.021045.89
    332021.01.29 19:22buy170.011856.150.001859.17
    342021.01.29 23:58close at stop170.011847.430.001859.17-8.721037.17
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 10.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 10.gif new file mode 100644 index 0000000000000000000000000000000000000000..15854a619901398ac146b0152f80ca668c351504 GIT binary patch literal 7949 zcmc(D^;;Cq_x%#W(%ph|NQo%1w4%}=77Z%WAfR;jveeQ`cP#=-cPSvSl;pw^3rIK8 zuJo*000h$0{{R+LqoU*BnW!kU}e>C z2Q^rMplHC|!r{hrZb;rC50XQ@Y1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pIp#*B1|cwmwSeyj zMTp7*zVLe{O+BsVqqwiC$!MX-TG{isitV#rzTk_8Ixc+nb@_S-wRkDBYF_(YZgwx5 z-urqIF-Wpic05iMNRtbPu5SV71~Bj`$8k(ZD9>|NFS=<_R}S}RHJX`8d`n*L*>OrhG#|I}p91~&>PhQfHM|EF8q}}w6~rqE!7Y|*!k5R$c)~<# zU9Eg^4~&Kzvm{sdk1y)!hG7aIOIRqbsYoSw0GU89nT#k@lPKF7Cg!cqpb_HdEW^k< zLMGCLC9I$NY(YP*>t~VoTdDWq>p;53vmEd=A0llDY#StVRks$;tz>E4xx?_)l}kA{ zUQ^`@9^?SlKAsb%L!(%Ola6==B@~QaPj!FJ^{uvgRo1T;!Kzw7H)Y9+-O`Wv@w&jF zPEc(Xj2{wQRZNQI;bb#jU<d&6d4+1`r&sS-6Oy?i+SM)5_;0?_o<$vs zY>?@y&lMD&2$qXz>Nl`br#ro`kf;A)a1JyMRDRlswJ1}_ym}i~dDak)5mh2&GeY{i zHxN}1AwFy4mrwBBksyExsA1wagHUf7w zw+d3zs`s$kocevsY8!J(xrFY$sjr&T%jWg;v@tW}5KC~dI-@;Z2VbO%ks-<3smDif z@nY~7-hZD@DS7*0~CR0p($!U7iVjt3?RZY^V@Ps>Dlp)c9 zoc3-=ome0&QhoI}!Ek^8uQqw3bxkMMPypC}oGDDOCO7dJ`Es{52S>iCOy)fnDpr?A h6|<=-?ENR&sjlDw#g>|;_jpoeU6Hu + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2023.01.03 01:00 - 2023.08.02 04:45 (2023.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test14765Ticks modelled18359176Modelling qualityn/a
    Mismatched charts errors804
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit-49.87Gross profit45.06Gross loss-94.92
    Profit factor0.47Expected payoff-3.84
    Absolute drawdown49.87Maximal drawdown53.43 (5.32%)Relative drawdown5.32% (53.43)
    Total trades13Short positions (won %)0 (0.00%)Long positions (won %)13 (53.85%)
    Profit trades (% of total)7 (53.85%)Loss trades (% of total)6 (46.15%)
    Largestprofit trade16.17loss trade-16.48
    Averageprofit trade6.44loss trade-15.82
    Maximumconsecutive wins (profit in money)2 (18.97)consecutive losses (loss in money)1 (-16.48)
    Maximalconsecutive profit (count of wins)18.97 (2)consecutive loss (count of losses)-16.48 (1)
    Averageconsecutive wins1consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12023.01.11 01:24buy10.011876.960.001878.14
    22023.01.11 03:01t/p10.011878.140.001878.141.181001.18
    32023.01.11 12:42buy20.011883.450.001886.42
    42023.01.11 17:38buy30.011870.910.001878.90
    52023.01.11 18:06close20.011868.450.001886.42-15.00986.18
    62023.01.12 03:48t/p30.011878.900.001878.906.53992.71
    72023.02.02 18:35buy40.011917.590.001927.38
    82023.02.03 15:32close40.011902.570.001927.38-15.51977.20
    92023.02.16 13:52buy50.011836.270.001839.07
    102023.02.16 14:52t/p50.011839.070.001839.072.80980.00
    112023.03.16 17:38buy60.011915.520.001932.18
    122023.03.17 07:33t/p60.011932.180.001932.1816.17996.18
    132023.04.05 20:20buy70.012019.930.002023.78
    142023.04.06 16:44close70.012004.920.002023.78-16.47979.71
    152023.04.26 19:17buy80.011988.970.002001.19
    162023.04.27 08:13t/p80.012001.190.002001.1910.76990.47
    172023.05.24 17:20buy90.011967.200.001972.30
    182023.05.25 15:34close90.011952.180.001972.30-16.48973.99
    192023.05.26 17:32buy100.011946.400.001951.61
    202023.05.30 12:59t/p100.011951.610.001951.614.24978.23
    212023.06.16 19:16buy110.011955.520.001961.50
    222023.06.20 16:17close110.011940.520.001961.50-15.97962.26
    232023.07.13 18:51buy120.011957.820.001961.68
    242023.07.14 04:38t/p120.011961.680.001961.683.37965.63
    252023.07.20 17:09buy130.011972.690.001979.97
    262023.07.21 18:04close130.011957.680.001979.97-15.50950.13
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 11.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 11.gif new file mode 100644 index 0000000000000000000000000000000000000000..39eeab5286b44e3eca880e5aff5c7cd0cd98988a GIT binary patch literal 6467 zcmaKn^;;9{+r}r-9S^Bsfi$9szyL*19~dnlT}n%dfW%;C>1bc`B3YNNXw2181^ z1nJt#^Zf(f`-l5Duk$)T=W*ZvDt(ZYGJkou2QUc$5C{YS05C8xKtNjoW9HCSR_I&j zRuKquF~HjaZFQTum4N?UxB9;vzzTi4yj=rtlQCBRLvMSmfIy%X05JDo6bJwS(P*pN zMu1fe`qqg7qUUY}I>ssn7!z~r{#S8p-9jgOL27!({58Ws+Vh>VJkvA+|a0RNeol$?^9hDguI%*xKm&C4%9 z78Vtkl%mSYD=Mq1YtXgj&UZ|SFij@dmS*GDj&`HYo^He5fqsL*kzxJOiE+KjndU|( zd{^7z!gAlz@0Fp|jrFn3o$aaJKl`%>N533SV=peRuE986fB}PE&_m_`Eqah9ThOC_ zLe%|N4aFFG0YrL~Y;xZZdZ2g716>1OzEC0}Q2>3A(qGN)<9nvuq!Knd;1A%tW=Kx9 z;0_>=N`={|ywENf&9M^5KUiCA<&JspA@4{3h#Q)pz-^mXL_rASazK7)PGO0Myp9(Ydi+~W)QJ7wfXzq)pR%)Qx8T-5(5e?T%=VrTPa4;QlzAhO9 zL}4U;?~R=4p05z}&ZUn=I=G)kREc~>n0Jhu%got?^f9*$6ihZ^Z3bXGO8f|2t!E{e zyI#;JB3vhy5*Pz|rF0g#*+G06Ve<56MxOJ9Jw|p3IP!FlA?)Ona8}z59mpF}=)=hK zysk$O3g4twat;eQ|44xUOjaPP9SPK%Ct_m(MtP*m6Td1eY3Zs4+of=>^FjIxTAutQ{FeNY>V!{+d-@&7^q7{hHj>|LnMv_dQ z3X~(h`;ax>+$7rOQ`#3Lm)7nD z786_LQEtEQ$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/Long/StrategyTester Long 11.htm new file mode 100644 index 0000000..9ba9c5a --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 11.htm @@ -0,0 +1,75 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2023.01.03 01:00 - 2023.08.02 05:00 (2023.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test14766Ticks modelled18360505Modelling qualityn/a
    Mismatched charts errors804
    Initial deposit1000.00SpreadCurrent (56)
    Total net profit23.29Gross profit23.29Gross loss-0.00
    Profit factorExpected payoff7.76
    Absolute drawdown4.03Maximal drawdown6.73 (0.67%)Relative drawdown0.67% (6.73)
    Total trades3Short positions (won %)0 (0.00%)Long positions (won %)3 (100.00%)
    Profit trades (% of total)3 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade10.70loss trade-0.00
    Averageprofit trade7.76loss trade-0.00
    Maximumconsecutive wins (profit in money)3 (23.29)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)23.29 (3)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins3consecutive losses0
    +Graph
    + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12023.01.11 17:38buy10.011870.970.001878.90
    22023.01.12 03:48t/p10.011878.900.001878.906.471006.47
    32023.04.26 19:17buy20.011989.030.002001.19
    42023.04.27 08:13t/p20.012001.190.002001.1910.701017.17
    52023.07.13 19:00buy30.011955.080.001961.68
    62023.07.14 04:38t/p30.011961.680.001961.686.111023.29
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.gif new file mode 100644 index 0000000000000000000000000000000000000000..ed245718df36db069fd0c6ff1ee75c9f72853e28 GIT binary patch literal 7327 zcmc(^^;;Cq_ddLU!Y&O8(kUGx2q>)>NGa$`0cn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BO%=#f z(wE)8G;KK7O7=b`89MBR-}ePpy`j;1GMdB{QQ3-roQ0Mcm7}1t^m(3)tSCe@*X|`(E#t$Y+m@J{QYoa&kIY6=$YI7GpCE zHC6<1A0$1G5`x4OPC~<#K`YxD0YA5N_dH!!SO+<7j%DA>|2#oi-8QLVv_H+Xaso=< zfELFe-K!#*-+36_wD{wNLd9s12M<$t&;=#l75idgl=1=eTyP)|POD$r^h9~}BFZQ2 zp9%S*YKz)??I4fBPxDU&pP!7A1(S*fk)Exg$Vmr-&7o$zJScfCo`4XznhD@;m-0QC zXt1#XH{TL(8$Ayo@Gp!ZZ|W7RtWb%+BnfwB*A(P#u8uawE)yc-0h&X-jdUuy!>;q~ z-H44i$qG7D>kG78i|%kV!s|2^q9cUByYQyyX6mt9&>T>mZoD-^wa>TwvdJQ+76C1X39{mFKnUcG} j+eC98M?na0axO`I_PJ8&pnhw07sS{d3k@y+K>q&$xaT8u literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.htm b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.htm new file mode 100644 index 0000000..c1ca429 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 12.htm @@ -0,0 +1,103 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.02 05:15 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63371Ticks modelled72617929Modelling qualityn/a
    Mismatched charts errors809
    Initial deposit1000.00SpreadCurrent (56)
    Total net profit118.15Gross profit149.13Gross loss-30.97
    Profit factor4.81Expected payoff6.95
    Absolute drawdown19.83Maximal drawdown28.11 (2.79%)Relative drawdown2.79% (28.11)
    Total trades17Short positions (won %)0 (0.00%)Long positions (won %)17 (88.24%)
    Profit trades (% of total)15 (88.24%)Loss trades (% of total)2 (11.76%)
    Largestprofit trade18.17loss trade-15.49
    Averageprofit trade9.94loss trade-15.49
    Maximumconsecutive wins (profit in money)13 (129.43)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)129.43 (13)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins8consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.03.11 16:48buy10.011719.890.001736.10
    22021.03.12 11:09close10.011704.890.001736.10-15.49984.51
    32021.03.17 13:48buy20.011728.330.001737.00
    42021.03.17 20:06t/p20.011737.000.001737.008.67993.18
    52021.04.19 15:15buy30.011775.890.001787.89
    62021.04.21 09:54t/p30.011787.890.001787.8911.031004.21
    72021.04.27 18:24buy40.011778.410.001784.35
    82021.04.28 12:24close40.011763.410.001784.35-15.49988.72
    92021.05.19 22:00buy50.011863.450.001881.95
    102021.05.20 19:49t/p50.011881.950.001881.9517.041005.77
    112021.07.06 19:07buy60.011794.070.001807.68
    122021.07.07 13:24t/p60.011807.680.001807.6813.121018.89
    132021.07.08 18:04buy70.011801.920.001814.59
    142021.07.13 15:39t/p70.011814.590.001814.5911.211030.10
    152021.08.17 17:15buy80.011782.670.001792.83
    162021.08.18 09:37t/p80.011792.830.001792.839.671039.77
    172021.12.21 16:52buy90.011793.780.001799.79
    182021.12.22 20:09t/p90.011799.790.001799.795.521045.30
    192022.02.15 11:19buy100.011856.920.001877.04
    202022.02.17 10:16t/p100.011877.040.001877.0418.171063.47
    212022.04.26 17:36buy110.011901.330.001904.58
    222022.04.26 17:38t/p110.011904.580.001904.583.251066.72
    232022.09.30 20:35buy120.011663.120.001671.54
    242022.10.03 16:16t/p120.011671.540.001671.547.931074.66
    252022.11.30 17:18buy130.011751.880.001763.12
    262022.11.30 21:20t/p130.011763.120.001763.1211.241085.90
    272022.12.09 17:23buy140.011791.220.001800.19
    282022.12.09 18:20t/p140.011800.190.001800.198.971094.87
    292023.01.11 17:38buy150.011870.970.001878.90
    302023.01.12 03:48t/p150.011878.900.001878.906.471101.34
    312023.04.26 19:17buy160.011989.030.002001.19
    322023.04.27 08:13t/p160.012001.190.002001.1910.701112.04
    332023.07.13 19:00buy170.011955.080.001961.68
    342023.07.14 04:38t/p170.011961.680.001961.686.111118.15
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 13.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 13.gif new file mode 100644 index 0000000000000000000000000000000000000000..36be70dfeb3e67e84aafd8cf408b5b95cb88f39b GIT binary patch literal 7329 zcmc(D^;Zr-dFKPb@1*WTEu%3QX@KE-kODuB~ruZf#?CcK7xV4v&ui z{yRB6JA~t9;$Pop+yHKO=%SYtKisE&I2Rwi{7RktvHSpC%*q?J2hVOXXW-nIf7lhk zpBQ7;ltZ|*GUAhB*Hyy=&6_6};|h8{OXP0P^;H#Wyk-)%diRkK^jP-}-wWU0%R^PxI>U zer^@T!$Ypl2U^R`p;y}K>(sCA5z}yobA3Ib2_lITG-_>?3V1@!!fc!|kWC;?nL@wB z)#wo&Kxv>qtUcK0__(g}>2k)sx)Y8`mz~Q~JJ1Ub3U(S=g|D&_eyE^#9I<6hmqT4e z%pr{Y7Vxb8#2Ev|XZ6&e5%7#NkJfFhLnDzUq~_)~0(NmqyjL)6U1xOf`Welf?Z5lV z%0`6rv1Xj47Gq{l4rdu4#3UO^kf5n=p=7@cttF<2c_g`Ck`U@~JpmCEiR9q%!>RO1 zg~IhhiFwGLo4C_8wayYUw*nNSI6K)12t`LU1K8;Y^m1|RJIkTT1TV6v^Z*i!Z~%qW z68vi%K+QdX0;map4InczK=q@aE zWayyvx&6l70GkFb*rftUfOel{`WJfX4HLTy&?_5PZj!?EBoYg&1fl_^r-ga=2xb^z zIN^FhK|c0Du^ZuGp>9|u;nPxg8rWnC;Ke0RcFe*d0fhvBx)?8CRocD~FKdb``{gI* zr$uC~v-Sz!31I>WUGyxQWhmzU0H{B}Za>+U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/Long/StrategyTester Long 13.htm new file mode 100644 index 0000000..bb47461 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 13.htm @@ -0,0 +1,103 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.02 06:00 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63374Ticks modelled72620713Modelling qualityn/a
    Mismatched charts errors809
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit91.72Gross profit107.20Gross loss-15.49
    Profit factor6.92Expected payoff5.40
    Absolute drawdown0.80Maximal drawdown21.17 (2.03%)Relative drawdown2.03% (21.17)
    Total trades17Short positions (won %)0 (0.00%)Long positions (won %)17 (94.12%)
    Profit trades (% of total)16 (94.12%)Loss trades (% of total)1 (5.88%)
    Largestprofit trade17.03loss trade-15.49
    Averageprofit trade6.70loss trade-15.49
    Maximumconsecutive wins (profit in money)13 (89.63)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)89.63 (13)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins8consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.03.11 16:48buy10.011719.900.001725.30
    22021.03.11 17:07t/p10.011725.300.001725.305.401005.40
    32021.03.17 13:48buy20.011728.340.001737.00
    42021.03.17 20:06t/p20.011737.000.001737.008.661014.06
    52021.04.19 15:15buy30.011775.900.001779.90
    62021.04.20 19:24t/p30.011779.900.001779.903.511017.57
    72021.04.27 18:24buy40.011778.420.001784.35
    82021.04.28 12:24close40.011763.420.001784.35-15.491002.09
    92021.05.19 22:00buy50.011863.460.001881.95
    102021.05.20 19:49t/p50.011881.950.001881.9517.031019.12
    112021.07.06 19:07buy60.011794.080.001807.68
    122021.07.07 13:24t/p60.011807.680.001807.6813.111032.23
    132021.07.08 18:04buy70.011801.930.001814.59
    142021.07.13 15:39t/p70.011814.590.001814.5911.201043.43
    152021.08.17 17:15buy80.011782.680.001786.06
    162021.08.17 17:24t/p80.011786.060.001786.063.381046.81
    172021.12.21 16:52buy90.011793.790.001799.79
    182021.12.22 20:09t/p90.011799.790.001799.795.511052.33
    192022.02.15 11:19buy100.011856.930.001863.63
    202022.02.16 16:39t/p100.011863.630.001863.636.211058.54
    212022.04.26 17:36buy110.011901.340.001904.58
    222022.04.26 17:38t/p110.011904.580.001904.583.241061.78
    232022.09.30 20:35buy120.011663.130.001665.93
    242022.10.03 04:23t/p120.011665.930.001665.932.311064.09
    252022.11.30 17:18buy130.011751.890.001763.12
    262022.11.30 21:20t/p130.011763.120.001763.1211.231075.32
    272022.12.09 17:23buy140.011791.230.001800.19
    282022.12.09 18:20t/p140.011800.190.001800.198.961084.28
    292023.01.11 17:38buy150.011870.980.001873.62
    302023.01.11 18:51t/p150.011873.620.001873.622.641086.92
    312023.04.26 19:17buy160.011989.040.001993.09
    322023.04.27 04:34t/p160.011993.090.001993.092.591089.52
    332023.07.13 19:00buy170.011955.090.001957.29
    342023.07.13 19:18t/p170.011957.290.001957.292.201091.72
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 2.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..8c6dcb13d6647a417048870eae78e72ad6dd6341 GIT binary patch literal 8811 zcmchb^;;Co_xBf3SQBy8{ww;Qkl0AR6L007Y6-;b^A10nua8XH&Mn<|Y# zh*`k>!eVC;pnFrL@jZFJ1z=|}AOIS0KS7xP$6@~>K>srU`YP{55N7s&AOK)odGC7f z3<4M%-{-hL{}&Z|PgEMCK@AA(x-sb9fVfvdpnJ}^0RZR&ff}&)0suYxzqrO|fblx^ z-UD$jqVL7~8nK9b90URYK$Vrov-g!5BP#DxB0!b1_nS(@?0v}lunqT~m3;tEUnK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vfS>?(5LvmUQ zPqW_@tD#iOcK==FUm$(z~f^JnN9wgc-> z5$%?RpEY3a0*7Tot)a)xB}3eMjyG=eO>f?#r=N4_Rm{$>L#t}cig=v*f){e1tCsCq zmAGdMPh9l6G)Ap+c^(Gq#m=}?v^?6itJ2a2U|s6xZi`(8f^~3%)mqjnc>IY%^pEV# zno9P0z02~y5<85yKAq&V73I<@o#dN0)RSqY7JfercPf8EOa)!+@kkk2E+XPiwxitS~=5x|#>l6?$- z{zwVj4ZdJ-zadXq!cfS@y8`flrFB`-BJrkBA9&EQxGd!`Wb?x=c*x_REEP+ z)VL&p@4Ad5$x@3`4?DIL!`o()t$i7hbDCx3vCX07HWt58o+CoCqZ|xkiXp9dS3kE# ztqGne?Bso<&eWjBi%UaqR#9Xls_{iqaw?AqU}oM*Gqi^5gkzV2R&MnrkKSN}lPXGd z!?t`vjHhpH?S4WPKmPhXOI=b|DXKZO@0nISZTzqDRG-TToJKl>(+#h|(YJD^uA^yz z&Wmh#T3PksE?&mERGXnJvEJ^`xd%3Qb@QHw*2;BD1|QBFu|L@2wn-l0A_;C8b<;64R6-}xSOJgrO5ErYy zI%>5`yIwBsO^Ci*6}*`a?vS=7e@vos;2WRg^X@W98ix{(!hLHuVN@ z7cx>59|#cU{NYhBFDVCS)5Ts|?|x4zX``bqy+`_8mv{yRK0xn)vF7fkgv9IIn|0w- zO`>dsjP#(&YjMd-a?L8&4m_Gmc}3-wa%?j+>B=4GhGX}X2;g(t>@$1hGN|S{CjGfT z4oDMEV*bhxljfN(=$;$sIsM9=&6UI>!soAwByKm!$fn=8#M72@pF@3r3Y7O09{A$D z!!wMx_@@6hfco7fi4TQmu7M+=I;Dd1! zu0D3u&Kw2;d2*N>nqAZc#5 zwQoF0J}f93MUyNP6wNNxBIv + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.05.28 23:45 (2020.01.01 - 2021.05.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test11903Ticks modelled14454965Modelling quality24.80%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit75.28Gross profit155.15Gross loss-79.87
    Profit factor1.94Expected payoff2.60
    Absolute drawdown5.66Maximal drawdown65.01 (6.09%)Relative drawdown6.09% (65.01)
    Total trades29Short positions (won %)0 (0.00%)Long positions (won %)29 (79.31%)
    Profit trades (% of total)23 (79.31%)Loss trades (% of total)6 (20.69%)
    Largestprofit trade18.30loss trade-16.46
    Averageprofit trade6.75loss trade-13.31
    Maximumconsecutive wins (profit in money)8 (53.93)consecutive losses (loss in money)2 (-31.46)
    Maximalconsecutive profit (count of wins)53.93 (8)consecutive loss (count of losses)-31.46 (2)
    Averageconsecutive wins5consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.610.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.600.991000.99
    32020.12.16 17:07buy20.011851.160.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.531008.52
    52020.12.21 15:09buy30.011872.270.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.801020.32
    72021.01.05 22:24buy40.011949.760.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.681023.00
    92021.01.12 18:46buy50.011842.010.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.461027.46
    112021.01.20 15:15buy60.011834.780.001851.35
    122021.01.20 16:06t/p60.011851.350.001851.3516.571044.03
    132021.01.20 19:24buy70.011863.290.001870.20
    142021.01.20 22:37t/p70.011870.200.001870.206.911050.94
    152021.01.25 18:18buy80.011847.720.001864.22
    162021.01.25 21:22buy90.011855.520.001858.99
    172021.01.26 04:07t/p90.011858.990.001858.992.981053.93
    182021.01.27 16:39close80.011832.720.001864.22-15.971037.95
    192021.01.28 19:30buy100.011840.840.001859.63
    202021.01.28 23:01buy110.011841.390.001844.75
    212021.01.29 02:09t/p110.011844.750.001844.752.871040.83
    222021.01.29 12:54t/p100.011859.630.001859.6318.301059.13
    232021.02.10 17:22buy120.011841.230.001854.70
    242021.02.10 22:09buy130.011842.100.001846.21
    252021.02.11 15:15t/p130.011846.210.001846.212.651061.78
    262021.02.11 19:09close120.011826.230.001854.70-16.461045.32
    272021.02.16 14:39buy140.011815.670.001823.53
    282021.02.16 15:37close140.011800.670.001823.53-15.001030.32
    292021.02.18 17:04buy150.011773.580.001787.03
    302021.02.18 20:09buy160.011774.390.001777.95
    312021.02.19 15:51t/p160.011777.950.001777.953.071033.40
    322021.02.19 16:09t/p150.011787.030.001787.0312.961046.36
    332021.03.11 16:48buy170.011719.930.001736.10
    342021.03.11 19:54buy180.011722.490.001725.88
    352021.03.11 20:06t/p180.011725.880.001725.883.391049.75
    362021.03.12 11:09close170.011704.930.001736.10-15.491034.27
    372021.03.16 13:54buy190.011731.560.001735.44
    382021.03.16 14:18t/p190.011735.440.001735.443.881038.15
    392021.03.17 13:48buy200.011728.370.001737.00
    402021.03.17 15:39buy210.011728.670.001731.81
    412021.03.17 16:22t/p210.011731.810.001731.813.141041.29
    422021.03.17 20:06t/p200.011737.000.001737.008.631049.92
    432021.04.19 15:15buy220.011775.930.001787.89
    442021.04.19 19:22buy230.011771.820.001776.60
    452021.04.20 17:09t/p230.011776.600.001776.604.291054.21
    462021.04.20 20:54buy240.011777.940.001780.24
    472021.04.21 04:09t/p240.011780.240.001780.241.811056.02
    482021.04.21 09:54t/p220.011787.890.001787.8910.991067.01
    492021.04.23 17:37buy250.011772.400.001795.78
    502021.04.27 18:22buy260.011779.470.001784.35
    512021.04.28 03:09close250.011772.390.001795.78-1.471065.54
    522021.04.28 12:24close260.011764.470.001784.35-15.491050.06
    532021.05.19 22:00buy270.011863.490.001881.95
    542021.05.20 01:22buy280.011869.360.001871.54
    552021.05.20 03:54t/p280.011871.540.001871.542.181052.24
    562021.05.20 19:49t/p270.011881.950.001881.9517.001069.24
    572021.05.21 19:18buy290.011870.800.001876.84
    582021.05.21 20:37t/p290.011876.840.001876.846.041075.28
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..7f6d4834c41f6ac8b90fe183b7300b640ebfe1bb GIT binary patch literal 8425 zcmcha^(qM~DBwWzxKhQ_Amme#iR zj?Q0Q-95d1{R4wT!y}_(B^VQvQ`0lEbMp&}OUo;(YwH_-Hn+BScK7xV4v&scPXGQp zJHNO*sldpm+4Ney^5b&hBD=b%B~D6)$!zf6Ye?MLAaHxElVC?Wx6? zFR3K}nix;A%d)|~t7CpxcvyBY0j=MdH~|BSVExcyJq24dMjkcwsQmU_bSyUt{1!a)z46Fz&{F1GXQ5A$w`NmW|*I1fq03qy{xg|M)+4N0=*!~2= za!B0y!UI+ zmUWjf0@ru9T;}bbOOO!PUmF0#V*%ShsSn7dbT9CpUzR!ZjdWHrBzY+_{97Hnvs>Of zmAveR-J-0OS`J{&0<)fB2}~SHU5?|M4*|9BX&n?Z|HQVi2&TU+%+~?kWESQ^O!t7& zXMC7XbKWVIItROR^rguZ>KT?21Qr)(CD>b97mbzSa95=6fy?sU?Dtspa1rKER}1Rj zdU{4v0$dRhv|n0qEl!tU#fP z6NUtn;0_$cALcLO_2!K-yZ|~Cfeebd%~g&$Did+8-59IcNeo?DHNXAnTx$%J`8DVO z>-|&YzJOHcvvK=4l;oR9G#&j4k_x#Jf(PI4Q(&sgVgLnM=kAF^= z41S}Ab@Q1omOpRCMV38ZBefWDo-DIlef!I_k#d8=3VS7vK!&mWwZ^;LF$=5E&tD?qIxBYy)F`|+%{t(;;2lnMaZN;)f5Lz{jk(bSvQESNfxkWqe{>L_vY>R!Rd8ECeIYdw=b zL(6A%hh#DlO_Z(4+B7fXN^#;a3et-|jBh7cQ;d zC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Or9MD%7P*Y;zRBUjF)NaF@t_X7~`N3VRI~q1!gLEpjvM$zN!JDZca4K^wEjBz3 zn`z#2DtDH_!UeZ86W_h7AYA>ZIHQo()hJu3WKx1we2zcYBYRO9UCL#`dmBn&K3$o# zSu#v*_c`aK1cb-~X|5Kom#OZHeV}IzqScz89B@X}(DfTVb<$_oFvr3n=^j%?f?V9b zDH-Bn<4TR`s}Ts8X9(#Tz1QGhma5BT{uTH$h{oW(9jJaz%-l{eDsPjcw24*Bilyq$ zA^?EbtieI;!YgUOd5>z0gO(>$;IABVw6`X&@(v>wzTSrkwi_xQyT3MG*VWj#KfRzX2W|e@ftB}3xjvM0x7?gl0_bGl+ zZA}D=7;H$v>PdNI_ktaojVUxcyE*A?S%}b1#;UZ6J;_3oj6Xg9;4)a$GH6xBx*UL5 zX{7q%gvi2R5uwuL4W$0xs#w4!n~A<$s01Ayw#7w|J=NM1#$~K{8A(5u$%Zy9JpfEt zV@jo-YD6wrr^(w2Bt+UcOwv@H$=I{`f##;$-P+zMF3Go5X?EJC)RJO9HNuvgje~S>XZez4>deJo=H#GvQdct`RpMD!8fX7 zVK{;zuNjtU)SR5z7pX>b>VI8&6w4yCl-_jCjqwv9Flh^jj<^0g@chw>Z zo1jZSXY0SH3`)b-8CZP~8)FGcx0!4<4z|^_zi&fCNhveB5+&F4qVYx7@XKTNhP(W{9tWqUcLCPW-^u-x?I zEjuL+36jd-w-@ssofP!mc13Mhc8O)J{&;e6%8iq}K{I--;49u@6xp@I>0>qew!PuF z7HcO&>v$5kbUOv$Wy3hijK!szz9%mY*s;stpMF2P(;|qq?3UrN_GINUp%-iSZRB0< z68*K-jo3N4#Lc{g&+X!I>t!49!%4W$-5=hz>(R)Evtpn71KYOS6=I)EEKGpN{{gr2 B9n1g# literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.htm b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.htm new file mode 100644 index 0000000..3739303 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 3.htm @@ -0,0 +1,102 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.06.29 23:45 (2020.01.01 - 2021.06.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test13911Ticks modelled17143577Modelling quality24.83%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit42.27Gross profit120.67Gross loss-78.40
    Profit factor1.54Expected payoff1.84
    Absolute drawdown5.66Maximal drawdown39.57 (3.73%)Relative drawdown3.73% (39.57)
    Total trades23Short positions (won %)0 (0.00%)Long positions (won %)23 (78.26%)
    Profit trades (% of total)18 (78.26%)Loss trades (% of total)5 (21.74%)
    Largestprofit trade17.97loss trade-16.46
    Averageprofit trade6.70loss trade-15.68
    Maximumconsecutive wins (profit in money)8 (55.00)consecutive losses (loss in money)2 (-30.97)
    Maximalconsecutive profit (count of wins)55.00 (8)consecutive loss (count of losses)-30.97 (2)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.610.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.600.991000.99
    32020.12.16 17:07buy20.011851.160.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.531008.52
    52020.12.21 15:09buy30.011872.270.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.801020.32
    72021.01.05 22:24buy40.011949.760.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.681023.00
    92021.01.12 18:46buy50.011842.010.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.461027.46
    112021.01.20 19:24buy60.011863.290.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.206.911034.37
    132021.01.28 20:00buy70.011838.060.001856.52
    142021.01.29 12:49t/p70.011856.520.001856.5217.971052.35
    152021.02.10 17:22buy80.011841.230.001854.70
    162021.02.10 22:09buy90.011842.100.001846.21
    172021.02.11 15:15t/p90.011846.210.001846.212.651055.00
    182021.02.11 19:09close80.011826.230.001854.70-16.461038.54
    192021.03.11 16:48buy100.011719.930.001736.10
    202021.03.11 19:54buy110.011722.490.001725.88
    212021.03.11 20:06t/p110.011725.880.001725.883.391041.93
    222021.03.12 11:09close100.011704.930.001736.10-15.491026.44
    232021.03.16 13:54buy120.011731.560.001735.44
    242021.03.16 14:18t/p120.011735.440.001735.443.881030.32
    252021.03.17 13:48buy130.011728.370.001737.00
    262021.03.17 15:39buy140.011728.670.001731.81
    272021.03.17 16:22t/p140.011731.810.001731.813.141033.46
    282021.03.17 20:06t/p130.011737.000.001737.008.631042.09
    292021.04.19 15:15buy150.011775.930.001787.89
    302021.04.19 19:22buy160.011771.820.001776.60
    312021.04.20 17:09t/p160.011776.600.001776.604.291046.39
    322021.04.21 09:54t/p150.011787.890.001787.8910.991057.37
    332021.04.27 18:22buy170.011779.470.001784.35
    342021.04.28 12:24close170.011764.470.001784.35-15.491041.89
    352021.05.19 22:00buy180.011863.490.001881.95
    362021.05.20 01:22buy190.011869.360.001871.54
    372021.05.20 03:54t/p190.011871.540.001871.542.181044.07
    382021.05.20 19:49t/p180.011881.950.001881.9517.001061.07
    392021.05.21 19:18buy200.011870.800.001876.84
    402021.05.21 20:37t/p200.011876.840.001876.846.041067.11
    412021.06.01 11:34buy210.011908.020.001915.21
    422021.06.01 13:39buy220.011905.620.001911.75
    432021.06.01 16:18t/p220.011911.750.001911.756.131073.24
    442021.06.01 17:54close210.011893.020.001915.21-15.001058.24
    452021.06.25 18:51buy230.011779.840.001787.90
    462021.06.29 14:22close230.011764.840.001787.90-15.971042.27
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..579675fc2b77c3a90000dbd8faef726b8a2318a9 GIT binary patch literal 8442 zcmch+^;cBi`~N+lz%Vq3l!Tyky$}?J6h*p3iJ?WhyQI5^ZWzg7XoR7=JCq!{8B(Nc zzPvy8|8SqR&suw5&&L(}oL~0Zm#q9JVG(1&Cj)?O004u*004lIkr51X7z{l{nwcRV zO-M5^6a{#EF&GpS{Afa&J(7=800uP&22=qa2YBxP<1nXC@c$VA!^lSwJcs%}5CAYk zKDs_Sg8^n{k2xOK|BH%wB#>rR;8rMR%MAQzfIg~V@FQo|3IGg)!L67_0Z@hdzqn>q z0JAO3qX+a+ta=n5Ys5ewaWEJF03(rRsK?68pvcFRP%skpI6*>Dk0Bq!wmy0yhXLSW zBp3>PgdX?zzk(j2|D{DfQYg%0!Df#dpvnvk06*^g|Nn>ke_!T*{{n!A@dpG31&4%& zg-1k2MaRU(LE{q=lafPEuOJmO>PdaoZp2#G-!9clmpZgTIPZHE8&7>I7>)t1HN|y-uzb z{M?aM3S*{~0%%}8$*af%`>##}JOw>cnaI)-T&#(Q zvRimr5S|yl<&t7U6>~|6m~=SP`>x=sV7Nh^8dgmR0kwd+T7mHgmLaH!3vB!SZ|vr8 z>LgAlSk`ErVv$Lno{RH>g~UaKuM7BSap?z7uUQXPurVqul%-e?SUYEFgyRTYqXpoQ zVSS<&2IzO51Ki}3gjI5=zI};Q4i+cVhJIJH;(_@uvWJ+FRcr zFdGE~ufAnsY3K~;2#mf8UGOI*Kh+EgF`|wLO>;;a@WW}VlMZdZ4|$HmU8|;VGbGf} zVOeGyX5=Z@=d{eR7qTUdA0>Yhi1p?CY6HN3Wg$fJDE$$!l;ZaGhFQiEEb3c5 zhnr`ikaA&O<6g z_pqX!gg}g@-*QJY0v(_F#R=j>bQ2lAO6vJ&TQH7c5(j@`Bqwaa1N1+6_4hxl1N_ed zPlJ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Zt0L_-TBQ0-SRL-+7|_1z zDxqqI>OE99Zn<0X+xe(#CE9q!Q@zY^*{rBteDqVUXU3Z5hS&$dwmRAEGzFsq5Z)TZ zL*^Z5t^cgr{o&Lb_pX9UvU9dl46U>FV~a(yeX_XxdOYsotkm!Rz`p%do?Due1 V*?xZGL!`$^NGXVgi{|~p|TnPXG literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.htm b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.htm new file mode 100644 index 0000000..6b6ee72 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 4.htm @@ -0,0 +1,102 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.06.29 23:45 (2020.01.01 - 2021.06.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test13911Ticks modelled17143577Modelling quality24.83%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit44.06Gross profit122.47Gross loss-78.41
    Profit factor1.56Expected payoff1.92
    Absolute drawdown5.46Maximal drawdown39.07 (3.68%)Relative drawdown3.68% (39.07)
    Total trades23Short positions (won %)0 (0.00%)Long positions (won %)23 (78.26%)
    Profit trades (% of total)18 (78.26%)Loss trades (% of total)5 (21.74%)
    Largestprofit trade18.07loss trade-16.46
    Averageprofit trade6.80loss trade-15.68
    Maximumconsecutive wins (profit in money)8 (55.80)consecutive losses (loss in money)2 (-30.97)
    Maximalconsecutive profit (count of wins)55.80 (8)consecutive loss (count of losses)-30.97 (2)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.510.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.601.091001.09
    32020.12.16 17:07buy20.011851.060.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.631008.72
    52020.12.21 15:09buy30.011872.170.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.901020.62
    72021.01.05 22:24buy40.011949.660.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.781023.40
    92021.01.12 18:46buy50.011841.910.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.561027.96
    112021.01.20 19:24buy60.011863.190.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.207.011034.97
    132021.01.28 20:00buy70.011837.960.001856.52
    142021.01.29 12:49t/p70.011856.520.001856.5218.071053.05
    152021.02.10 17:22buy80.011841.130.001854.70
    162021.02.10 22:09buy90.011842.000.001846.21
    172021.02.11 15:15t/p90.011846.210.001846.212.751055.80
    182021.02.11 19:09close80.011826.130.001854.70-16.461039.34
    192021.03.11 16:48buy100.011719.830.001736.10
    202021.03.11 19:54buy110.011722.390.001725.88
    212021.03.11 20:06t/p110.011725.880.001725.883.491042.83
    222021.03.12 11:09close100.011704.830.001736.10-15.491027.34
    232021.03.16 13:54buy120.011731.460.001735.44
    242021.03.16 14:18t/p120.011735.440.001735.443.981031.32
    252021.03.17 13:48buy130.011728.270.001737.00
    262021.03.17 15:39buy140.011728.570.001731.81
    272021.03.17 16:22t/p140.011731.810.001731.813.241034.56
    282021.03.17 20:06t/p130.011737.000.001737.008.731043.29
    292021.04.19 15:15buy150.011775.830.001787.89
    302021.04.19 19:22buy160.011771.720.001776.60
    312021.04.20 17:09t/p160.011776.600.001776.604.391047.69
    322021.04.21 09:54t/p150.011787.890.001787.8911.091058.77
    332021.04.27 18:22buy170.011779.370.001784.35
    342021.04.28 12:24close170.011764.360.001784.35-15.501043.28
    352021.05.19 22:00buy180.011863.390.001881.95
    362021.05.20 01:22buy190.011869.260.001871.54
    372021.05.20 03:54t/p190.011871.540.001871.542.281045.56
    382021.05.20 19:49t/p180.011881.950.001881.9517.101062.66
    392021.05.21 19:18buy200.011870.700.001876.84
    402021.05.21 20:37t/p200.011876.840.001876.846.141068.80
    412021.06.01 11:34buy210.011907.920.001915.21
    422021.06.01 13:39buy220.011905.520.001911.75
    432021.06.01 16:18t/p220.011911.750.001911.756.231075.03
    442021.06.01 17:54close210.011892.920.001915.21-15.001060.03
    452021.06.25 18:51buy230.011779.740.001787.90
    462021.06.29 14:22close230.011764.740.001787.90-15.971044.06
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 5.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..096ccb068390cd54ad4f225ff86302a83d30b528 GIT binary patch literal 8489 zcmchUg;x~L_xBeR*(D{Ek`j~<5NVc_?o>KOI;5my=`QK+TtISJmhMhbV3+QekdFQF z`9A-{GiT$$#^gf^=QE2QI9Df)3!ZE!bSk#5g0f={tX!XqN1qGMv? z;uC%(CMBn&rln_OW@YE(=H(X@78RG2mX%jPE32x1*3{P3H#EYU;LV7Z*0%PJ&aUpB z-oE~U!J*-i(XsJ~$x4i0Gr#}L&dnoH3yVw3E30ek8=G6(JG*=P2Zu+0k55j|{+(Z3 z9@k*xV%|OE+yfr=N#j?I$+o;4-5EHH^9tTyic;wIWkVhT(WY*SxKdzc5?As1rILW7zKL zmI_X>_gLZl@fqOgdsyN05I%2 z2e`>638>_defbor94tbl6aQ7whCL6mz#L*JZ6jEg=Woro_@p?7S6{!g{Iy9y@CqLt z1H3DwGcfup6bX4we5w@^VnQAfn&y}`=#SOjC=uFnAMz55twGJuZkV^T)4I|=%*2zY z-+75;H)K-+6eWKgi1F$CY8}9NWhIWsCBXLtjW7DLuG=GUP?i>p_bV*m86N;*j>EqK z`A7ghcwU^ShMBjVlq}dO3Gz3$?8FqgntYOEi8;9i6r(#f#1!9Qkub4byp|+%Skhg@ z2wvOWaz{Fmi9a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5rGOmY%?Qwf#UMe+9Yr3N$JiF`k9vr^taH)EJzrEkz zvZ`o)=+TjVJZ^sUdra%Hf#mg0Tw2SzAdN|zaVt@du`t7@hfAri!pBUqcPk$aImcxK zD_zJGLWUN3H5y|1yK9$(ynBw!%Q{l~3QOTuV(eSB5$u<6OF*P@NBE`??bXm< + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.06.29 23:45 (2020.01.01 - 2021.06.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test13911Ticks modelled17143577Modelling quality24.83%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit48.62Gross profit111.05Gross loss-62.43
    Profit factor1.78Expected payoff2.11
    Absolute drawdown5.66Maximal drawdown39.57 (3.78%)Relative drawdown3.78% (39.57)
    Total trades23Short positions (won %)0 (0.00%)Long positions (won %)23 (82.61%)
    Profit trades (% of total)19 (82.61%)Loss trades (% of total)4 (17.39%)
    Largestprofit trade17.00loss trade-16.46
    Averageprofit trade5.84loss trade-15.61
    Maximumconsecutive wins (profit in money)8 (43.17)consecutive losses (loss in money)1 (-16.46)
    Maximalconsecutive profit (count of wins)43.17 (8)consecutive loss (count of losses)-16.46 (1)
    Averageconsecutive wins4consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.610.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.600.991000.99
    32020.12.16 17:07buy20.011851.160.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.531008.52
    52020.12.21 15:09buy30.011872.270.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.801020.32
    72021.01.05 22:24buy40.011949.760.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.681023.00
    92021.01.12 18:46buy50.011842.010.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.461027.46
    112021.01.20 19:24buy60.011863.290.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.206.911034.37
    132021.01.28 20:00buy70.011838.060.001844.21
    142021.01.28 21:24t/p70.011844.210.001844.216.151040.52
    152021.02.10 17:22buy80.011841.230.001854.70
    162021.02.10 22:09buy90.011842.100.001846.21
    172021.02.11 15:15t/p90.011846.210.001846.212.651043.17
    182021.02.11 19:09close80.011826.230.001854.70-16.461026.72
    192021.03.11 16:48buy100.011719.930.001736.10
    202021.03.11 19:54buy110.011722.490.001725.88
    212021.03.11 20:06t/p110.011725.880.001725.883.391030.11
    222021.03.12 11:09close100.011704.930.001736.10-15.491014.62
    232021.03.16 13:54buy120.011731.560.001735.44
    242021.03.16 14:18t/p120.011735.440.001735.443.881018.50
    252021.03.17 13:48buy130.011728.370.001737.00
    262021.03.17 15:39buy140.011728.670.001731.81
    272021.03.17 16:22t/p140.011731.810.001731.813.141021.64
    282021.03.17 20:06t/p130.011737.000.001737.008.631030.27
    292021.04.19 15:15buy150.011775.930.001787.89
    302021.04.19 19:22buy160.011771.820.001776.60
    312021.04.20 17:09t/p160.011776.600.001776.604.291034.56
    322021.04.21 09:54t/p150.011787.890.001787.8910.991045.55
    332021.04.27 18:22buy170.011779.470.001784.35
    342021.04.28 12:24close170.011764.470.001784.35-15.491030.06
    352021.05.19 22:00buy180.011863.490.001881.95
    362021.05.20 01:22buy190.011869.360.001871.54
    372021.05.20 03:54t/p190.011871.540.001871.542.181032.24
    382021.05.20 19:49t/p180.011881.950.001881.9517.001049.25
    392021.05.21 19:18buy200.011870.800.001876.84
    402021.05.21 20:37t/p200.011876.840.001876.846.041055.29
    412021.06.01 11:34buy210.011908.020.001915.21
    422021.06.01 13:39buy220.011905.620.001911.75
    432021.06.01 16:18t/p220.011911.750.001911.756.131061.42
    442021.06.01 17:54close210.011893.020.001915.21-15.001046.42
    452021.06.25 18:51buy230.011779.840.001782.53
    462021.06.28 01:52t/p230.011782.530.001782.532.201048.62
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 6.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..0e22ca448457c429253c34e5099d9e777af2227f GIT binary patch literal 8170 zcmchb^;Z1jI#JI;CqVm+o%Zg{78mlvr92*rmHc zLYn<@f1dy0nKN_F%=LaJl)000h$0{{SngM&B}8Vox^K_I9* z6AA)`VF7mohr`0acP13%j=Y-!aM)=u013G3;OYOz;f`S7{}}*i)SU>P#{Lfk03fJ4 z*E?r000Ozoaku_2D(;RzL6G297;X&$zB9n?R519CgR}wwXfU`HcP9Xl*#E_aAOVmy z+?@yPPDI{`cQxW*cQ_af0Dw^_2==Zr2n=A*NRdr2m9jd;ev8lPGwXMCQ zv#Y!3=da$r{sHvh(D2A89PjtUA$l>BwjZD^=;M-;C6=wwkV@cNXayt09%q(BV&~sq={XYQ+@dC7JC+v|0aM%I^qLe z+^S+2r&d-%O5B=qq@Y>b1YLYlug=T-t=ayXVhwG2A;P*BwePi*6}UMQYhS$Y$SBWY zV~_!8;}PUl(;36RA2gs0HiVWNC^_KpN}|(I<)!!WMsML)CGa33 zFOb!oN&}Luv{XVioaIedFfzErBu^8sI)sGoxus@-*<1Djn7B*M`kUYQ&E{GZPKS6l z+xo@gV}d>ZP75&cvt_<6;QiS-AHkoH9=u>PY*;9Ju@SI#+RBvB5xB$vAf&{Tr+Wo3 z?mPv!DJ8s8&w6D3Awn%!l2Q+5p<*qV<3Gz2V)@Qmyd=lZN^FjxFj~~mu%ndCG$43U zjD@|SGo&Lh>O2(V|A6X9CnUs_4jP*BEv3(ou&quuwD~54mQbKp)7W-Ew4=icZWm_i z`Qn$;JnvS>nk*<%=`axQ!|C}7K=}Nt4C(V%VgxucDcb5TkH9_!W(Ai@FK?~8V;mpJJfLW}Fak&=05*WKa%FQ_-@)4fxmKK)Z*$WiX>&P|=JmX8o`s@n zg?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v%V>`RvZT|a$b64dSRFTB z=yttx$O?{JzK-jB`ijQyS}v0JiNTvs_#?2*UGC8>(>F8>R7^#VMb!LO&-ok1NOU%` znF9=z*=6feP$JO}ze5EaFqGk3b)3uBn_`c;{_y>)EhEFTQ0c||wh}G2ToKt(W(SN3 zS@CiqY5Y%=8;7&{T)7{ly;s|9%*BH}({<(Dt5N60jFQ)L3`mY^O5@K>pzbw;cK021 zOS531a*g#jww@!-m@jYqYo5jKYd9UJt4ynxaf~CZ9vQOD5i-BRKa|`Ol=M-aXR7Tv zBRk9=NMEQ=Jbx`segup3S>+IF?AM4nN+|bP6L4rme + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.06.29 23:45 (2020.01.01 - 2021.06.30)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test13911Ticks modelled17143577Modelling quality24.83%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit56.72Gross profit102.70Gross loss-45.97
    Profit factor2.23Expected payoff2.84
    Absolute drawdown5.66Maximal drawdown30.08 (2.87%)Relative drawdown2.87% (30.08)
    Total trades20Short positions (won %)0 (0.00%)Long positions (won %)20 (85.00%)
    Profit trades (% of total)17 (85.00%)Loss trades (% of total)3 (15.00%)
    Largestprofit trade17.00loss trade-15.49
    Averageprofit trade6.04loss trade-15.32
    Maximumconsecutive wins (profit in money)8 (40.41)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)40.41 (8)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins6consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.610.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.600.991000.99
    32020.12.16 17:07buy20.011851.160.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.531008.52
    52020.12.21 15:09buy30.011872.270.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.801020.32
    72021.01.05 22:24buy40.011949.760.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.681023.00
    92021.01.12 18:46buy50.011842.010.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.461027.46
    112021.01.20 19:24buy60.011863.290.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.206.911034.37
    132021.02.10 22:09buy70.011842.100.001846.21
    142021.02.11 15:15t/p70.011846.210.001846.212.651037.02
    152021.03.11 16:48buy80.011719.930.001736.10
    162021.03.11 19:54buy90.011722.490.001725.88
    172021.03.11 20:06t/p90.011725.880.001725.883.391040.41
    182021.03.12 11:09close80.011704.930.001736.10-15.491024.93
    192021.03.16 13:54buy100.011731.560.001735.44
    202021.03.16 14:18t/p100.011735.440.001735.443.881028.81
    212021.03.17 13:48buy110.011728.370.001737.00
    222021.03.17 15:39buy120.011728.670.001731.81
    232021.03.17 16:22t/p120.011731.810.001731.813.141031.95
    242021.03.17 20:06t/p110.011737.000.001737.008.631040.58
    252021.04.19 15:15buy130.011775.930.001787.89
    262021.04.19 19:22buy140.011771.820.001776.60
    272021.04.20 17:09t/p140.011776.600.001776.604.291044.87
    282021.04.21 09:54t/p130.011787.890.001787.8910.991055.86
    292021.04.27 18:22buy150.011779.470.001784.35
    302021.04.28 12:24close150.011764.470.001784.35-15.491040.37
    312021.05.19 22:00buy160.011863.490.001881.95
    322021.05.20 01:22buy170.011869.360.001871.54
    332021.05.20 03:54t/p170.011871.540.001871.542.181042.55
    342021.05.20 19:49t/p160.011881.950.001881.9517.001059.55
    352021.05.21 19:18buy180.011870.800.001876.84
    362021.05.21 20:37t/p180.011876.840.001876.846.041065.59
    372021.06.01 11:34buy190.011908.020.001915.21
    382021.06.01 13:39buy200.011905.620.001911.75
    392021.06.01 16:18t/p200.011911.750.001911.756.131071.72
    402021.06.01 17:54close190.011893.020.001915.21-15.001056.72
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 7.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 7.gif new file mode 100644 index 0000000000000000000000000000000000000000..f23e029d08fa8ae9153940a75f92dce797571a82 GIT binary patch literal 8008 zcmch$g;x{a|35x@BScENd?6(ug4Ae>Zi5mKrADJD-7z|(8Kb*vbc)2-V3fdyNOwp# z`|^4J{)gW^_nz}S&qq9;&wI~RQF|>d^YIzcAYcsuz~k`%004zT;Ss~&_(O!XHR3LX zum;ED0CxwE$Hjy1QV8oi=3NND<7U8s8o=EK&-{Np{9!!!e+j@a;tmAQ;QmJh0IU&r z(mOF2U~LTm{Ld192P3R&z#Z}URcr8_fBYQ;27~W#Fv7Y602l^?JMecHpa%CpU+Wrx z^(y{O6n_WS+<|vJ;^V>KJNG*o0%482>&!YHaaS@PjKJLmhz#AQof0t&01qR; z@$q-0yZQdFp*zz5RYu&gaQM51t?w{EjWrkmzMK31|0Q&H`+)y@3ji5D01y-$5*ii` zjfjkjj){$nPe}Zcl$?^9mY$Ib%YtX;s0*cF60^}Q`1s;KWW3DRoHgYM!Zu4i zYPWv`_FG29GGoGhrzZv2A9H1XU%`8Ge|&_0S@#iye8h!^{a0)XY?!gLAaMmQvH(bE z2=a)SlzYM7+UDY-)Wh-0Y*6G78voVl%D4I#yp1ZK)^x)Jlo zu7bIH(c@W}{=C3?=qe#7O6^||!JCuwWq|0ptrDe}v?LLpO5s7?^Y203e4Hc_pAmti zl7N6mlICE%@OXt!lRU zGp>;z%##+X&t(1xi9v2A+1S-NBP>^&F zYf)P4lmVfBagHIP$(N7Z&4gkFf$&!i##vRANmq~a(t@_v5V&`Yj?FEW>zmcG3>_CO!$etaObD3c<%4X+El=7!JTA z>Ud%#aS0!E`2PJRz^`D_6lPLZ{)9)qh7da<-(v!c9@-#&ZgKQ@jHK54IR-K%B3lN= z%n2Q`cU+T}Psd)m;rd$?2?%{|8Az zJMRFApbr;PgGOIf*rkk{Pl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Long/StrategyTester Long 7.htm new file mode 100644 index 0000000..0958fdd --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 7.htm @@ -0,0 +1,143 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.12.30 23:45 (2020.01.01 - 2021.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test25902Ticks modelled27850269Modelling quality24.91%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit126.08Gross profit187.55Gross loss-61.47
    Profit factor3.05Expected payoff3.41
    Absolute drawdown5.46Maximal drawdown29.68 (2.83%)Relative drawdown2.83% (29.68)
    Total trades37Short positions (won %)0 (0.00%)Long positions (won %)37 (89.19%)
    Profit trades (% of total)33 (89.19%)Loss trades (% of total)4 (10.81%)
    Largestprofit trade17.10loss trade-15.50
    Averageprofit trade5.68loss trade-15.37
    Maximumconsecutive wins (profit in money)16 (83.15)consecutive losses (loss in money)1 (-15.50)
    Maximalconsecutive profit (count of wins)83.15 (16)consecutive loss (count of losses)-15.50 (1)
    Averageconsecutive wins8consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.510.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.601.091001.09
    32020.12.16 17:07buy20.011851.060.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.631008.72
    52020.12.21 15:09buy30.011872.170.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.901020.62
    72021.01.05 22:24buy40.011949.660.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.781023.40
    92021.01.12 18:46buy50.011841.910.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.561027.96
    112021.01.20 19:24buy60.011863.190.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.207.011034.97
    132021.02.10 22:09buy70.011842.000.001846.21
    142021.02.11 15:15t/p70.011846.210.001846.212.751037.72
    152021.03.11 16:48buy80.011719.830.001736.10
    162021.03.11 19:54buy90.011722.390.001725.88
    172021.03.11 20:06t/p90.011725.880.001725.883.491041.21
    182021.03.12 11:09close80.011704.830.001736.10-15.491025.73
    192021.03.16 13:54buy100.011731.460.001735.44
    202021.03.16 14:18t/p100.011735.440.001735.443.981029.71
    212021.03.17 13:48buy110.011728.270.001737.00
    222021.03.17 15:39buy120.011728.570.001731.81
    232021.03.17 16:22t/p120.011731.810.001731.813.241032.95
    242021.03.17 20:06t/p110.011737.000.001737.008.731041.68
    252021.04.19 15:15buy130.011775.830.001787.89
    262021.04.19 19:22buy140.011771.720.001776.60
    272021.04.20 17:09t/p140.011776.600.001776.604.391046.07
    282021.04.21 09:54t/p130.011787.890.001787.8911.091057.16
    292021.04.27 18:22buy150.011779.370.001784.35
    302021.04.28 12:24close150.011764.360.001784.35-15.501041.66
    312021.05.19 22:00buy160.011863.390.001881.95
    322021.05.20 01:22buy170.011869.260.001871.54
    332021.05.20 03:54t/p170.011871.540.001871.542.281043.94
    342021.05.20 19:49t/p160.011881.950.001881.9517.101061.04
    352021.05.21 19:18buy180.011870.700.001876.84
    362021.05.21 20:37t/p180.011876.840.001876.846.141067.18
    372021.06.01 11:34buy190.011907.920.001915.21
    382021.06.01 13:39buy200.011905.520.001911.75
    392021.06.01 16:18t/p200.011911.750.001911.756.231073.41
    402021.06.01 17:54close190.011892.920.001915.21-15.001058.41
    412021.07.06 19:07buy210.011794.010.001807.68
    422021.07.07 13:24t/p210.011807.680.001807.6813.181071.60
    432021.07.08 18:04buy220.011801.860.001814.59
    442021.07.13 15:39t/p220.011814.590.001814.5911.271082.87
    452021.07.15 15:54buy230.011823.580.001828.43
    462021.07.15 20:37t/p230.011828.430.001828.434.851087.72
    472021.07.20 21:03buy240.011809.650.001811.85
    482021.07.21 09:09t/p240.011811.850.001811.851.711089.43
    492021.07.27 21:54buy250.011800.120.001801.88
    502021.07.28 04:21t/p250.011801.880.001801.881.271090.71
    512021.08.17 17:15buy260.011782.610.001792.83
    522021.08.18 09:37t/p260.011792.830.001792.839.731100.44
    532021.09.09 16:52buy270.011791.470.001794.24
    542021.09.09 20:00t/p270.011794.240.001794.242.771103.21
    552021.09.13 19:09buy280.011794.270.001797.46
    562021.09.14 15:54t/p280.011797.460.001797.462.701105.91
    572021.09.17 16:54buy290.011749.140.001753.88
    582021.09.17 17:07t/p290.011753.880.001753.884.741110.65
    592021.10.12 18:37buy300.011762.070.001764.41
    602021.10.13 10:37t/p300.011764.410.001764.411.851112.51
    612021.10.21 14:54buy310.011778.060.001787.33
    622021.10.21 17:00buy320.011779.850.001785.79
    632021.10.22 02:39t/p320.011785.790.001785.795.451117.96
    642021.10.22 06:19t/p310.011787.330.001787.338.781126.75
    652021.10.22 23:38buy330.011792.440.001794.37
    662021.10.25 03:00t/p330.011794.370.001794.371.441128.19
    672021.11.10 01:34buy340.011831.630.001832.49
    682021.11.10 15:34t/p340.011832.490.001832.490.861129.05
    692021.11.16 18:24buy350.011856.850.001864.27
    702021.11.17 14:54t/p350.011864.270.001864.276.931135.98
    712021.12.21 16:52buy360.011793.720.001799.79
    722021.12.22 20:09t/p360.011799.790.001799.795.581141.57
    732021.12.28 18:04buy370.011811.250.001815.71
    742021.12.29 12:39close370.011796.250.001815.71-15.491126.08
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 8.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 8.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd48ba43bda6437a9d47170aa689744713afda73 GIT binary patch literal 8190 zcmch4^;;Co_x6Ga3rH(nf`Sr)iULarN=vJBBe8&hNaxb*0?X3fNOvrqg7gAXyDZ(^ zASL_d`Mm$bJJ-xyGv~g~J?G5KFGpTcPDIpH=w2US9RR@LZ~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@VSgJ&uWd4&(2c zQ6v;ntzeM;H&QI%UxrQfefUvC!s_y + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2022.12.30 20:45 (2020.01.01 - 2022.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test49605Ticks modelled54257661Modelling quality33.32%
    Mismatched charts errors5
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit157.15Gross profit267.02Gross loss-109.87
    Profit factor2.43Expected payoff2.97
    Absolute drawdown5.46Maximal drawdown56.48 (4.94%)Relative drawdown4.94% (56.48)
    Total trades53Short positions (won %)0 (0.00%)Long positions (won %)53 (86.79%)
    Profit trades (% of total)46 (86.79%)Loss trades (% of total)7 (13.21%)
    Largestprofit trade18.22loss trade-16.46
    Averageprofit trade5.80loss trade-15.70
    Maximumconsecutive wins (profit in money)16 (83.15)consecutive losses (loss in money)2 (-31.95)
    Maximalconsecutive profit (count of wins)83.15 (16)consecutive loss (count of losses)-31.95 (2)
    Averageconsecutive wins7consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.510.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.601.091001.09
    32020.12.16 17:07buy20.011851.060.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.631008.72
    52020.12.21 15:09buy30.011872.170.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.901020.62
    72021.01.05 22:24buy40.011949.660.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.781023.40
    92021.01.12 18:46buy50.011841.910.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.561027.96
    112021.01.20 19:24buy60.011863.190.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.207.011034.97
    132021.02.10 22:09buy70.011842.000.001846.21
    142021.02.11 15:15t/p70.011846.210.001846.212.751037.72
    152021.03.11 16:48buy80.011719.830.001736.10
    162021.03.11 19:54buy90.011722.390.001725.88
    172021.03.11 20:06t/p90.011725.880.001725.883.491041.21
    182021.03.12 11:09close80.011704.830.001736.10-15.491025.73
    192021.03.16 13:54buy100.011731.460.001735.44
    202021.03.16 14:18t/p100.011735.440.001735.443.981029.71
    212021.03.17 13:48buy110.011728.270.001737.00
    222021.03.17 15:39buy120.011728.570.001731.81
    232021.03.17 16:22t/p120.011731.810.001731.813.241032.95
    242021.03.17 20:06t/p110.011737.000.001737.008.731041.68
    252021.04.19 15:15buy130.011775.830.001787.89
    262021.04.19 19:22buy140.011771.720.001776.60
    272021.04.20 17:09t/p140.011776.600.001776.604.391046.07
    282021.04.21 09:54t/p130.011787.890.001787.8911.091057.16
    292021.04.27 18:22buy150.011779.370.001784.35
    302021.04.28 12:24close150.011764.360.001784.35-15.501041.66
    312021.05.19 22:00buy160.011863.390.001881.95
    322021.05.20 01:22buy170.011869.260.001871.54
    332021.05.20 03:54t/p170.011871.540.001871.542.281043.94
    342021.05.20 19:49t/p160.011881.950.001881.9517.101061.04
    352021.05.21 19:18buy180.011870.700.001876.84
    362021.05.21 20:37t/p180.011876.840.001876.846.141067.18
    372021.06.01 11:34buy190.011907.920.001915.21
    382021.06.01 13:39buy200.011905.520.001911.75
    392021.06.01 16:18t/p200.011911.750.001911.756.231073.41
    402021.06.01 17:54close190.011892.920.001915.21-15.001058.41
    412021.07.06 19:07buy210.011794.010.001807.68
    422021.07.07 13:24t/p210.011807.680.001807.6813.181071.60
    432021.07.08 18:04buy220.011801.860.001814.59
    442021.07.13 15:39t/p220.011814.590.001814.5911.271082.87
    452021.07.15 15:54buy230.011823.580.001828.43
    462021.07.15 20:37t/p230.011828.430.001828.434.851087.72
    472021.07.20 21:03buy240.011809.650.001811.85
    482021.07.21 09:09t/p240.011811.850.001811.851.711089.43
    492021.07.27 21:54buy250.011800.120.001801.88
    502021.07.28 04:21t/p250.011801.880.001801.881.271090.71
    512021.08.17 17:15buy260.011782.610.001792.83
    522021.08.18 09:37t/p260.011792.830.001792.839.731100.44
    532021.09.09 16:52buy270.011791.470.001794.24
    542021.09.09 20:00t/p270.011794.240.001794.242.771103.21
    552021.09.13 19:09buy280.011794.270.001797.46
    562021.09.14 15:54t/p280.011797.460.001797.462.701105.91
    572021.09.17 16:54buy290.011749.140.001753.88
    582021.09.17 17:07t/p290.011753.880.001753.884.741110.65
    592021.10.12 18:37buy300.011762.070.001764.41
    602021.10.13 10:37t/p300.011764.410.001764.411.851112.51
    612021.10.21 14:54buy310.011778.060.001787.33
    622021.10.21 17:00buy320.011779.850.001785.79
    632021.10.22 02:39t/p320.011785.790.001785.795.451117.96
    642021.10.22 06:19t/p310.011787.330.001787.338.781126.75
    652021.10.22 23:38buy330.011792.440.001794.37
    662021.10.25 03:00t/p330.011794.370.001794.371.441128.19
    672021.11.10 01:34buy340.011831.630.001832.49
    682021.11.10 15:34t/p340.011832.490.001832.490.861129.05
    692021.11.16 18:24buy350.011856.850.001864.27
    702021.11.17 14:54t/p350.011864.270.001864.276.931135.98
    712021.12.21 16:52buy360.011793.720.001799.79
    722021.12.22 20:09t/p360.011799.790.001799.795.581141.57
    732021.12.28 18:04buy370.011811.250.001815.71
    742021.12.29 12:39close370.011796.250.001815.71-15.491126.08
    752022.01.05 21:39buy380.011814.810.001818.13
    762022.01.06 08:54close380.011799.810.001818.13-16.461109.62
    772022.02.15 11:09buy390.011857.700.001877.87
    782022.02.15 13:37buy400.011854.470.001857.60
    792022.02.16 11:49t/p400.011857.600.001857.602.641112.26
    802022.02.17 10:17t/p390.011877.870.001877.8718.221130.49
    812022.02.22 12:24buy410.011896.110.001904.28
    822022.02.22 15:30t/p410.011904.280.001904.288.171138.66
    832022.04.26 17:36buy420.011901.270.001904.54
    842022.04.26 17:38t/p420.011904.540.001904.543.271141.93
    852022.05.23 09:02buy430.011854.300.001857.99
    862022.05.23 11:08t/p430.011857.990.001857.993.691145.62
    872022.05.27 18:03buy440.011853.000.001855.43
    882022.05.30 04:37t/p440.011855.430.001855.431.941147.56
    892022.07.27 16:43buy450.011715.740.001718.17
    902022.07.27 18:17t/p450.011718.170.001718.172.431149.99
    912022.09.14 19:18buy460.011702.510.001706.58
    922022.09.15 07:56close460.011687.510.001706.58-16.461133.53
    932022.09.30 20:35buy470.011663.060.001671.54
    942022.10.03 16:16t/p470.011671.540.001671.547.991141.53
    952022.11.30 17:18buy480.011751.820.001763.12
    962022.11.30 20:08buy490.011751.520.001754.09
    972022.11.30 20:33t/p490.011754.090.001754.092.571144.10
    982022.11.30 21:20t/p480.011763.120.001763.1211.301155.40
    992022.12.09 17:23buy500.011791.160.001800.19
    1002022.12.09 18:20t/p500.011800.190.001800.199.031164.43
    1012022.12.09 20:01buy510.011798.720.001805.93
    1022022.12.12 17:37close510.011783.720.001805.93-15.491148.94
    1032022.12.16 16:17buy520.011783.190.001787.72
    1042022.12.16 16:48t/p520.011787.720.001787.724.531153.47
    1052022.12.22 11:30buy530.011815.760.001819.44
    1062022.12.22 15:20t/p530.011819.440.001819.443.681157.15
    +
    diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.gif b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.gif new file mode 100644 index 0000000000000000000000000000000000000000..bf30e2f181ba55c11a3b7b5d3374d0cf261c04b7 GIT binary patch literal 8429 zcmc(D^;a9r^L2n0f~7!#Vg(Atr4*MID+P)cDmYXqE(MCahv4q+!9sBoq_{f-2<{r( zC10M;`$xQccK6J=bLY|pQJ8fT@dwQ)lUkFe2WbGHUtGKi^MC?isQ;;$zyK!emNy#axY3Ui6S=l+cdHDr}Ma9sP(z5ajSmocU>YCcR`i4e0 zqN%y1^{Oh4OrFo}h{?=>95_yFJ%iRjB@s`qkqa!D>wnB?UH?_-aAT zPl{L$n3l#MV;~zx=t&CY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;LqhS_*a_RPq6r>2oq9A|rUh))wP=}1gLI31)TNf)E5sWAG z{V5PED^~pp1%m#xzNH`GP{(^+megTWG{glJ1G|0Bg?uW0tP1^j>2>+sRIH zn^dB*APFL{kZmEDg4u*(f602Hqp|d*66#oHbr+#7b~I%CyC;=15Gk|CJgu2j${C<@D7}q*xNNq{!hjIMywySO^ac zhL#XLdHn}bei-Fcv7C(_J8L9jKM+!T|MgTD2M$n`_aO!>>d?6~<4RUwp?9_LXrWEe zB><3Yc@bqu)ef5CV`ldt0J2R}kf2ATZE2aZY(#4~c=^CQDKSD8D=LN4_K7VE3QFm6nH@Z_}<&WN!ApG_*_p`F;7li!0^Aa|dqeTb-{iBEx-$ zXsm_OnD4!!9nZB-9Ss~!7I2ZHmXsR0!B(91*2x3vUme)}^0%hSIlqM4;1<2$v3R_c zFqX-Cmc~54LuB29mD*KRLO5WgOUpP>nRJ%m*k_@B>4q#q*A$rdt2V{B6xKE!|HWx7 z|Bmx)Hsq|DRo8Kj!vWk|+In8X>q%gn8$V+N3al4NC6hXFZ4p^;f*E|@SJ|SPgR*~V zknK0Gq8FQdydi9>kPgPU=>5<|bP2RJ^x3!&_RV-W$+{h;6TRD?X?mhHOqOtKqdW(% z!nW<`ddm3N`4gQ1U$WNnh)H-(2ebR3bg3RA6E+qvv|=Q;fdMI|TJE zXI&l+VDl50@VK4DgN;>vq|!SvH7fBcb2G)I6OM;f_@#Dhe9}d7Sg0I&z`DuI02#yi zdXj_OYo=yc8!6E=7zlN?MUVeP(c$SdmLd0cL#5miC9>xk6|WApQt8K$H&^j&0%z`0 wo)%AA%H|H5FIt}5ABKA0uDxox8jid_E%CnFvu(Lqe1f^`_rC8Zd<2mAKYqhMN&o-= literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.htm b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.htm new file mode 100644 index 0000000..2f98b76 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Long/StrategyTester Long 9.htm @@ -0,0 +1,205 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.02 03:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63365Ticks modelled72611240Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit113.62Gross profit318.41Gross loss-204.79
    Profit factor1.55Expected payoff1.67
    Absolute drawdown5.48Maximal drawdown56.49 (4.95%)Relative drawdown4.95% (56.49)
    Total trades68Short positions (won %)0 (0.00%)Long positions (won %)68 (80.88%)
    Profit trades (% of total)55 (80.88%)Loss trades (% of total)13 (19.12%)
    Largestprofit trade18.21loss trade-16.48
    Averageprofit trade5.79loss trade-15.75
    Maximumconsecutive wins (profit in money)16 (83.02)consecutive losses (loss in money)2 (-31.95)
    Maximalconsecutive profit (count of wins)83.02 (16)consecutive loss (count of losses)-31.95 (2)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 01:49buy10.011840.520.001841.60
    22020.12.04 02:34t/p10.011841.600.001841.601.081001.08
    32020.12.16 17:07buy20.011851.070.001858.69
    42020.12.16 21:52t/p20.011858.690.001858.697.621008.70
    52020.12.21 15:09buy30.011872.180.001884.07
    62020.12.21 15:48t/p30.011884.070.001884.0711.891020.59
    72021.01.05 22:24buy40.011949.670.001952.93
    82021.01.06 01:33t/p40.011952.930.001952.932.771023.36
    92021.01.12 18:46buy50.011841.920.001846.47
    102021.01.12 20:34t/p50.011846.470.001846.474.551027.91
    112021.01.20 19:24buy60.011863.200.001870.20
    122021.01.20 22:37t/p60.011870.200.001870.207.001034.91
    132021.02.10 22:09buy70.011842.010.001846.21
    142021.02.11 15:15t/p70.011846.210.001846.212.741037.65
    152021.03.11 16:48buy80.011719.840.001736.10
    162021.03.11 19:54buy90.011722.400.001725.88
    172021.03.11 20:06t/p90.011725.880.001725.883.481041.13
    182021.03.12 11:09close80.011704.840.001736.10-15.491025.65
    192021.03.16 13:54buy100.011731.470.001735.44
    202021.03.16 14:18t/p100.011735.440.001735.443.971029.62
    212021.03.17 13:48buy110.011728.280.001737.00
    222021.03.17 15:39buy120.011728.580.001731.81
    232021.03.17 16:22t/p120.011731.810.001731.813.231032.85
    242021.03.17 20:06t/p110.011737.000.001737.008.721041.57
    252021.04.19 15:15buy130.011775.840.001787.89
    262021.04.19 19:22buy140.011771.730.001776.60
    272021.04.20 17:09t/p140.011776.600.001776.604.381045.95
    282021.04.21 09:54t/p130.011787.890.001787.8911.081057.03
    292021.04.27 18:22buy150.011779.380.001784.35
    302021.04.28 12:24close150.011764.380.001784.35-15.491041.54
    312021.05.19 22:00buy160.011863.400.001881.95
    322021.05.20 01:22buy170.011869.270.001871.54
    332021.05.20 03:54t/p170.011871.540.001871.542.271043.81
    342021.05.20 19:49t/p160.011881.950.001881.9517.091060.90
    352021.05.21 19:18buy180.011870.710.001876.84
    362021.05.21 20:37t/p180.011876.840.001876.846.131067.03
    372021.06.01 11:34buy190.011907.930.001915.21
    382021.06.01 13:39buy200.011905.530.001911.75
    392021.06.01 16:18t/p200.011911.750.001911.756.221073.25
    402021.06.01 17:54close190.011892.930.001915.21-15.001058.25
    412021.07.06 19:07buy210.011794.020.001807.68
    422021.07.07 13:24t/p210.011807.680.001807.6813.171071.43
    432021.07.08 18:04buy220.011801.870.001814.59
    442021.07.13 15:39t/p220.011814.590.001814.5911.261082.69
    452021.07.15 15:54buy230.011823.590.001828.43
    462021.07.15 20:37t/p230.011828.430.001828.434.841087.53
    472021.07.20 21:03buy240.011809.660.001811.85
    482021.07.21 09:09t/p240.011811.850.001811.851.701089.23
    492021.07.27 21:54buy250.011800.130.001801.88
    502021.07.28 04:21t/p250.011801.880.001801.881.261090.50
    512021.08.17 17:15buy260.011782.620.001792.83
    522021.08.18 09:37t/p260.011792.830.001792.839.721100.22
    532021.09.09 16:52buy270.011791.480.001794.25
    542021.09.09 20:00t/p270.011794.250.001794.252.771102.99
    552021.09.13 19:09buy280.011794.280.001797.46
    562021.09.14 15:54t/p280.011797.460.001797.462.691105.68
    572021.09.17 16:54buy290.011749.150.001753.89
    582021.09.17 17:07t/p290.011753.890.001753.894.741110.42
    592021.10.12 18:37buy300.011762.080.001764.42
    602021.10.13 10:37t/p300.011764.420.001764.421.851112.28
    612021.10.21 14:54buy310.011778.070.001787.33
    622021.10.21 17:00buy320.011779.860.001785.79
    632021.10.22 02:39t/p320.011785.790.001785.795.441117.72
    642021.10.22 06:19t/p310.011787.330.001787.338.771126.50
    652021.10.22 23:38buy330.011792.450.001794.37
    662021.10.25 03:00t/p330.011794.370.001794.371.431127.93
    672021.11.10 01:34buy340.011831.640.001832.49
    682021.11.10 15:34t/p340.011832.490.001832.490.851128.78
    692021.11.16 18:24buy350.011856.860.001864.27
    702021.11.17 14:54t/p350.011864.270.001864.276.921135.70
    712021.12.21 16:52buy360.011793.730.001799.79
    722021.12.22 20:09t/p360.011799.790.001799.795.571141.28
    732021.12.28 18:04buy370.011811.260.001815.71
    742021.12.29 12:39close370.011796.260.001815.71-15.491125.79
    752022.01.05 21:39buy380.011814.820.001818.14
    762022.01.06 08:54close380.011799.820.001818.14-16.461109.33
    772022.02.15 11:09buy390.011857.710.001877.87
    782022.02.15 13:37buy400.011854.480.001857.60
    792022.02.16 11:49t/p400.011857.600.001857.602.631111.96
    802022.02.17 10:17t/p390.011877.870.001877.8718.211130.18
    812022.02.22 12:24buy410.011896.120.001904.28
    822022.02.22 15:30t/p410.011904.280.001904.288.161138.34
    832022.04.26 17:36buy420.011901.280.001904.54
    842022.04.26 17:38t/p420.011904.540.001904.543.261141.60
    852022.05.23 09:02buy430.011854.310.001857.99
    862022.05.23 11:08t/p430.011857.990.001857.993.681145.28
    872022.05.27 18:03buy440.011853.010.001855.44
    882022.05.30 04:37t/p440.011855.440.001855.441.941147.22
    892022.07.27 16:43buy450.011715.750.001718.18
    902022.07.27 18:17t/p450.011718.180.001718.182.431149.65
    912022.09.14 19:18buy460.011702.520.001706.58
    922022.09.15 07:56close460.011687.510.001706.58-16.471133.18
    932022.09.30 20:35buy470.011663.070.001671.54
    942022.10.03 16:16t/p470.011671.540.001671.547.981141.17
    952022.11.30 17:18buy480.011751.830.001763.12
    962022.11.30 20:08buy490.011751.530.001754.09
    972022.11.30 20:33t/p490.011754.090.001754.092.561143.73
    982022.11.30 21:20t/p480.011763.120.001763.1211.291155.02
    992022.12.09 17:23buy500.011791.170.001800.19
    1002022.12.09 18:20t/p500.011800.190.001800.199.021164.04
    1012022.12.09 20:01buy510.011798.730.001805.93
    1022022.12.12 17:37close510.011783.730.001805.93-15.491148.55
    1032022.12.16 16:17buy520.011783.200.001787.72
    1042022.12.16 16:48t/p520.011787.720.001787.724.521153.07
    1052022.12.22 11:30buy530.011815.770.001819.44
    1062022.12.22 15:20t/p530.011819.440.001819.443.671156.74
    1072023.01.03 03:27buy540.011827.900.001832.34
    1082023.01.03 04:36t/p540.011832.340.001832.344.441161.18
    1092023.01.03 21:27buy550.011837.150.001840.00
    1102023.01.04 03:22t/p550.011840.000.001840.002.361163.55
    1112023.01.11 01:24buy560.011876.970.001878.14
    1122023.01.11 03:01t/p560.011878.140.001878.141.171164.72
    1132023.01.11 12:42buy570.011883.460.001886.42
    1142023.01.11 17:38buy580.011870.920.001878.90
    1152023.01.11 18:06close570.011868.460.001886.42-15.001149.72
    1162023.01.12 03:48t/p580.011878.900.001878.906.521156.24
    1172023.02.02 18:35buy590.011917.600.001927.38
    1182023.02.03 15:32close590.011902.570.001927.38-15.521140.72
    1192023.02.16 13:52buy600.011836.280.001839.07
    1202023.02.16 14:52t/p600.011839.070.001839.072.791143.51
    1212023.03.16 17:38buy610.011915.530.001932.18
    1222023.03.17 07:33t/p610.011932.180.001932.1816.161159.67
    1232023.04.05 20:20buy620.012019.940.002023.78
    1242023.04.06 16:44close620.012004.920.002023.78-16.481143.20
    1252023.04.26 19:17buy630.011988.980.002001.19
    1262023.04.27 08:13t/p630.012001.190.002001.1910.751153.95
    1272023.05.24 17:20buy640.011967.210.001972.30
    1282023.05.25 15:34close640.011952.210.001972.30-16.461137.49
    1292023.05.26 17:32buy650.011946.410.001951.61
    1302023.05.30 12:59t/p650.011951.610.001951.614.231141.71
    1312023.06.16 19:16buy660.011955.530.001961.50
    1322023.06.20 16:17close660.011940.530.001961.50-15.971125.74
    1332023.07.13 18:51buy670.011957.830.001961.68
    1342023.07.14 04:38t/p670.011961.680.001961.683.361129.11
    1352023.07.20 17:09buy680.011972.700.001979.97
    1362023.07.21 18:04close680.011957.700.001979.97-15.491113.62
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 1.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..c8bcbff234e00be9b68158feb4a1624e6c4527aa GIT binary patch literal 8847 zcmch5^;eY7|Mt>LqlAPaB`sajphyXd(jC%`5*DB9Q<9V0d^KSvw>Qzo<1ct9>rjnhC>~ z0M8SNT!ITfmuk(Pna@iAa%o-|PziYcgy;Vs4|xF>{;vQSs(l89=a>E?0sv;U&(deH zFu=?V0Qk=m`3%>ZRSLJjkvnF>&;IadNLcupWYz)z3<(RjAfEw1<H#gLOwTa_KX24&4dBM&*%RCKiHrDKHz_M0l-3n0saAjL6Bf5 zEF?56JR%Yv6&({B7oU)rl$?^9mY$KBm7SBDmtRm=R9sS8R$ftARsFl>PiZah~Y> zdumB09i=4T2MSttdA2ZkecTTn2i-ATKz#xgGhk3bSO-?3EpLxRDGX1kEh)l88GkDM zS6CW=1;VymQLL||D=HF|hSErN237_Z>SupLsSd&==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y Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit2.71Gross profit201.38Gross loss-198.66
    Profit factor1.01Expected payoff0.09
    Absolute drawdown73.05Maximal drawdown109.12 (10.53%)Relative drawdown10.53% (109.12)
    Total trades31Short positions (won %)31 (58.06%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)18 (58.06%)Loss trades (% of total)13 (41.94%)
    Largestprofit trade42.22loss trade-20.63
    Averageprofit trade11.19loss trade-15.28
    Maximumconsecutive wins (profit in money)4 (21.10)consecutive losses (loss in money)2 (-35.42)
    Maximalconsecutive profit (count of wins)79.26 (3)consecutive loss (count of losses)-35.42 (2)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.011793.480.001764.96
    22020.11.30 04:54t/p10.011764.960.001764.9628.741028.74
    32020.12.03 18:15sell20.011827.220.001807.22
    42020.12.03 20:09sell30.011838.700.001833.83
    52020.12.03 22:57close20.011842.220.001807.22-15.001013.74
    62020.12.04 15:39t/p30.011833.830.001833.835.091018.83
    72020.12.04 17:30sell40.011833.610.001805.03
    82020.12.07 16:49close40.011848.610.001805.03-14.781004.05
    92020.12.07 17:00sell50.011856.490.001855.05
    102020.12.08 06:09close50.011871.490.001855.05-14.78989.27
    112020.12.09 06:15sell60.011856.300.001836.32
    122020.12.09 17:04sell70.011838.100.001789.48
    132020.12.09 20:19t/p60.011836.320.001836.3219.981009.25
    142020.12.10 18:36sell80.011836.090.001811.23
    152020.12.11 22:30close70.011838.870.001789.480.111009.35
    162020.12.15 06:54close80.011836.110.001811.230.641009.99
    172020.12.16 15:30sell90.011854.090.001838.15
    182020.12.16 22:00sell100.011861.180.001860.80
    192020.12.16 22:09t/p100.011860.800.001860.800.381010.37
    202020.12.17 07:03close90.011869.090.001838.15-14.34996.03
    212020.12.21 02:45sell110.011889.000.001888.86
    222020.12.21 03:03t/p110.011888.860.001888.860.14996.17
    232020.12.21 12:15sell120.011868.580.001808.82
    242020.12.21 14:09close120.011883.580.001808.82-15.00981.17
    252020.12.22 18:00sell130.011861.400.001824.52
    262020.12.23 16:49sell140.011875.360.001874.48
    272020.12.23 16:49close130.011876.400.001824.52-14.78966.39
    282020.12.23 17:07t/p140.011874.480.001874.480.88967.27
    292020.12.30 17:01sell150.011887.550.001883.27
    302021.01.04 01:00close150.011909.280.001883.27-20.63946.63
    312021.01.05 18:03sell160.011942.890.001930.15
    322021.01.06 10:45sell170.011954.750.001949.49
    332021.01.06 11:54close160.011957.890.001930.15-14.78931.85
    342021.01.06 13:53t/p170.011949.490.001949.495.26937.11
    352021.01.06 14:00sell180.011944.910.001919.37
    362021.01.06 17:36t/p180.011919.370.001919.3725.54962.65
    372021.01.06 18:45sell190.011903.040.001847.52
    382021.01.06 21:37close190.011918.040.001847.52-15.00947.65
    392021.01.08 11:15sell200.011890.620.001854.26
    402021.01.08 16:49sell210.011868.640.001826.64
    412021.01.08 17:22t/p200.011854.260.001854.2636.36984.01
    422021.01.11 03:21t/p210.011826.640.001826.6442.221026.23
    432021.01.12 16:30sell220.011845.260.001814.58
    442021.01.12 21:30sell230.011853.270.001852.59
    452021.01.12 22:03t/p230.011852.590.001852.590.681026.91
    462021.01.13 02:09close220.011860.260.001814.58-14.781012.13
    472021.01.15 17:21sell240.011833.450.001814.53
    482021.01.18 01:52t/p240.011814.530.001814.5319.141031.27
    492021.01.20 15:15sell250.011834.880.001801.94
    502021.01.20 16:02close250.011849.880.001801.94-15.001016.27
    512021.01.20 17:00sell260.011855.310.001836.73
    522021.01.20 17:48close260.011870.310.001836.73-15.001001.27
    532021.01.25 18:15sell270.011847.450.001813.91
    542021.01.27 17:30sell280.011846.730.001846.25
    552021.01.27 17:37t/p280.011846.250.001846.250.481001.75
    562021.01.28 15:45close270.011847.460.001813.911.091002.83
    572021.01.28 16:15sell290.011859.180.001857.74
    582021.01.28 16:24t/p290.011857.740.001857.741.441004.27
    592021.01.28 19:30sell300.011840.890.001804.65
    602021.01.29 12:39close300.011855.890.001804.65-14.78989.49
    612021.01.29 17:09sell310.011861.150.001839.67
    622021.01.29 23:58close at stop310.011847.930.001839.6713.221002.71
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 10.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 10.gif new file mode 100644 index 0000000000000000000000000000000000000000..541a446701d08cfc52104a413513466e6e239eb7 GIT binary patch literal 8433 zcmch5^;Z%&#`f?>y1CMH#P zsVWmNY!-00aJX3*_%2mta>u+20l3*IFaQm>o8YPc$HN`N!2e4CdaLe0@YL-8hyZ{| z)t&TC3|wcJ{xN$(?z_oxZ9U z0Pd{A#(;W@qoZyDRvPd1r0{27vGS{{KIo-<>|-zqYK7P4lh4Exe8T4gg10s zc$Hu1PwYlwKK~AbW-BO=Qh>0^w+5gC^7S)6;FSfEF$kG{$ToWQvtR3}@l6%!4N%dTAtF*k5Fog#| zsRXpb6Y^uy1+sTRtn&#sS)W*|YC!^{3?U&wAtz!>Iy}0VSpzc-G(Ool#fXkMg@6sn zlE_AU0g8-u?r}A$lxsD9fH4Gok-~~MlSzXBugD|11zzDI1M{g7tcTr-cogv8>GBi+ z-4H(tF+-nMlwi5()fm7M=g*&%yK)LnQVeK0Dw&hRY&ZaYc@KZioR|Q?M&J~mDorrN zkv#sGnu|&nXd#FA%`BiwO~r-P1<1e-Ij9s~&zK-ccDKv`%+yH}86lKN^IX4Mo6XGm z-!ppp=Bl3x%tF0D$lO9T8ip*vVlc2MToeLAhh-LUl-54sswkBjmCb>%Y9SvO%LIE--4?OqmM00pRv$+T(Pu1Q&6&z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Qh zk9rY%UJcdIH`MJm%u$9-u_HqBTRcPjjSR6wLlLnOolv@G)<8n^pTB8tRkIh5!jjV7#(g~nDzJo z^5i9m8sN~D#exHN^=}^CkKX*t7^d}BgyTV!g2+>@0W>9{s_AxY! z+&~K7uuIjrG$y5w{TaV`H(zd9*wK|S@1Khvm5v8-<)44@X?HhG!mML+pXYE1UiN;8 zj!tN)UlZ`XR8r;m7h5%!Cg`r*_ftm0!xvYW`?3U{Bo9_dp4!b7Yf^r~+=46g2F@;Qh8XTe*8?U6(^ z+FaqdE%~&N5id6ZCJNZs3O7<8Gg|f#^!1Uw+|?UsY&ziqe%uh7%d_?yxDoewh#KqOXi4of!(P zVzuG1FfTZr9!5G<7QRt5UcOIM3#cwigOq$htOik=VrYFA#DwK1?#E7!{B ztlpv@s!{#$DEz>!nisOP;B34&&kuvuY2tW%YFhhWdyJEjU8!l-p3E2f;VBe(RA#D@ zBZ2}FnDX$e{qC`{cA8iZqp2qG^V!x30`Y8Cw6k5R(1GotS2-&}dyqea;zu8N3q$D> z#A!G=1YL}VpAx;sw3h>q!+deq05$`LZggNwiq-uepheMc|0zLEzeg)9)ofidUL8ph z1sig?~SQHZ>9C7v2V^JG7wBz@Guc!{_x#Y%U99Dy2sgH(%7cu?L;w?pM`98YKLQ4t69s!N$j4wV0zZi zY$VflZB1L}O23H0bAFoOOmvvqLKey*4|{j~>a@n_g7)x(R1aT$cUyup!0Vpr{|vO0 z96dy|Wf?Kq_y#AlQdqS(9KY7r}sR|eKLG9HDq-pdT-u` z9ElTWAlz`!f56ZD01|Ukz%vw4yN{TZ#v+a6Ak~@T+vc{UcW* zv&PftNQO;imaEjsuPY~IsqNeM4_&mbZ%-N%81PN_J^ubJ{1 + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.30 23:45 (2020.01.01 - 2021.03.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test8040Ticks modelled9476561Modelling quality24.70%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit63.78Gross profit168.72Gross loss-104.94
    Profit factor1.61Expected payoff2.77
    Absolute drawdown5.32Maximal drawdown61.21 (5.61%)Relative drawdown5.61% (61.21)
    Total trades23Short positions (won %)23 (65.22%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)15 (65.22%)Loss trades (% of total)8 (34.78%)
    Largestprofit trade23.92loss trade-15.00
    Averageprofit trade11.25loss trade-13.12
    Maximumconsecutive wins (profit in money)7 (58.67)consecutive losses (loss in money)4 (-46.03)
    Maximalconsecutive profit (count of wins)58.67 (7)consecutive loss (count of losses)-46.03 (4)
    Averageconsecutive wins3consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.011793.480.001779.22
    22020.11.27 15:52t/p10.011779.220.001779.2214.261014.26
    32020.12.09 12:30sell20.011857.620.001849.31
    42020.12.09 16:51t/p20.011849.310.001849.318.311022.57
    52020.12.09 17:00sell30.011839.670.001815.36
    62020.12.10 18:15sell40.011834.130.001818.44
    72020.12.11 22:54close30.011839.680.001815.360.871023.44
    82020.12.15 05:07close40.011834.140.001818.440.651024.08
    92020.12.22 17:45sell50.011871.710.001862.42
    102020.12.22 17:54t/p50.011862.420.001862.429.291033.37
    112021.01.06 14:00sell60.011944.910.001932.14
    122021.01.06 14:39t/p60.011932.140.001932.1412.771046.14
    132021.01.06 15:45sell70.011935.140.001922.61
    142021.01.06 17:24t/p70.011922.610.001922.6112.531058.67
    152021.01.06 18:45sell80.011903.040.001874.79
    162021.01.06 21:37close80.011918.040.001874.79-15.001043.67
    172021.01.08 11:00sell90.011888.710.001867.68
    182021.01.08 16:49sell100.011868.640.001844.72
    192021.01.08 16:49t/p90.011867.680.001867.6821.031064.70
    202021.01.08 19:24t/p100.011844.720.001844.7223.921088.62
    212021.02.04 16:45sell110.011788.260.001757.14
    222021.02.05 10:06close110.011803.260.001757.14-14.781073.84
    232021.02.11 19:30sell120.011824.700.001810.16
    242021.02.16 06:00close120.011826.610.001810.16-1.251072.59
    252021.02.16 16:15sell130.011795.370.001773.85
    262021.02.16 17:22close130.011810.370.001773.85-15.001057.59
    272021.02.19 03:15sell140.011761.430.001747.66
    282021.02.19 08:09close140.011776.430.001747.66-15.001042.59
    292021.02.24 16:15sell150.011793.620.001778.74
    302021.02.25 16:09t/p150.011778.740.001778.7415.541058.13
    312021.02.26 17:07sell160.011740.570.001714.20
    322021.03.01 08:24close160.011755.570.001714.20-14.781043.35
    332021.03.04 20:31sell170.011702.790.001687.76
    342021.03.05 03:09t/p170.011687.760.001687.7615.251058.60
    352021.03.22 08:46sell180.011732.420.001723.47
    362021.03.23 15:15sell190.011734.540.001728.17
    372021.03.23 15:54t/p190.011728.170.001728.176.371064.97
    382021.03.23 17:15sell200.011726.720.001719.77
    392021.03.24 14:24close180.011732.430.001723.470.431065.39
    402021.03.25 14:45sell210.011725.190.001717.21
    412021.03.25 15:24close210.011740.190.001717.21-15.001050.39
    422021.03.25 15:34close200.011741.720.001719.77-14.121036.27
    432021.03.25 17:39sell220.011730.910.001720.87
    442021.03.29 16:34t/p220.011720.870.001720.8710.481046.75
    452021.03.29 16:45sell230.011711.000.001694.19
    462021.03.30 13:54t/p230.011694.190.001694.1917.031063.78
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 11.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 11.gif new file mode 100644 index 0000000000000000000000000000000000000000..d4616d945e8d52046bfcb3c505ee1c21f6c4add8 GIT binary patch literal 8082 zcmch4_d8tA`}Y!Jb&*7kXo=pVt}YT?kV5nlqPOV1Tg&Q%)w@+!u&mz8s?n`3IzdEq z_Urw5{)cDIoa@YWzslVAnVBC(N#(7$gqiSz0l*djfW=|~0Ko9@Fcvukia$YGSt0L3 zNGnkM0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%3xxE%fIXzkAO{4JYsmG z%x@d>-Fz*N>m{5Cgo%m|sC&v`#KEIQH<2U5RKzQSullqO7ebVRBjDbr?R2G9K=w~W z93NlRb5Hvr-cu?OmTg$b7b$`n4D=G6E+2@`vi>d($Rup&vv3gK>wf3rz^hA-~*LtC!dK}l8gGaW^ znALC_xlD0fHF{rDT~A(oKq4M4?MouN=X&U7XqTcYIpf!Z>U3T!_SHQ!`-pyo@!8IR zBlhjFwpwI`t63E(UkU8F7wmjW8oYW(J?$Zj3OAxnfMZsk3IT(?#Sh zL|H?+^&M-nR}QpGranK`Abce?ygLDn*+G*O_a$>?S(q2=<6)vtJ1p5AB5*NYyW)_mftQMaLhi+Voobe8gq0(^&TmVZ2iKB7 zjx$6kbl;KyfOF?3T5DwUn?e;c1>+F?@saS*Iofw|gRcQK20e5u_gy-0Y-nB~J@Ojz ST|TX9Xgz`+wc+CeB>xZGqg;3Z literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 11.htm b/Docs/Reports/Tests/XTPW/Short/StrategyTester 11.htm new file mode 100644 index 0000000..d7c91d1 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 11.htm @@ -0,0 +1,91 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.30 23:45 (2020.01.01 - 2021.03.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test8040Ticks modelled9476561Modelling quality24.70%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit29.92Gross profit73.60Gross loss-43.69
    Profit factor1.68Expected payoff2.72
    Absolute drawdown6.86Maximal drawdown51.61 (4.84%)Relative drawdown4.84% (51.61)
    Total trades11Short positions (won %)11 (72.73%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)8 (72.73%)Loss trades (% of total)3 (27.27%)
    Largestprofit trade13.43loss trade-15.00
    Averageprofit trade9.20loss trade-14.56
    Maximumconsecutive wins (profit in money)5 (56.33)consecutive losses (loss in money)2 (-29.12)
    Maximalconsecutive profit (count of wins)56.33 (5)consecutive loss (count of losses)-29.12 (2)
    Averageconsecutive wins3consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.09 12:30sell10.011857.620.001849.31
    22020.12.09 16:51t/p10.011849.310.001849.318.311008.31
    32020.12.10 18:24sell20.011836.830.001823.84
    42020.12.14 12:22t/p20.011823.840.001823.8413.431021.74
    52020.12.22 17:45sell30.011871.710.001862.42
    62020.12.22 17:54t/p30.011862.420.001862.429.291031.03
    72021.01.06 14:00sell40.011944.910.001932.14
    82021.01.06 14:39t/p40.011932.140.001932.1412.771043.80
    92021.01.06 15:45sell50.011935.140.001922.61
    102021.01.06 17:24t/p50.011922.610.001922.6112.531056.33
    112021.03.04 21:09sell60.011696.260.001683.27
    122021.03.08 01:21close60.011711.260.001683.27-14.561041.77
    132021.03.22 08:46sell70.011732.420.001723.47
    142021.03.23 15:15sell80.011734.540.001728.17
    152021.03.23 15:54t/p80.011728.170.001728.176.371048.14
    162021.03.23 17:15sell90.011726.720.001719.77
    172021.03.24 14:24close70.011732.430.001723.470.431048.56
    182021.03.25 14:45sell100.011725.190.001717.21
    192021.03.25 15:24close100.011740.190.001717.21-15.001033.56
    202021.03.25 15:34close90.011741.720.001719.77-14.121019.44
    212021.03.25 17:39sell110.011730.910.001720.87
    222021.03.29 16:34t/p110.011720.870.001720.8710.481029.92
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 12.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 12.gif new file mode 100644 index 0000000000000000000000000000000000000000..7e93c6da3fa33eeeca6b7622d335c48c2322c538 GIT binary patch literal 7335 zcmcg}g;x{a`~N5zBTWz_MH)dxfzcR*go+ACBaRLcrMot|8L4ji?Qfj}_V5C#H{ z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{Xn;Cr_tRW;&N5{mmH;Gg<)i0L5A zD2IErVYA?yp)H2PMtl9)AcTGzgMhI6R1RmyygR~Mn;U!|`(*#pZsaDJmj$I|_omNO zQx?!t)QDH87!4CIcn+{P*Dwbq=*d*ULj4VR7T;(&{v>Ok$DJ~0EKwR^}Ga_Gmc`D~Nd#ozNUr-*S{0H2@?`$9grcfXRMeaixq$DzE=w_NqxUJy!=_bgFn+gd#7*lw>rG zHC@;C^-ml=HIgNSIa6L3k(md|{!=g|`jWnSGU-v z%TT#vG?fo9Y?8`^x3z_Y#`FV$6HwbJck(1E=q!noBJfiiwP}A)C(fkWMF&PvvI`Bg z$Qa~4X;b7D3DUlpO47f_cE^rX`r%?%an9?~Y4VnUjoU^84}z)RWIQoiJ`b$$dY|i& zA5GG%o5>dJUrv;dzU4{7O)m3ZS<;Ix+P&e^A~{BhTJctttJv#828XWKb_+3quR0&y zT~kr0qmAIa!_6nmudIUkE&;50D4?s``{^hrw)9mp-+Ta0f88;$VKZCAo2t(k^aI`@ ql=CDK)@LU0BdO0O=UEz6zlG|L + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.30 23:45 (2020.01.01 - 2021.03.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test8040Ticks modelled9476561Modelling quality24.70%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit35.17Gross profit50.17Gross loss-15.00
    Profit factor3.34Expected payoff5.86
    Absolute drawdown6.86Maximal drawdown23.76 (2.33%)Relative drawdown2.33% (23.76)
    Total trades6Short positions (won %)6 (83.33%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)5 (83.33%)Loss trades (% of total)1 (16.67%)
    Largestprofit trade13.43loss trade-15.00
    Averageprofit trade10.03loss trade-15.00
    Maximumconsecutive wins (profit in money)5 (50.17)consecutive losses (loss in money)1 (-15.00)
    Maximalconsecutive profit (count of wins)50.17 (5)consecutive loss (count of losses)-15.00 (1)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.09 12:30sell10.011857.620.001849.31
    22020.12.09 16:51t/p10.011849.310.001849.318.311008.31
    32020.12.10 18:24sell20.011836.830.001823.84
    42020.12.14 12:22t/p20.011823.840.001823.8413.431021.74
    52020.12.22 17:45sell30.011871.710.001862.42
    62020.12.22 17:54t/p30.011862.420.001862.429.291031.03
    72021.01.06 14:00sell40.011944.910.001932.14
    82021.01.06 14:39t/p40.011932.140.001932.1412.771043.80
    92021.03.23 15:15sell50.011734.540.001728.17
    102021.03.23 15:54t/p50.011728.170.001728.176.371050.17
    112021.03.25 14:45sell60.011725.190.001717.21
    122021.03.25 15:24close60.011740.190.001717.21-15.001035.17
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 13.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 13.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e75c527d0ac1523fb04af79e4730a0d4bf87ed4 GIT binary patch literal 7848 zcmc(BWmg+a*L9H6;93fySaB#)oZwWDLV+r7r8osji$jBl1PL14-8De);_hw%3dOCs z<>9*DAMwtbnRV7a`|Pu4=F2FnzLu0S6~*fTYybdQEEWI&3=9llQT<@VG0MUMbq}E| zz=(Ok{la4B5#W0WWpU5E4*}Tu88Dz6a6iE_|Br_~Mu7hZ0Qyn)N$|}4|A+v91?s-^ zzW5$OS(JmD5ZHAK@VzF&0%g&3FAV_ngTYPMdlXPU|34Lra)8A;_MVPty6fRp!Fn{mH0)e`3g8-xE?}PiT>An(i5B3AV{r9ZKasST|K&?v8lPGwe5F% zM`u@ePj6rUz~IpENHNa%#N^cU%Pz)U&+q2XVOfg4Eb_1qbWwj) zf;qHPW8$OM)!_W5%@cIdx!s>6vbGj_tMW8o&UJ z3V@^jfCSnH+Xnc(cu2)f@kdNg_Z2Z637C(^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xjvy)}kV^)*_q0(eBaAkoL-P6;9UNM9i(f5@Lqw%@uG^5K@`#KSzfB=n#mohT`p- zF?pYW`H;(kChSw9SS4b%`YNN%G8F7(9$$x1AT$G#ln)Arn%c60L0Z((sYlVbH;W1! zTTpK~n#71hE`P4Kq#x@>(A@TQS zrOds}b?It7m`M;`e63x9^b5a_@2jbcGwV1dF9@|AFyuK?FE`E$`zRYgr#UJqJRCD1 zqN=6XJnR~;k$fcpovTz1dGrb^1%tuA1I3Hp_7KukfttHk*TOt&Y(V4NY9qORERIdQ zGE>S^R>HWUb#&e4YjYB#L76H0wk2#TMKh7FPaG=O@g=q2%qS~-D)92&|^z+N1_@QnZNc3c9}a?!D^YDx*CqfdJ|M1L2Yt8UO$Q literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 13.htm b/Docs/Reports/Tests/XTPW/Short/StrategyTester 13.htm new file mode 100644 index 0000000..b78cc40 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 13.htm @@ -0,0 +1,139 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (59)
    Total net profit109.29Gross profit182.54Gross loss-73.25
    Profit factor2.49Expected payoff3.12
    Absolute drawdown5.99Maximal drawdown31.30 (2.90%)Relative drawdown2.90% (31.30)
    Total trades35Short positions (won %)35 (85.71%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)30 (85.71%)Loss trades (% of total)5 (14.29%)
    Largestprofit trade22.02loss trade-15.00
    Averageprofit trade6.08loss trade-14.65
    Maximumconsecutive wins (profit in money)10 (62.88)consecutive losses (loss in money)1 (-15.00)
    Maximalconsecutive profit (count of wins)62.88 (10)consecutive loss (count of losses)-15.00 (1)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 17:39sell10.011836.610.001825.20
    22020.12.07 10:37t/p10.011825.200.001825.2011.631011.63
    32021.01.29 16:54sell20.011865.800.001855.99
    42021.01.29 19:22t/p20.011855.990.001855.999.811021.44
    52021.02.09 17:45sell30.011841.990.001838.33
    62021.02.09 18:09t/p30.011838.330.001838.333.661025.10
    72021.02.10 17:00sell40.011841.300.001827.41
    82021.02.11 19:09t/p40.011827.410.001827.4114.551039.65
    92021.02.16 17:09sell50.011804.040.001801.47
    102021.02.16 18:49t/p50.011801.470.001801.472.571042.22
    112021.03.03 16:51sell60.011712.530.001708.07
    122021.03.03 17:36t/p60.011708.070.001708.074.461046.68
    132021.05.10 17:45sell70.011839.580.001833.85
    142021.05.11 03:39t/p70.011833.850.001833.855.951052.63
    152021.07.13 17:21sell80.011811.750.001808.46
    162021.07.13 20:37t/p80.011808.460.001808.463.291055.92
    172021.08.20 17:39sell90.011781.750.001777.75
    182021.08.23 03:16t/p90.011777.750.001777.754.221060.13
    192021.08.31 15:30sell100.011811.860.001809.11
    202021.08.31 16:04t/p100.011809.110.001809.112.751062.88
    212021.10.27 18:09sell110.011793.560.001789.11
    222021.10.28 16:30close110.011808.560.001789.11-14.341048.54
    232021.11.03 04:00sell120.011783.060.001779.26
    242021.11.03 08:16t/p120.011779.260.001779.263.801052.34
    252021.11.30 17:48sell130.011794.770.001781.02
    262021.11.30 18:04t/p130.011781.020.001781.0213.751066.09
    272021.12.13 16:49sell140.011785.140.001782.99
    282021.12.14 10:24t/p140.011782.990.001782.992.371068.46
    292021.12.15 16:54sell150.011769.740.001766.01
    302021.12.15 17:39t/p150.011766.010.001766.013.731072.19
    312021.12.20 17:01sell160.011793.800.001789.41
    322021.12.20 22:09t/p160.011789.410.001789.414.391076.58
    332022.01.18 18:19sell170.011813.030.001806.19
    342022.01.19 16:51close170.011828.030.001806.19-14.781061.80
    352022.02.18 17:33sell180.011895.770.001893.21
    362022.02.18 17:37t/p180.011893.210.001893.212.561064.36
    372022.03.02 18:16sell190.011921.470.001907.56
    382022.03.03 13:34close190.011936.470.001907.56-14.341050.02
    392022.04.22 19:22sell200.011936.790.001932.93
    402022.04.22 20:28t/p200.011932.930.001932.933.861053.88
    412022.04.26 16:08sell210.011905.800.001905.21
    422022.04.26 16:57t/p210.011905.210.001905.210.591054.47
    432022.06.10 16:01sell220.011839.900.001834.17
    442022.06.10 16:18t/p220.011834.170.001834.175.731060.20
    452022.07.20 16:52sell230.011708.520.001702.79
    462022.07.20 19:48t/p230.011702.790.001702.795.731065.93
    472022.08.02 18:02sell240.011776.930.001767.92
    482022.08.02 21:02t/p240.011767.920.001767.929.011074.94
    492022.11.02 21:03sell250.011647.760.001626.40
    502022.11.03 10:26t/p250.011626.400.001626.4022.021096.95
    512023.01.12 17:10sell260.011884.680.001867.96
    522023.01.12 21:03close260.011899.680.001867.96-15.001081.95
    532023.02.07 16:32sell270.011869.860.001868.93
    542023.02.07 16:45t/p270.011868.930.001868.930.931082.88
    552023.02.09 17:00sell280.011879.160.001868.22
    562023.02.09 18:03t/p280.011868.220.001868.2210.941093.82
    572023.03.02 20:35sell290.011835.870.001834.78
    582023.03.03 21:27close290.011850.870.001834.78-14.781079.04
    592023.05.15 17:34sell300.012016.660.002011.32
    602023.05.16 09:05t/p300.012011.320.002011.325.561084.60
    612023.05.26 17:09sell310.011951.200.001949.72
    622023.05.26 17:19t/p310.011949.720.001949.721.481086.08
    632023.06.07 17:32sell320.011958.950.001947.93
    642023.06.07 18:51t/p320.011947.930.001947.9311.021097.10
    652023.07.13 18:04sell330.011959.610.001957.54
    662023.07.13 18:51t/p330.011957.540.001957.542.071099.17
    672023.07.19 18:12sell340.011974.940.001970.18
    682023.07.20 17:35t/p340.011970.180.001970.185.421104.59
    692023.07.25 15:30sell350.011958.580.001953.88
    702023.07.25 17:00t/p350.011953.880.001953.884.701109.29
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 2.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..078a8d6f44497713c1877203bffc78403d0b422f GIT binary patch literal 8878 zcmch6^;Z+#|Njty0TK!*Aqc3XAfnU=k&teYkVYD$yG9SjU;}}%(K$xf=x#?!rywF7 z3IY=D!~6C9AHMh8d(J)2N8IPV_uOBeS4riqxP;{^;z7Vq0DwRs004mD;b8&}4}$;3 z+1lc6LO5Fxd=YRn2!usA=q7}-y2EyOG|AK>%A@0N_7M!VQeGtpc^d2^+Sc8-Mr>1OnZVY})_;JP6cAxB&oFi~pJ0 zRsn1`2saA&4On#p-XutXgFrXdHyQu{gu~e`-ehJA$K5Om2jLcPCOG)wjq8nb+l?59 z2Y~Q65FCC(y4m0V61pM%Z)MyKYmso1u7sImnCKsWpT|KFb7oIc=xcL5+HfC1qV zkx|hxkk~kAJS-s*jz~)WoRXS`Oh=(JGPAOCa`W;F3X6&{CD_uk@`}o;>YCcRdR#+e zQ*%peTYE=mS9ecuU;n`1&=>sh$mrO38PVj_^vvws{KDeW^2)c>weRacHhykyZSU;v z?H?Q-{rY`;^5^vIsER22*44kPYrwxRc$C&g(Ip(QO)@NkWhALFRvVDp%xoF_MSpN3XP;If69@BG@`d4+jI;u+C zPgCk%>2_w6=5R900`!Q8^D6Q{;MMW4+Z4CmVWRIRZjnZOQ3ZX7Ej3ngB@kg?Xk2Lt zDbe`9vP(=^1X%#N!?Idq6=z9_lpKWpO?PBfB*rXHo2Vv=l2O=ByTDTZ@fWy+SI*Bj zleb!|bZ9(|h@5teiX|oldQblpEF>>sL%cu-OUpq5eYU+sk(P@w(T|HwfOT^Y79{S# zwSaLiVzM0m9Cl9d^4%v1(9I~ul<)T}HE!R3GM{8j$;~b%w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-TF2H1a86{3s@V!Zv<225N2(9fQO-Gs5bW6E-3M zQ+^4nsW3lASjZ+cUFef;a@21|*s3!5G0@`xlCVCQ$eEu&*s?xEI+HlS$ztK;C2-0i mIMp_sh8%I17eS{&hhT6(Jcvawl^|G#5Ukq>mwP~f + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit-10.54Gross profit123.62Gross loss-134.15
    Profit factor0.92Expected payoff-0.35
    Absolute drawdown33.64Maximal drawdown56.13 (5.49%)Relative drawdown5.49% (56.13)
    Total trades30Short positions (won %)30 (70.00%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)21 (70.00%)Loss trades (% of total)9 (30.00%)
    Largestprofit trade20.64loss trade-15.02
    Averageprofit trade5.89loss trade-14.91
    Maximumconsecutive wins (profit in money)6 (22.03)consecutive losses (loss in money)2 (-30.01)
    Maximalconsecutive profit (count of wins)31.16 (2)consecutive loss (count of losses)-30.01 (2)
    Averageconsecutive wins3consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:49sell10.011781.870.001768.94
    22020.11.30 04:54t/p10.011768.940.001768.9413.151013.15
    32020.12.03 19:45sell20.011837.710.001837.54
    42020.12.03 19:52t/p20.011837.540.001837.540.171013.32
    52020.12.04 18:03sell30.011830.530.001822.23
    62020.12.07 16:39close30.011845.530.001822.23-14.78998.54
    72020.12.07 17:00sell40.011857.900.001857.90
    82020.12.08 16:36close40.011872.900.001857.90-14.78983.76
    92020.12.09 12:33sell50.011857.610.001853.45
    102020.12.09 13:39t/p50.011853.450.001853.454.16987.92
    112020.12.09 17:00sell60.011839.660.001827.50
    122020.12.09 20:54t/p60.011827.500.001827.5012.161000.08
    132020.12.10 18:15sell70.011834.110.001826.26
    142020.12.11 13:24t/p70.011826.260.001826.268.071008.15
    152020.12.16 15:30sell80.011852.750.001848.10
    162020.12.16 21:19t/p80.011848.100.001848.104.651012.80
    172020.12.16 22:00sell90.011861.530.001861.53
    182020.12.16 22:09t/p90.011861.530.001861.530.001012.80
    192020.12.21 03:01sell100.011888.990.001888.58
    202020.12.21 08:07close100.011904.000.001888.58-15.01997.79
    212020.12.21 12:15sell110.011868.410.001853.39
    222020.12.21 14:09close110.011883.410.001853.39-15.00982.79
    232020.12.22 17:45sell120.011871.700.001867.05
    242020.12.22 17:52t/p120.011867.050.001867.054.65987.44
    252020.12.23 16:52sell130.011877.210.001877.21
    262020.12.23 16:58t/p130.011877.210.001877.210.00987.44
    272020.12.29 18:45sell140.011882.910.001879.65
    282020.12.29 19:21t/p140.011879.650.001879.653.26990.70
    292021.01.05 18:45sell150.011948.570.001947.82
    302021.01.06 03:24t/p150.011947.820.001947.820.97991.67
    312021.01.06 14:03sell160.011943.910.001937.03
    322021.01.06 14:37t/p160.011937.030.001937.036.88998.55
    332021.01.06 15:51sell170.011935.120.001928.85
    342021.01.06 16:39t/p170.011928.850.001928.856.271004.82
    352021.01.06 18:48sell180.011902.080.001887.48
    362021.01.06 21:36close180.011917.080.001887.48-15.00989.82
    372021.01.08 11:03sell190.011888.700.001878.18
    382021.01.08 15:39t/p190.011878.180.001878.1810.521000.34
    392021.01.08 17:24sell200.011851.280.001830.64
    402021.01.08 20:24t/p200.011830.640.001830.6420.641020.98
    412021.01.12 16:15sell210.011839.410.001828.66
    422021.01.12 21:30sell220.011853.470.001853.33
    432021.01.12 21:30close210.011854.430.001828.66-15.021005.96
    442021.01.12 21:39t/p220.011853.330.001853.330.141006.10
    452021.01.15 17:04sell230.011839.110.001833.48
    462021.01.15 17:09t/p230.011833.480.001833.485.631011.73
    472021.01.19 15:15sell240.011835.380.001830.73
    482021.01.20 04:54close240.011850.380.001830.73-14.78996.94
    492021.01.20 15:48sell250.011845.500.001839.65
    502021.01.20 16:22close250.011860.500.001839.65-15.00981.94
    512021.01.25 18:04sell260.011851.850.001844.90
    522021.01.27 03:54t/p260.011844.900.001844.907.39989.33
    532021.01.27 17:15sell270.011843.380.001839.89
    542021.01.27 22:39t/p270.011839.890.001839.893.49992.82
    552021.01.28 16:00sell280.011856.950.001855.88
    562021.01.28 16:54t/p280.011855.880.001855.881.07993.89
    572021.01.28 19:19sell290.011842.140.001832.37
    582021.01.29 12:49close290.011857.140.001832.37-14.78979.11
    592021.01.29 16:45sell300.011854.900.001844.55
    602021.01.29 22:52t/p300.011844.550.001844.5510.35989.46
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 3.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..27f550b67bbd0f77a19afb31dc5d8b65e8cb8c11 GIT binary patch literal 9102 zcmch*^;ZZq=|+)m zqy_fF`}O@FzH?^InR6d8cV^E0<;p9{35%G#BkBdL0|0nD9smFg4i4h617P$q*4!L> z7s8r@(er@2g~!jM!FM67`5p6a3&79MfB_YNy9u88|9JRgH28l3zyS6R1kcR>j|c#m zWACJQVlcqm902&ACH@Y^npc3E(fBoU@SQ*U4g!PkNaoD|zyKKBjK2c_74!cyHLn1e zui@_$=sU3D4!lbcj|PM9tnV}c02qrkpTEn@9F4s@5)H=A-)*qy`8(G;=jJ;xb^rh# zz=F}}JJQ|#{x6|B(*K=|y<^Se?-Dk@!vGcLU;y~;-v9p(p1aov{NG;yNbnFqP%tzE z21kU3A;Tk3k?5%CnAo`Zgv6xel+?8JjLfX;oZP(p0!(31aY<=ec|~Pabxkd{uD$`+ z*woz8+ScCjqqD2Kr?;=J`CQNLwX9>2MrKM%`! zAIK&drbQq9M*;p^Gd(sjdQA!W%A{q2J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Ky)U#sbMXlOxy%{m{H}xKxRghm)Atv-L;a8cD31`zzQ1Y8 z>$_f~j>2txSD6p$dn753(MaDv&t5n5siTf#i+$I492)wx-zY*W2-yjo+S(Z&)ufWR zZSJu`voy4GkY7g@3PmMb8OEI4V(n<>rLd@a4XB+WDE8+W%;>E^tb(J z58^fX0Ays~U+^|p+<_vkWS`Xp7pan(Y7Z({yK-2I~uZ;AOMe^0aAJJrbCE_g%Z zt^R!}Qt|`QkcXeKsS$P0dDq!Nv!}Xg2GL+f_Zcy}-$zr)tI3hBqtHm-RY?fJMnb@K z+z4_%IDoOoLt=hI61e3-+9U5bOHF-f0qLFg8}|q}+8`r%@4pNPBn3R93sk&&%H+D7HdH~d{X{Wvj!+@2B)o1hXcN8^M5PWr&via?std%wb9j~qLP+9t5Fg@w}8Gm_Bpl~lV9U}3(H^Ai?R9itlLnv6GH^@LI zSP&7SPES|(4w~CWz-5g0Y2$NQcBHi#qllB0;I;HysfINfdsxtuw!}h-dV{Py;i8rj z0vy2{mJ$xaAqf?Mto3kCP9Iwg%v_iPBJAk835uP8#n9ii9bG~_K@d*3&jwj6kjAY5 z=G6;hk#Zq)3T!}!0;Iw`F=3N}$U;t+QUE+h7@1`mY7`aXiGlrVL$vUP=dy*)8&lsK z3pC|KaLpjYFhP|wA$AEqFa=;2FoHZbSWm}+Fe^NVKD-qeZZ!?Jqz@U%RhmMqwEm(OZU`1EkLsshHu{i3TLPD;Ygw7px zZ%Cv_(Do?h3)ck|ahc`V4C& tm~JFxfReMgl5-T3^Q@8!LX!&%lZ*S3OSh8CK`E77Db<&60|5Zh{|8aKZY=-+ literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 3.htm b/Docs/Reports/Tests/XTPW/Short/StrategyTester 3.htm new file mode 100644 index 0000000..8b56762 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 3.htm @@ -0,0 +1,141 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (59)
    Total net profit27.33Gross profit250.32Gross loss-223.00
    Profit factor1.12Expected payoff0.76
    Absolute drawdown63.41Maximal drawdown110.43 (10.55%)Relative drawdown10.55% (110.43)
    Total trades36Short positions (won %)36 (58.33%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)21 (58.33%)Loss trades (% of total)15 (41.67%)
    Largestprofit trade42.22loss trade-15.61
    Averageprofit trade11.92loss trade-14.87
    Maximumconsecutive wins (profit in money)5 (38.49)consecutive losses (loss in money)3 (-44.78)
    Maximalconsecutive profit (count of wins)84.28 (2)consecutive loss (count of losses)-44.78 (3)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.011793.480.001764.96
    22020.11.30 04:54t/p10.011764.960.001764.9628.741028.74
    32020.12.03 18:15sell20.011827.220.001807.22
    42020.12.03 20:09sell30.011838.700.001838.70
    52020.12.03 20:19t/p30.011838.700.001838.700.001028.74
    62020.12.03 22:57close20.011842.220.001807.22-15.001013.74
    72020.12.04 17:30sell40.011833.610.001805.03
    82020.12.07 16:49close40.011848.620.001805.03-14.79998.95
    92020.12.07 17:00sell50.011856.490.001855.05
    102020.12.08 06:07close50.011871.490.001855.05-14.78984.17
    112020.12.09 06:15sell60.011856.300.001836.32
    122020.12.09 12:30sell70.011857.620.001841.00
    132020.12.09 16:58t/p70.011841.000.001841.0016.621000.79
    142020.12.09 17:00sell80.011839.670.001791.05
    152020.12.09 20:19t/p60.011836.320.001836.3219.981020.77
    162020.12.10 18:15sell90.011834.130.001802.75
    172020.12.11 22:33close80.011839.680.001791.050.871021.63
    182020.12.15 05:06close90.011834.140.001802.750.651022.28
    192020.12.16 15:30sell100.011854.090.001838.15
    202020.12.16 22:00sell110.011861.180.001860.80
    212020.12.16 22:18t/p110.011860.800.001860.800.381022.66
    222020.12.17 07:03close100.011869.090.001838.15-14.341008.32
    232020.12.21 02:45sell120.011889.000.001888.86
    242020.12.21 04:30sell130.011896.270.001890.35
    252020.12.21 08:07close120.011904.000.001888.86-15.00993.32
    262020.12.21 11:49t/p130.011890.350.001890.355.92999.24
    272020.12.21 12:15sell140.011868.580.001808.82
    282020.12.21 14:09close140.011883.580.001808.82-15.00984.24
    292020.12.22 17:45sell150.011871.710.001853.13
    302020.12.23 16:49sell160.011875.360.001874.48
    312020.12.23 17:07t/p160.011874.480.001874.480.88985.12
    322020.12.28 01:00close150.011888.630.001853.13-15.61969.51
    332020.12.29 18:45sell170.011882.910.001876.39
    342020.12.30 17:01sell180.011887.550.001887.55
    352020.12.30 17:05t/p180.011887.550.001887.550.00969.51
    362020.12.31 03:06close170.011897.910.001876.39-14.12955.39
    372021.01.05 18:03sell190.011942.890.001930.15
    382021.01.06 10:45sell200.011954.750.001954.75
    392021.01.06 10:52t/p200.011954.750.001954.750.00955.39
    402021.01.06 11:54close190.011957.890.001930.15-14.78940.61
    412021.01.06 14:00sell210.011944.910.001919.37
    422021.01.06 15:45sell220.011935.140.001910.08
    432021.01.06 17:37t/p210.011919.370.001919.3725.54966.15
    442021.01.06 17:49t/p220.011910.080.001910.0825.06991.21
    452021.01.06 18:45sell230.011903.040.001847.52
    462021.01.06 21:37close230.011918.040.001847.52-15.00976.21
    472021.01.08 11:00sell240.011888.710.001846.65
    482021.01.08 16:49sell250.011868.640.001826.64
    492021.01.08 19:22t/p240.011846.650.001846.6542.061018.27
    502021.01.11 03:21t/p250.011826.640.001826.6442.221060.49
    512021.01.12 16:15sell260.011839.420.001796.42
    522021.01.12 21:30sell270.011853.270.001852.59
    532021.01.12 21:30close260.011854.430.001796.42-15.011045.48
    542021.01.13 11:09t/p270.011852.590.001852.590.901046.38
    552021.01.15 17:00sell280.011839.120.001816.62
    562021.01.18 01:51t/p280.011816.620.001816.6222.721069.10
    572021.01.19 15:15sell290.011835.390.001816.79
    582021.01.20 04:52close290.011850.390.001816.79-14.781054.31
    592021.01.20 15:15sell300.011834.880.001801.94
    602021.01.20 15:54close300.011849.880.001801.94-15.001039.31
    612021.01.20 17:00sell310.011855.310.001836.73
    622021.01.20 17:46close310.011870.310.001836.73-15.001024.31
    632021.01.25 18:00sell320.011851.860.001824.06
    642021.01.27 17:15sell330.011843.370.001836.37
    652021.01.28 03:24t/p330.011836.370.001836.377.661031.97
    662021.01.28 15:46close320.011851.870.001824.061.091033.06
    672021.01.28 16:00sell340.011856.940.001854.78
    682021.01.28 16:54t/p340.011854.780.001854.782.161035.22
    692021.01.28 19:15sell350.011842.150.001803.07
    702021.01.29 12:49close350.011857.150.001803.07-14.781020.44
    712021.01.29 16:45sell360.011854.910.001813.51
    722021.01.29 23:58close at stop360.011848.020.001813.516.891027.33
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 4.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..c32572851ef02997faa6ab71348fa9daccd23638 GIT binary patch literal 8498 zcmch+^;Zcl((fI8IwOfBmGmfM&| z1@sZDdjuZ~#6UryN9#uo003%fu|z#qW(jS1oDvFZK|Ka7P}HOAqjTq@xMd6g8fyVT zp^v1;_5EK#kEH*bx#f|C!aNpi`G^7PEI|O!VM`(Gjb=_#TEezc6pv}w9A#q3&{vVdUGzv}srnZxKHTPaO`kQD~=HF zXD-KBc6+*|V$(eR7w1LGiRcPHSI`l9#fN9WvL7qh6crZAQfdHfLfV+%Is-Snr(ALH z^0@LCnFChHUdKlL3875hd~T}xH2u-1!uFxkn@Y*Dl> zTya}AG_q0sQEnY7&B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zd-;W?ju;?LS85J?lF9$r*(BmnK0`+UZ#@^q4+?t@|X^TTK2CsfmZhd=#q zHd|$Hb + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit68.47Gross profit232.50Gross loss-164.02
    Profit factor1.42Expected payoff2.98
    Absolute drawdown26.54Maximal drawdown88.50 (8.33%)Relative drawdown8.33% (88.50)
    Total trades23Short positions (won %)23 (52.17%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)12 (52.17%)Loss trades (% of total)11 (47.83%)
    Largestprofit trade42.22loss trade-15.53
    Averageprofit trade19.37loss trade-14.91
    Maximumconsecutive wins (profit in money)4 (38.10)consecutive losses (loss in money)4 (-59.65)
    Maximalconsecutive profit (count of wins)84.28 (2)consecutive loss (count of losses)-59.65 (4)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.011793.480.001764.96
    22020.11.30 04:54t/p10.011764.960.001764.9628.741028.74
    32020.12.03 18:15sell20.011827.220.001807.22
    42020.12.03 22:57close20.011842.220.001807.22-15.001013.74
    52020.12.04 17:30sell30.011833.610.001805.03
    62020.12.07 16:49close30.011848.620.001805.03-14.79998.95
    72020.12.09 06:15sell40.011856.300.001836.32
    82020.12.09 12:30sell50.011857.620.001841.00
    92020.12.09 16:58t/p50.011841.000.001841.0016.621015.57
    102020.12.09 17:00sell60.011839.670.001791.05
    112020.12.09 20:19t/p40.011836.320.001836.3219.981035.55
    122020.12.10 18:15sell70.011834.130.001802.75
    132020.12.11 22:54close60.011839.690.001791.050.861036.40
    142020.12.15 05:06close70.011834.140.001802.750.651037.05
    152020.12.16 15:30sell80.011854.090.001838.15
    162020.12.17 07:03close80.011869.090.001838.15-14.341022.71
    172020.12.21 12:15sell90.011868.580.001808.82
    182020.12.21 14:09close90.011883.580.001808.82-15.001007.71
    192020.12.22 17:45sell100.011871.710.001853.13
    202020.12.28 01:00close100.011888.550.001853.13-15.53992.18
    212021.01.05 18:03sell110.011942.890.001930.15
    222021.01.06 11:54close110.011957.890.001930.15-14.78977.40
    232021.01.06 14:00sell120.011944.910.001919.37
    242021.01.06 15:45sell130.011935.140.001910.08
    252021.01.06 17:36t/p120.011919.370.001919.3725.541002.94
    262021.01.06 17:49t/p130.011910.080.001910.0825.061028.00
    272021.01.06 18:45sell140.011903.040.001847.52
    282021.01.06 21:37close140.011918.040.001847.52-15.001013.00
    292021.01.08 11:00sell150.011888.710.001846.65
    302021.01.08 16:49sell160.011868.640.001826.64
    312021.01.08 19:22t/p150.011846.650.001846.6542.061055.06
    322021.01.11 03:21t/p160.011826.640.001826.6442.221097.28
    332021.01.12 16:15sell170.011839.420.001796.42
    342021.01.12 21:30close170.011854.440.001796.42-15.021082.26
    352021.01.15 17:00sell180.011839.120.001816.62
    362021.01.18 01:51t/p180.011816.620.001816.6222.721104.98
    372021.01.19 15:15sell190.011835.390.001816.79
    382021.01.20 04:54close190.011850.390.001816.79-14.781090.20
    392021.01.20 15:15sell200.011834.880.001801.94
    402021.01.20 16:02close200.011849.880.001801.94-15.001075.20
    412021.01.25 18:00sell210.011851.860.001824.06
    422021.01.28 15:46close210.011851.870.001824.061.091076.29
    432021.01.28 19:15sell220.011842.150.001803.07
    442021.01.29 12:49close220.011857.150.001803.07-14.781061.50
    452021.01.29 16:45sell230.011854.910.001813.51
    462021.01.29 23:58close at stop230.011847.940.001813.516.971068.47
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 5.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 5.gif new file m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CGGw_&1vvJ>&sXvJ9!DWHAlUUke{pll_MP*)#T8&zHZD115N`JKO z6^#DkG+F+)(bGiT@iFKmo8_OrITtxA8{nEP^LkFB;}HLm8N0H{q^yVQsAGCu*#vb;1a)q>>Mv^9IEJ*Lc>RGR-9ADg6h;__&`t+}|jP`cn zPQ}>_Jx_YX=ItZA_OhAmqk1U**&_mYa#-*mgEgL?e3E~#LLSTBEm-&(ZZ`P+1)N4f zspU8{`CB%a?(x_SY*XWON+xRo7=N5!7+y|a(aMrE5M~(`^^m!+lQ~x*()T4}Ml4Oo^M_jP*P%Jk z8WorM0j-FWsf_&Cl58!Q7CxnxBlT&5JE#6vP@-@=8dIDjl>-mz!6gPs(H3#ozPFOZ_m3vM9qd6|-b!K17cF^d-2j*$ zEe6H;LZhb`(C_|Sd07Pz*!An*y2cH*aM{R3i%L4vKGa?L`(Hz0HZ|O1AEmG`#7Y8< zk9}J}yV~das6VYM>sE2H9y+v7Uv_c5dQI?IdX|G+W`Kga7~EBC)|x}u zTcC{1*IdI#XR5V3pj=SWLbOU@`iVwOg@}!b*?Z5iy6N+})mv-DxqNhT-B^uC)B;6v z(m;|~c}|y_s$GsJCCgP;0Z6x=UTV1 z93KR5gNF5~UD*Wm4;?ALFNU`{wfZX^`Amq9;mNf%iU??HbSf;)bssikbR3O3-3n5> z9d%?IOq4q + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit42.18Gross profit131.55Gross loss-89.37
    Profit factor1.47Expected payoff2.34
    Absolute drawdown13.15Maximal drawdown48.26 (4.51%)Relative drawdown4.55% (47.52)
    Total trades18Short positions (won %)18 (66.67%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)12 (66.67%)Loss trades (% of total)6 (33.33%)
    Largestprofit trade23.92loss trade-15.02
    Averageprofit trade10.96loss trade-14.90
    Maximumconsecutive wins (profit in money)4 (65.18)consecutive losses (loss in money)2 (-29.78)
    Maximalconsecutive profit (count of wins)65.18 (4)consecutive loss (count of losses)-29.78 (2)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:18sell10.011792.300.001776.86
    22020.11.27 15:54t/p10.011776.860.001776.8615.441015.44
    32020.12.04 18:15sell20.011833.750.001821.09
    42020.12.07 16:49close20.011848.760.001821.09-14.791000.65
    52020.12.09 06:30sell30.011857.560.001849.00
    62020.12.09 12:30sell40.011857.620.001849.31
    72020.12.09 16:51t/p40.011849.310.001849.318.311008.96
    82020.12.09 16:53t/p30.011849.000.001849.008.561017.52
    92020.12.09 17:00sell50.011839.670.001815.36
    102020.12.10 18:15sell60.011834.130.001818.44
    112020.12.11 22:54close50.011839.690.001815.360.861018.38
    122020.12.15 05:06close60.011834.140.001818.440.651019.02
    132020.12.21 13:00sell70.011870.400.001843.42
    142020.12.21 16:37close70.011885.400.001843.42-15.001004.02
    152020.12.22 17:45sell80.011871.710.001862.42
    162020.12.22 17:54t/p80.011862.420.001862.429.291013.31
    172021.01.06 14:30sell90.011946.740.001935.80
    182021.01.06 14:37t/p90.011935.800.001935.8010.941024.25
    192021.01.08 11:00sell100.011888.710.001867.68
    202021.01.08 16:49sell110.011868.640.001844.72
    212021.01.08 16:49t/p100.011867.680.001867.6821.031045.28
    222021.01.08 19:24t/p110.011844.720.001844.7223.921069.20
    232021.01.12 16:15sell120.011839.420.001817.92
    242021.01.12 21:30close120.011854.440.001817.92-15.021054.18
    252021.01.15 17:00sell130.011839.120.001827.87
    262021.01.15 17:54t/p130.011827.870.001827.8711.251065.43
    272021.01.19 15:15sell140.011835.390.001826.09
    282021.01.20 04:54close140.011850.390.001826.09-14.781050.65
    292021.01.20 15:18sell150.011832.930.001814.51
    302021.01.20 15:51close150.011847.930.001814.51-15.001035.65
    312021.01.25 18:00sell160.011851.860.001837.96
    322021.01.27 14:18t/p160.011837.960.001837.9614.341049.99
    332021.01.28 19:15sell170.011842.150.001822.61
    342021.01.29 12:49close170.011857.150.001822.61-14.781035.21
    352021.01.29 16:45sell180.011854.910.001834.21
    362021.01.29 23:58close at stop180.011847.940.001834.216.971042.18
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 6.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..90ff806d0a916550a1f509eedd90a81f55eaf697 GIT binary patch literal 8063 zcmch6^;Z^WU+%xaH04!!23@8QMSMc=z<6)0b;Qs;ubk#iwp2qw~1OOma_tJYY z7yy9)0RLHH@8K#)DYy}ZU4ww{{ZaQ27<^BHGy(uY zo}C|*;-ui-+$G-v?zX8>OEPNsl+1I#QOmNbq^wf?)Zr^~Dvw{@Va|gy-uSRc2W!zr ztSSV(&`kav8?mN@;5BU;r;W_+{w$KQIoDgBqyCYOAHVW-#Rp9#d5#xR6|X%$B56m76LxyXd7g1m<~!*_+(xrKfN zZiMFZ$~C2Id3h4DFqSuM{-yr8M(G+je*%bUU;WU?G=2N54<+W1y8dPixBiPJx%~l- z<(6)a*a&aO*=go%vIHYkuQ{RvR4B)<` zA|}wcWMG+@)kwe+$M^4KJ2Gv?I0q&zxRMvc?U4}N7It!JmKH+*As{UW=#%95k6g0C zyd`OZNduG|xVH&$!g+8AO&h{r!XvajV(G}V-kbU1H|7F0(?i^uY$PRADVk->JI)#! znXCTFGYgdE;>vlrLs-BP`lZ^;u|jH=#iDgRI6J;`E4r}oxvh|e1&oh@v)IW#J|{gt zxz9Xbf@B1bTrT9yEN^y_-U5+GGh*Rb_X-NCvSy1nulZ?@{^>XpoM7qfc^6!q?|rn% z;cUhvkj=W3WiD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v8FjajSjMX8M&siCLlO22sV0!>qZi4**7V3 zxmzMIYp_A>t<|n7mFhw`tH+`(`{vb)lhh}xDncT@qkj_Fq2w_0w>IN4K(`YGQtBnR zZ#+(t+`DZ2pG(Ya(9z;(#~cO~xJp=8Pjb&mktGtPD@Z?$6I+=vKL=B(22TPjPC(X0 u+bT-#v*X28l_khsD@%9G++J06GwGf!!hLR)uex>!x#v)D9pM82i2omJ&S7x? literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 6.htm b/Docs/Reports/Tests/XTPW/Short/StrategyTester 6.htm new file mode 100644 index 0000000..17a4a78 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 6.htm @@ -0,0 +1,105 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (56)
    Total net profit53.14Gross profit127.71Gross loss-74.57
    Profit factor1.71Expected payoff2.95
    Absolute drawdown6.56Maximal drawdown48.25 (4.46%)Relative drawdown4.46% (48.25)
    Total trades18Short positions (won %)18 (72.22%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)13 (72.22%)Loss trades (% of total)5 (27.78%)
    Largestprofit trade23.92loss trade-15.01
    Averageprofit trade9.82loss trade-14.91
    Maximumconsecutive wins (profit in money)6 (35.50)consecutive losses (loss in money)2 (-29.78)
    Maximalconsecutive profit (count of wins)59.71 (4)consecutive loss (count of losses)-29.78 (2)
    Averageconsecutive wins3consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:18sell10.011792.300.001784.58
    22020.11.27 15:39t/p10.011784.580.001784.587.721007.72
    32020.12.04 18:15sell20.011833.750.001827.42
    42020.12.07 10:34t/p20.011827.420.001827.426.551014.27
    52020.12.09 06:30sell30.011857.560.001853.28
    62020.12.09 12:30sell40.011857.620.001853.47
    72020.12.09 13:39t/p40.011853.470.001853.474.151018.42
    82020.12.09 13:39t/p30.011853.280.001853.284.281022.70
    92020.12.09 17:00sell50.011839.670.001827.52
    102020.12.09 20:54t/p50.011827.520.001827.5212.151034.85
    112020.12.10 18:15sell60.011834.130.001818.44
    122020.12.15 05:06close60.011834.140.001818.440.651035.50
    132020.12.21 13:00sell70.011870.400.001856.91
    142020.12.21 16:37close70.011885.400.001856.91-15.001020.50
    152020.12.22 17:45sell80.011871.710.001862.42
    162020.12.22 17:54t/p80.011862.420.001862.429.291029.79
    172021.01.06 14:30sell90.011946.740.001941.27
    182021.01.06 14:34t/p90.011941.270.001941.275.471035.26
    192021.01.08 11:00sell100.011888.710.001867.68
    202021.01.08 16:49sell110.011868.640.001844.72
    212021.01.08 16:49t/p100.011867.680.001867.6821.031056.29
    222021.01.08 19:24t/p110.011844.720.001844.7223.921080.21
    232021.01.12 16:15sell120.011839.420.001817.92
    242021.01.12 21:30close120.011854.430.001817.92-15.011065.20
    252021.01.15 17:00sell130.011839.120.001827.87
    262021.01.15 17:54t/p130.011827.870.001827.8711.251076.45
    272021.01.19 15:15sell140.011835.390.001826.09
    282021.01.20 04:54close140.011850.390.001826.09-14.781061.67
    292021.01.20 15:18sell150.011832.930.001823.72
    302021.01.20 15:51close150.011847.930.001823.72-15.001046.67
    312021.01.25 18:00sell160.011851.860.001837.96
    322021.01.27 14:18t/p160.011837.960.001837.9614.341061.00
    332021.01.28 19:15sell170.011842.150.001822.61
    342021.01.29 12:49close170.011857.150.001822.61-14.781046.22
    352021.01.29 16:45sell180.011854.910.001834.21
    362021.01.29 23:58close at stop180.011847.990.001834.216.921053.14
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 7.gif b/Doc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DD?J z!Ia*23!_(g@5+EBlJoMG@ggIkk_Ar$)c{m! zQ)EAg2kVFfO}D_-TlmlxXt+TMz(|~|G$P#D%hwg=YX|dn1V-3chkFc!Tf$tRmk|%3 z5g#w_8D55!qg?GaBTN`o?HFLX)*ys6APfjjD2ae8h3eyAO1i*IEIh;nUal2NAR2CA z1=avYn&t+YGX}CjBfC-R&AcHT@`1_L;pL2oXfNNaDnttwTEGd9w+{cUqrDX25zB`d z+(Hbecyuw6g_Q2=)M@uR0`Pkg03_Lv|fU2$C0jYA-i$F zb-w8BO}e20xiS52;Mb!;++M; z#C%w7f+G3iK_fJoaW$M!^*m zvIavq5`2I_QnISlI^DE1PXtEG>Ek3_K7SC0Io-M#I4wf991Tx3NeAYnWz0IIreCDh z>c&Y$0BS+tR(QIivUV#vLnM{1$~$9#H?0c|t4YX!>%ns*f@^3q!fgP3SLs}CnP_ar z98*@rMaFkHs1@#QlajS&<9*DZ{aZQv%qIH+o_&SR{xg_;vz?6x + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit-63.19Gross profit205.91Gross loss-269.09
    Profit factor0.77Expected payoff-1.04
    Absolute drawdown82.91Maximal drawdown126.05 (12.08%)Relative drawdown12.08% (126.05)
    Total trades61Short positions (won %)61 (70.49%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)43 (70.49%)Loss trades (% of total)18 (29.51%)
    Largestprofit trade22.19loss trade-16.92
    Averageprofit trade4.79loss trade-14.95
    Maximumconsecutive wins (profit in money)11 (39.60)consecutive losses (loss in money)2 (-31.70)
    Maximalconsecutive profit (count of wins)39.60 (11)consecutive loss (count of losses)-31.70 (2)
    Averageconsecutive wins3consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:07sell10.011798.240.001793.49
    22020.11.27 15:09t/p10.011793.490.001793.494.751004.75
    32020.12.02 15:54sell20.011813.390.001807.04
    42020.12.02 18:09close20.011828.390.001807.04-15.00989.75
    52020.12.03 18:00sell30.011830.890.001825.88
    62020.12.03 18:09t/p30.011825.880.001825.885.01994.76
    72020.12.03 19:45sell40.011837.700.001836.69
    82020.12.03 20:39t/p40.011836.690.001836.691.01995.77
    92020.12.04 17:22sell50.011835.380.001829.06
    102020.12.07 10:31sell60.011829.930.001824.08
    112020.12.07 10:34t/p50.011829.060.001829.066.541002.31
    122020.12.07 10:37t/p60.011824.080.001824.085.851008.16
    132020.12.07 16:47sell70.011847.400.001846.39
    142020.12.07 16:48t/p70.011846.390.001846.391.011009.17
    152020.12.09 06:00sell80.011859.770.001856.01
    162020.12.09 06:08t/p80.011856.010.001856.013.761012.93
    172020.12.09 12:22sell90.011857.780.001853.71
    182020.12.09 13:39t/p90.011853.710.001853.714.071017.00
    192020.12.09 16:57sell100.011844.600.001834.91
    202020.12.09 20:22t/p100.011834.910.001834.919.691026.69
    212020.12.10 17:54sell110.011834.420.001819.02
    222020.12.11 17:24sell120.011847.280.001846.27
    232020.12.11 17:36t/p120.011846.270.001846.271.011027.70
    242020.12.14 16:39sell130.011837.050.001836.04
    252020.12.14 16:51t/p130.011836.040.001836.041.011028.71
    262020.12.14 18:24sell140.011824.420.001810.92
    272020.12.15 05:07close110.011834.440.001819.020.641029.35
    282020.12.15 07:39close140.011839.420.001810.92-14.781014.57
    292020.12.16 15:18sell150.011855.030.001850.84
    302020.12.16 15:22t/p150.011850.840.001850.844.191018.76
    312020.12.16 21:19sell160.011847.450.001842.45
    322020.12.16 22:00close160.011862.460.001842.45-15.011003.75
    332020.12.16 23:00sell170.011864.080.001862.76
    342020.12.16 23:09t/p170.011862.760.001862.761.321005.07
    352020.12.18 15:09sell180.011887.500.001886.55
    362020.12.18 15:13t/p180.011886.550.001886.550.951006.02
    372020.12.18 16:54sell190.011880.190.001875.59
    382020.12.21 02:37sell200.011887.620.001886.61
    392020.12.21 03:17close190.011895.190.001875.59-14.78991.23
    402020.12.21 04:15sell210.011897.420.001895.61
    412020.12.21 04:39t/p210.011895.610.001895.611.81993.04
    422020.12.21 07:09close200.011902.620.001886.61-15.00978.04
    432020.12.21 09:54sell220.011893.310.001886.69
    442020.12.21 11:52t/p220.011886.690.001886.696.62984.66
    452020.12.21 11:54sell230.011883.880.001876.38
    462020.12.21 12:04t/p230.011876.380.001876.387.50992.16
    472020.12.22 17:10sell240.011870.060.001858.82
    482020.12.22 19:00sell250.011864.350.001855.66
    492020.12.23 14:07t/p240.011858.820.001858.8211.461003.62
    502020.12.23 16:37sell260.011872.700.001871.69
    512020.12.23 17:15t/p260.011871.690.001871.691.011004.63
    522020.12.24 04:34close250.011879.350.001855.66-14.12990.51
    532020.12.24 17:09sell270.011878.820.001877.81
    542020.12.24 17:13t/p270.011877.810.001877.811.01991.52
    552020.12.28 08:30sell280.011879.920.001872.11
    562020.12.28 13:52t/p280.011872.110.001872.117.81999.33
    572020.12.28 16:37sell290.011893.330.001892.32
    582020.12.28 16:45t/p290.011892.320.001892.321.011000.34
    592020.12.29 18:31sell300.011882.760.001881.75
    602020.12.29 18:54t/p300.011881.750.001881.751.011001.35
    612020.12.30 16:39sell310.011883.520.001881.96
    622020.12.30 16:46t/p310.011881.960.001881.961.561002.91
    632020.12.31 20:09sell320.011891.930.001888.50
    642021.01.04 01:00close320.011909.290.001888.50-16.92985.99
    652021.01.05 17:08sell330.011939.390.001932.88
    662021.01.05 18:45sell340.011948.560.001947.80
    672021.01.06 03:07close330.011954.390.001932.88-14.78971.21
    682021.01.06 03:24t/p340.011947.800.001947.800.98972.19
    692021.01.06 04:54sell350.011943.510.001938.80
    702021.01.06 10:34sell360.011951.660.001950.65
    712021.01.06 12:00close350.011958.510.001938.80-15.00957.19
    722021.01.06 13:24t/p360.011950.650.001950.651.01958.20
    732021.01.06 13:57sell370.011947.410.001941.85
    742021.01.06 14:34t/p370.011941.850.001941.855.56963.76
    752021.01.06 15:30sell380.011938.070.001932.94
    762021.01.06 15:54t/p380.011932.940.001932.945.13968.89
    772021.01.06 17:49sell390.011908.520.001893.81
    782021.01.06 22:09close390.011923.520.001893.81-15.00953.89
    792021.01.08 10:04sell400.011889.270.001867.08
    802021.01.08 16:37sell410.011878.540.001864.52
    812021.01.08 16:51t/p400.011867.080.001867.0822.19976.08
    822021.01.08 16:52t/p410.011864.520.001864.5214.02990.10
    832021.01.12 15:39sell420.011843.510.001825.66
    842021.01.12 21:24sell430.011852.850.001851.84
    852021.01.13 01:57close420.011858.510.001825.66-14.78975.32
    862021.01.13 11:09t/p430.011851.840.001851.841.23976.54
    872021.01.13 16:52sell440.011857.800.001854.60
    882021.01.13 19:37t/p440.011854.600.001854.603.20979.74
    892021.01.13 22:54sell450.011847.410.001843.32
    902021.01.14 04:22t/p450.011843.320.001843.324.75984.49
    912021.01.14 04:34sell460.011835.720.001827.58
    922021.01.14 16:24close460.011850.730.001827.58-15.01969.48
    932021.01.15 15:54sell470.011838.630.001826.89
    942021.01.15 17:54sell480.011827.340.001809.39
    952021.01.15 17:54t/p470.011826.890.001826.8911.74981.22
    962021.01.19 03:19close480.011842.340.001809.39-14.56966.66
    972021.01.19 10:23sell490.011844.640.001843.63
    982021.01.19 10:30t/p490.011843.630.001843.631.01967.67
    992021.01.19 14:54sell500.011835.720.001826.35
    1002021.01.19 16:38sell510.011835.920.001828.68
    1012021.01.20 04:54close500.011850.720.001826.35-14.78952.89
    1022021.01.20 06:39close510.011850.920.001828.68-14.78938.11
    1032021.01.20 14:54sell520.011842.110.001836.51
    1042021.01.20 15:09t/p520.011836.510.001836.515.60943.71
    1052021.01.20 16:30sell530.011859.780.001858.64
    1062021.01.20 16:52t/p530.011858.640.001858.641.14944.85
    1072021.01.21 17:00sell540.011863.620.001860.50
    1082021.01.22 05:03t/p540.011860.500.001860.503.34948.19
    1092021.01.22 12:39sell550.011850.140.001843.33
    1102021.01.22 14:39t/p550.011843.330.001843.336.81955.00
    1112021.01.25 17:09sell560.011851.460.001835.42
    1122021.01.27 16:39t/p560.011835.420.001835.4216.48971.48
    1132021.01.27 16:45sell570.011832.260.001819.77
    1142021.01.27 17:09close570.011847.260.001819.77-15.00956.48
    1152021.01.27 18:30sell580.011847.820.001845.17
    1162021.01.27 19:00t/p580.011845.170.001845.172.65959.13
    1172021.01.28 15:45sell590.011848.570.001847.56
    1182021.01.28 16:39close590.011863.570.001847.56-15.00944.13
    1192021.01.28 19:06sell600.011845.110.001826.67
    1202021.01.29 12:54close600.011860.110.001826.67-14.78929.34
    1212021.01.29 16:39sell610.011855.410.001835.21
    1222021.01.29 23:58close at stop610.011847.940.001835.217.47936.81
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 8.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 8.gif new file mode 100644 index 0000000000000000000000000000000000000000..223d1b50b0259c205444cc8c608064cebf335a3f GIT binary patch literal 8486 zcmch61yh?%+jg*$AcYp!0u>ypNPt42#VJz3trV9c#T^1fAOwft9-z1d5AIgnp)Kx| z;*gi;{{F+avpchM9sVlcqM0s#2W5`PQVSd@XAQ212~@U1`U76OBBNfu22KtCAVguevXvjnzyBq4OZwl)HMgue{B6P(w-}(z0t^7(&ins=5x8A_!2iAlfD|792nvRT zgoZ(3a71_nG7=RP9TOWDpOBb@PEJWpOV7y6%FfBn%f}QH7X2tLDJ?6nsI024sm0dS zH#9aix8Pda+B-VCx_f&2`UeJwhDUx7jEzr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dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 8.htm @@ -0,0 +1,101 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit13.00Gross profit116.69Gross loss-103.69
    Profit factor1.13Expected payoff0.81
    Absolute drawdown38.21Maximal drawdown52.31 (5.16%)Relative drawdown5.16% (52.31)
    Total trades16Short positions (won %)16 (56.25%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)9 (56.25%)Loss trades (% of total)7 (43.75%)
    Largestprofit trade22.76loss trade-15.00
    Averageprofit trade12.97loss trade-14.81
    Maximumconsecutive wins (profit in money)3 (44.73)consecutive losses (loss in money)2 (-29.78)
    Maximalconsecutive profit (count of wins)44.73 (3)consecutive loss (count of losses)-29.78 (2)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 16:00sell10.011778.500.001749.26
    22020.12.01 10:07close10.011793.500.001749.26-14.56985.44
    32020.12.04 18:15sell20.011833.750.001821.09
    42020.12.07 16:49close20.011848.750.001821.09-14.78970.66
    52020.12.09 06:30sell30.011857.560.001849.00
    62020.12.09 16:53t/p30.011849.000.001849.008.56979.22
    72020.12.09 17:15sell40.011842.320.001820.66
    82020.12.10 18:36sell50.011836.090.001823.11
    92020.12.14 12:22t/p50.011823.110.001823.1113.42992.64
    102020.12.14 12:24t/p40.011820.660.001820.6622.761015.39
    112020.12.21 12:30sell60.011869.360.001840.26
    122020.12.21 14:09close60.011884.360.001840.26-15.001000.39
    132020.12.22 18:00sell70.011861.400.001842.96
    142020.12.23 16:49close70.011876.400.001842.96-14.78985.61
    152021.01.06 14:15sell80.011946.240.001934.80
    162021.01.06 14:37t/p80.011934.800.001934.8011.44997.05
    172021.01.06 16:00sell90.011932.780.001918.05
    182021.01.06 17:37t/p90.011918.050.001918.0514.731011.78
    192021.01.08 11:15sell100.011890.620.001872.44
    202021.01.08 16:39t/p100.011872.440.001872.4418.181029.96
    212021.01.12 16:30sell110.011845.260.001829.92
    222021.01.13 02:09close110.011860.260.001829.92-14.781015.18
    232021.01.15 17:21sell120.011833.450.001821.61
    242021.01.18 01:34t/p120.011821.610.001821.6112.061027.24
    252021.01.20 15:30sell130.011840.960.001830.57
    262021.01.20 16:15close130.011855.960.001830.57-15.001012.24
    272021.01.25 18:15sell140.011847.450.001830.68
    282021.01.28 15:45close140.011847.460.001830.681.091013.32
    292021.01.28 19:30sell150.011840.890.001822.15
    302021.01.29 12:39close150.011855.890.001822.15-14.78998.54
    312021.01.29 17:09sell160.011861.150.001846.69
    322021.01.29 22:46t/p160.011846.690.001846.6914.461013.00
    +
    diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 9.gif b/Docs/Reports/Tests/XTPW/Short/StrategyTester 9.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ae2014f73b2487620eb83b2922b577d041b04d5 GIT binary patch literal 7496 zcmch6^;Z8OM`@jAYhORiqw(j<@0|2hiA^rIdkqS?wy%4Kg=0r)i)B7rZ0&*0m}dYfj|HN0KL7vgvuUJg!_Ly!hR&^zW|`8@&*Lq@c$73 z0Q1Tl>5Ui!FgFJP{<9?9z?J4`P<BpKk^0wfo@3V^#DK*2vkqF0RU+Hf2QVW zfcZbdjUw^}MBjin1rj1bpd0HO4FCYDtTe~pRAwGod6O~{REfWtR7T=&TyLD~Z^V^7 z08mdQC^GVfbhEzy6?8-TU*^gi7M^fZu=x!JK%0XApqq97|8IgfyASx^Spe=3`~U%g zLBZhPA)yc`EG#@CGAcSIHZDE^o|u%3NJ&jg&&bTm&dJToFF+O+6_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vAH70d4wIE z;OpBIbge^Y&qAZqjbEsR)VX0PS#=NbTd8yvr0+@@42xR#i!iS!hu--h1qC7FF#%bWUMz29F|}CE8V#93xQ!^qgJH zxvC|BKaOJFB&KGxSb9gBBzpy~r0zYHZl`s|s(<65c&p9ae<}-WEipTk|(`Y@Ya`nB%RzfU+F1QI|4G2&F@;EVTb&X#yTPo07(5G DiCAYZ literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Short/StrategyTester 9.htm b/Docs/Reports/Tests/XTPW/Short/StrategyTester 9.htm new file mode 100644 index 0000000..e9e19dd --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Short/StrategyTester 9.htm @@ -0,0 +1,89 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit88.62Gross profit103.62Gross loss-15.00
    Profit factor6.91Expected payoff8.86
    Absolute drawdown5.32Maximal drawdown47.52 (4.53%)Relative drawdown4.53% (47.52)
    Total trades10Short positions (won %)10 (90.00%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)9 (90.00%)Loss trades (% of total)1 (10.00%)
    Largestprofit trade23.92loss trade-15.00
    Averageprofit trade11.51loss trade-15.00
    Maximumconsecutive wins (profit in money)7 (58.67)consecutive losses (loss in money)1 (-15.00)
    Maximalconsecutive profit (count of wins)58.67 (7)consecutive loss (count of losses)-15.00 (1)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 15:15sell10.011793.480.001779.22
    22020.11.27 15:52t/p10.011779.220.001779.2214.261014.26
    32020.12.09 12:30sell20.011857.620.001849.31
    42020.12.09 16:51t/p20.011849.310.001849.318.311022.57
    52020.12.09 17:00sell30.011839.670.001815.36
    62020.12.10 18:15sell40.011834.130.001818.44
    72020.12.11 22:54close30.011839.680.001815.360.871023.44
    82020.12.15 05:07close40.011834.140.001818.440.651024.08
    92020.12.22 17:45sell50.011871.710.001862.42
    102020.12.22 17:54t/p50.011862.420.001862.429.291033.37
    112021.01.06 14:00sell60.011944.910.001932.14
    122021.01.06 14:39t/p60.011932.140.001932.1412.771046.14
    132021.01.06 15:45sell70.011935.140.001922.61
    142021.01.06 17:24t/p70.011922.610.001922.6112.531058.67
    152021.01.06 18:45sell80.011903.040.001874.79
    162021.01.06 21:37close80.011918.040.001874.79-15.001043.67
    172021.01.08 11:00sell90.011888.710.001867.68
    182021.01.08 16:49sell100.011868.640.001844.72
    192021.01.08 16:49t/p90.011867.680.001867.6821.031064.70
    202021.01.08 19:24t/p100.011844.720.001844.7223.921088.62
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester 1.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..4f2b76c6511f7f85f30e7e7364b1e269005f95f6 GIT binary patch literal 7394 zcmcg}g;x{a`~N^m@V zh6mgn0s#*L-#|5{H_Dq5K)_Fd0cC)j4W9acI>G@A{67GIt+^q=Q~3W00RYpQ8|#f3 z3@|kX0R9(AxS?xI%fL-A!ip*QCLeY~fx$N-(mxG5L_zM1>~{}Q};eZYTz0U#&%0Q~#|0)v7fA)#U6 z(1=J_RCG*iTzo=eQgTWv9Fdluk(rg9lbe@cP>3ulE-5W5uc)l5uBk=U)i*RYHMg|3 zwRd!Ob@!lqG1$KTfx)37qS3MOiOH#H9DZhYZhm2L>Cf`Y>e~9o=GOMk?%w|2gTteL z$0z$`L}|pA*N7{?_10b3f~-2}ZMK4Ed5!lGsCEejO$z^T()wbwiLk%C-ced}vAyvVe?e=(^}4zsR55 zjlz8P9jc78pg>9rn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m b/Docs/Reports/Tests/XTPW/Test/StrategyTester 1.htm new file mode 100644 index 0000000..c82edeb --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Test/StrategyTester 1.htm @@ -0,0 +1,79 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.30 23:45 (2020.01.01 - 2021.03.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.01; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.01; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test8040Ticks modelled9476561Modelling quality24.70%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit31.63Gross profit41.63Gross loss-10.00
    Profit factor4.16Expected payoff6.33
    Absolute drawdown4.91Maximal drawdown23.30 (2.25%)Relative drawdown2.25% (23.30)
    Total trades5Short positions (won %)0 (0.00%)Long positions (won %)5 (80.00%)
    Profit trades (% of total)4 (80.00%)Loss trades (% of total)1 (20.00%)
    Largestprofit trade14.45loss trade-10.00
    Averageprofit trade10.41loss trade-10.00
    Maximumconsecutive wins (profit in money)3 (27.18)consecutive losses (loss in money)1 (-10.00)
    Maximalconsecutive profit (count of wins)27.18 (3)consecutive loss (count of losses)-10.00 (1)
    Averageconsecutive wins2consecutive losses1
    +Graph
    + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.30 17:15buy10.011775.150.001787.08
    22020.12.01 07:52t/p10.011787.080.001787.0811.501011.50
    32021.01.28 11:30buy20.011840.810.001849.71
    42021.01.28 15:45t/p20.011849.710.001849.718.901020.40
    52021.02.19 08:45buy30.011773.050.001779.83
    62021.02.19 15:52t/p30.011779.830.001779.836.781027.18
    72021.03.04 13:39buy40.011715.670.001723.65
    82021.03.04 19:24close40.011705.670.001723.65-10.001017.18
    92021.03.05 16:45buy50.011697.630.001712.51
    102021.03.08 01:24t/p50.011712.510.001712.5114.451031.63
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester 2.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..944dde4a6d33105d76f49ab57f138594dcf753cc GIT binary patch literal 8687 zcmch5hd*22|9`AXY^60yORHA3)uBkOs-jlWWp8S4wF!bm>^)->J643)wYSJ z%h%`q`yYPip8L4x@p_K)dY${Yk8>VZ?xU=TsNrjpF2E`PKp+qR06G~nhY5T+x+HzADK4fAFQAWTn!0cgNY2T%S#9^o(&{9gdji@5>8lhgkZ z0RS`1jr2wg2AG)v0RLGMZeWZV8r%>`STO_N_($GAU@-Uw2V=|{0DxXFxPfqk0npR` z`I?~tW-EjnQREGXz5#D?Bt(M2H|{qw490BwCNr~0%*~XMV9fN*024WV<9g%VaHGWZ z0>Hf(aAf2S>88H_C3Hjj-^`dB)->TJVY3?yfHngIZZ5N%$4&MBKbyeK>I44wE&${N z2*5u88WWn{UI!w*q<;z}oO4t&esDB2-uk zrl{Z+(a?4A1*$lJ+yi7WtB6HEEGQ6@hH<=Wg`%M-y)0Ftia<){mp@c<4BtQMi4=9t zSbaA_j5AWBb=)Vi+SJS!9e&#O?{5x1W~R``8N53)>-DtVtc?h2I2|1HC|?IyHECf$ z<^Wt^1(4AbWsxwyYX$$r%|sy90-56$ZyPF;-sPH#)}rL$5SCuhjMAdvTh>ojK9Sle zudF6ZIoOa3@u)rt-7(57mEIhBxuY;Y|H&;UwQ;rD@ zjaf`o56xN>votTby)IOr<68?{AqF8n?)wvc`Fpwq5Ii-PqIxOvhJ-*ZaW_la)xVkN z0hy2q#_!e}0OT=+@I2%l4S1U_H%65h@+USp6AISa)X#_A+8O0 zk;!!*&9f&RLUi>kl$Wy1gZ%k7^KR{fia5f1u;wmR5_k^Fmeu6dH_G2< z?vP87nBQSa8Tmy1jbqg4#juRavouvp$$MFfBv9#n>(^u%9 zfquenu50dPDEvxxI@t-{>u-bLqWQf>kv~DNeB8gMI+fPxRUXBO?rGsVT88hWgIq!b zhFCY#tUQ>c0?a=bIw-S!-Yfqr>pi2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ZKG1{L2+;)#TZcse;ZeNs7{y5MQ+@N_rBo4?9${|_X~ Bvn&7r literal 0 HcmV?d00001 diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester 2.htm b/Docs/Reports/Tests/XTPW/Test/StrategyTester 2.htm new file mode 100644 index 0000000..224a643 --- /dev/null +++ b/Docs/Reports/Tests/XTPW/Test/StrategyTester 2.htm @@ -0,0 +1,171 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.12.30 23:45 (2020.01.01 - 2021.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test25902Ticks modelled27850269Modelling quality24.91%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit38.61Gross profit135.52Gross loss-96.91
    Profit factor1.40Expected payoff0.77
    Absolute drawdown2.76Maximal drawdown50.54 (4.72%)Relative drawdown4.72% (50.54)
    Total trades50Short positions (won %)0 (0.00%)Long positions (won %)50 (84.00%)
    Profit trades (% of total)42 (84.00%)Loss trades (% of total)8 (16.00%)
    Largestprofit trade11.16loss trade-15.86
    Averageprofit trade3.23loss trade-12.11
    Maximumconsecutive wins (profit in money)12 (31.55)consecutive losses (loss in money)2 (-30.43)
    Maximalconsecutive profit (count of wins)40.62 (10)consecutive loss (count of losses)-30.43 (2)
    Averageconsecutive wins8consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 18:15buy10.011827.820.001837.00
    22020.12.03 19:34t/p10.011837.000.001837.009.181009.18
    32020.12.04 17:30buy20.011834.330.001835.11
    42020.12.04 17:37t/p20.011835.110.001835.110.781009.96
    52020.12.09 06:15buy30.011856.900.001859.10
    62020.12.09 06:34t/p30.011859.100.001859.102.201012.16
    72020.12.16 15:30buy40.011854.690.001867.14
    82020.12.17 03:33t/p40.011867.140.001867.1411.161023.32
    92020.12.21 12:15buy50.011869.180.001903.76
    102020.12.28 13:54close50.011869.160.001903.76-3.031020.29
    112021.01.05 18:00buy60.011943.950.001955.28
    122021.01.06 10:45t/p60.011955.280.001955.2810.901031.19
    132021.01.06 14:00buy70.011945.510.001945.51
    142021.01.06 14:04t/p70.011945.510.001945.510.001031.19
    152021.01.12 16:15buy80.011840.020.001846.92
    162021.01.12 16:30t/p80.011846.920.001846.926.901038.09
    172021.01.19 15:15buy90.011835.990.001842.12
    182021.01.19 16:22t/p90.011842.120.001842.126.131044.22
    192021.01.20 15:15buy100.011835.480.001837.23
    202021.01.20 15:21t/p100.011837.230.001837.231.751045.97
    212021.01.25 18:00buy110.011852.460.001857.99
    222021.01.25 19:24t/p110.011857.990.001857.995.531051.50
    232021.01.28 19:15buy120.011842.750.001846.40
    242021.01.29 08:47t/p120.011846.400.001846.403.221054.72
    252021.01.29 16:45buy130.011855.510.001859.31
    262021.01.29 16:51t/p130.011859.310.001859.313.801058.52
    272021.02.09 17:49buy140.011842.440.001867.07
    282021.02.10 17:00buy150.011841.900.001843.58
    292021.02.10 17:00modify140.011842.440.001843.58
    302021.02.10 17:07t/p140.011843.580.001843.580.711059.23
    312021.02.10 17:07t/p150.011843.580.001843.581.681060.91
    322021.02.11 18:15buy160.011837.220.001838.17
    332021.02.11 21:30close160.011822.220.001838.17-15.001045.91
    342021.02.16 14:00buy170.011816.630.001819.03
    352021.02.16 15:34close170.011801.630.001819.03-15.001030.91
    362021.03.11 16:45buy180.011720.540.001722.07
    372021.03.11 16:51t/p180.011722.070.001722.071.531032.44
    382021.03.16 09:30buy190.011728.010.001731.34
    392021.03.16 10:21t/p190.011731.340.001731.343.331035.77
    402021.03.16 17:45buy200.011729.860.001734.16
    412021.03.17 03:52t/p200.011734.160.001734.163.871039.64
    422021.03.17 13:30buy210.011728.460.001728.61
    432021.03.17 13:36t/p210.011728.610.001728.610.151039.79
    442021.03.18 10:45buy220.011736.310.001737.31
    452021.03.18 11:03t/p220.011737.310.001737.311.001040.79
    462021.03.22 08:15buy230.011733.250.001736.73
    472021.03.22 13:09t/p230.011736.730.001736.733.481044.27
    482021.03.23 15:15buy240.011735.140.001735.59
    492021.03.24 12:04t/p240.011735.590.001735.590.021044.29
    502021.03.25 09:15buy250.011731.860.001733.64
    512021.03.25 09:39t/p250.011733.640.001733.641.781046.07
    522021.03.25 17:30buy260.011735.590.001740.57
    532021.03.29 16:34close260.011720.590.001740.57-15.861030.21
    542021.04.07 15:00buy270.011735.100.001737.30
    552021.04.07 15:52t/p270.011737.300.001737.302.201032.41
    562021.04.14 16:45buy280.011739.080.001750.71
    572021.04.15 15:15t/p280.011750.710.001750.7110.341042.75
    582021.04.19 15:15buy290.011776.640.001778.42
    592021.04.19 15:24t/p290.011778.420.001778.421.781044.53
    602021.04.23 17:00buy300.011782.070.001783.50
    612021.04.27 04:03t/p300.011783.500.001783.500.571045.10
    622021.04.27 16:45buy310.011779.880.001783.78
    632021.04.27 16:54t/p310.011783.780.001783.783.901049.00
    642021.04.27 19:00buy320.011778.510.001779.64
    652021.04.27 20:09t/p320.011779.640.001779.641.131050.13
    662021.05.04 18:15buy330.011778.060.001781.11
    672021.05.04 18:22t/p330.011781.110.001781.113.051053.18
    682021.05.10 17:45buy340.011840.180.001847.26
    692021.05.11 16:00buy350.011827.100.001829.00
    702021.05.11 16:01t/p350.011829.000.001829.001.901055.08
    712021.05.11 16:09close340.011825.180.001847.26-15.431039.65
    722021.05.19 11:00buy360.011868.350.001873.35
    732021.05.19 14:24close360.011853.350.001873.35-15.001024.65
    742021.05.19 22:00buy370.011863.650.001863.98
    752021.05.19 22:04t/p370.011863.980.001863.980.331024.98
    762021.05.21 17:15buy380.011875.850.001876.93
    772021.05.21 17:24t/p380.011876.930.001876.931.081026.06
    782021.06.01 11:30buy390.011908.720.001910.47
    792021.06.01 11:52t/p390.011910.470.001910.471.751027.81
    802021.06.01 13:45buy400.011905.320.001906.00
    812021.06.01 13:52t/p400.011906.000.001906.000.681028.49
    822021.06.01 17:15buy410.011900.360.001907.09
    832021.06.02 16:37t/p410.011907.090.001907.096.301034.79
    842021.06.08 17:00buy420.011888.330.001898.56
    852021.06.09 16:39t/p420.011898.560.001898.569.801044.59
    862021.06.22 15:30buy430.011777.260.001778.06
    872021.06.22 16:07t/p430.011778.060.001778.060.801045.39
    882021.06.24 19:15buy440.011777.940.001781.97
    892021.06.25 10:24t/p440.011781.970.001781.973.601048.99
    902021.06.25 18:15buy450.011781.340.001785.09
    912021.06.28 08:54t/p450.011785.090.001785.093.321052.31
    922021.07.01 18:15buy460.011770.830.001770.98
    932021.07.01 18:15t/p460.011770.980.001770.980.151052.46
    942021.07.06 19:00buy470.011796.960.001799.01
    952021.07.07 04:19t/p470.011799.010.001799.011.621054.08
    962021.07.08 17:15buy480.011807.030.001809.58
    972021.07.09 18:18t/p480.011809.580.001809.582.121056.20
    982021.07.13 17:15buy490.011809.560.001835.86
    992021.07.15 14:30buy500.011826.370.001834.87
    1002021.07.15 14:30modify490.011809.560.001834.87
    1012021.07.16 18:09close500.011811.370.001834.87-15.431040.77
    1022021.07.16 18:33close490.011809.550.001834.87-2.161038.61
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester 3.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..fd7fa1047826687ca6f86133088658ed4014d995 GIT binary patch literal 8303 zcmch5hc{f$`~MD2y<2_tva7e%qOa8j(aREj_2@l% z->=X6_dopR&YYR^yvjUtpL5T-XB3p)iAxxZ;PnF50RSu(3jhEH2M4jp0WkCkX=aAJ z4OHV6hk|_&$U*yJy}n0a(m57*Gkg@8IeG$HN{$!T$vS1IT+2JdOE}2mqKN z@1^%*Fu=?V0Qk=mdk-VcD#0yK?3x+)-XD4ofx+N=9E>z;0RRTT;1=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+ + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.12.30 23:45 (2020.01.01 - 2021.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test25902Ticks modelled27850269Modelling quality24.91%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit-34.86Gross profit155.05Gross loss-189.91
    Profit factor0.82Expected payoff-0.59
    Absolute drawdown49.36Maximal drawdown143.17 (13.09%)Relative drawdown13.09% (143.17)
    Total trades59Short positions (won %)0 (0.00%)Long positions (won %)59 (76.27%)
    Profit trades (% of total)45 (76.27%)Loss trades (% of total)14 (23.73%)
    Largestprofit trade11.97loss trade-16.29
    Averageprofit trade3.45loss trade-13.56
    Maximumconsecutive wins (profit in money)13 (33.75)consecutive losses (loss in money)6 (-79.74)
    Maximalconsecutive profit (count of wins)33.75 (13)consecutive loss (count of losses)-79.74 (6)
    Averageconsecutive wins5consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 18:03buy10.011831.130.001835.18
    22020.12.04 19:30t/p10.011835.180.001835.184.051004.05
    32020.12.16 15:30buy20.011853.350.001862.45
    42020.12.16 22:00t/p20.011862.450.001862.459.101013.15
    52020.12.21 12:15buy30.011869.010.001903.16
    62020.12.28 13:55close30.011869.000.001903.16-3.021010.13
    72021.01.06 14:03buy40.011944.510.001947.51
    82021.01.06 14:09t/p40.011947.510.001947.513.001013.13
    92021.01.12 16:15buy50.011840.010.001846.89
    102021.01.12 16:30t/p50.011846.890.001846.896.881020.01
    112021.01.19 15:15buy60.011835.980.001842.08
    122021.01.19 16:22t/p60.011842.080.001842.086.101026.11
    132021.01.25 18:04buy70.011852.450.001857.95
    142021.01.25 19:24t/p70.011857.950.001857.955.501031.61
    152021.01.28 19:19buy80.011842.740.001846.37
    162021.01.29 08:47t/p80.011846.370.001846.373.201034.81
    172021.01.29 16:45buy90.011855.500.001859.28
    182021.01.29 16:51t/p90.011859.280.001859.283.781038.59
    192021.02.10 17:36buy100.011840.200.001846.28
    202021.02.11 15:15t/p100.011846.280.001846.284.791043.38
    212021.02.16 14:00buy110.011816.620.001819.00
    222021.02.16 15:34close110.011801.620.001819.00-15.001028.38
    232021.03.16 09:30buy120.011728.000.001731.30
    242021.03.16 10:21t/p120.011731.300.001731.303.301031.68
    252021.03.16 17:49buy130.011729.090.001731.47
    262021.03.16 19:06t/p130.011731.470.001731.472.381034.06
    272021.03.17 13:33buy140.011728.450.001728.58
    282021.03.17 13:36t/p140.011728.580.001728.580.131034.19
    292021.03.18 10:45buy150.011736.300.001737.28
    302021.03.18 11:03t/p150.011737.280.001737.280.981035.17
    312021.03.22 08:17buy160.011733.240.001736.69
    322021.03.22 13:09t/p160.011736.690.001736.693.451038.62
    332021.03.23 15:19buy170.011735.130.001735.56
    342021.03.24 12:04t/p170.011735.560.001735.560.001038.62
    352021.04.14 16:49buy180.011739.070.001750.67
    362021.04.15 15:15t/p180.011750.670.001750.6710.311048.93
    372021.04.23 17:02buy190.011782.060.001783.46
    382021.04.27 04:03t/p190.011783.460.001783.460.541049.47
    392021.04.27 17:45buy200.011780.200.001784.90
    402021.04.28 12:22close200.011765.200.001784.90-15.431034.04
    412021.05.04 18:15buy210.011778.050.001781.08
    422021.05.04 18:22t/p210.011781.080.001781.083.031037.07
    432021.05.10 17:54buy220.011837.430.001837.63
    442021.05.10 17:58t/p220.011837.630.001837.630.201037.27
    452021.05.11 16:09buy230.011826.520.001826.97
    462021.05.11 16:51t/p230.011826.970.001826.970.451037.72
    472021.05.19 11:54buy240.011860.370.001863.37
    482021.05.19 12:00t/p240.011863.370.001863.373.001040.72
    492021.05.19 22:01buy250.011862.940.001865.94
    502021.05.19 22:09t/p250.011865.940.001865.943.001043.72
    512021.05.21 17:15buy260.011875.840.001876.89
    522021.05.21 17:24t/p260.011876.890.001876.891.051044.77
    532021.06.01 11:34buy270.011908.050.001908.13
    542021.06.01 11:46t/p270.011908.130.001908.130.081044.85
    552021.06.01 17:15buy280.011899.990.001905.79
    562021.06.02 15:24t/p280.011905.790.001905.795.371050.22
    572021.06.08 17:00buy290.011888.320.001898.52
    582021.06.09 16:39t/p290.011898.520.001898.529.771059.99
    592021.06.22 15:34buy300.011777.240.001777.99
    602021.06.22 16:07t/p300.011777.990.001777.990.751060.74
    612021.06.25 18:15buy310.011780.790.001783.17
    622021.06.28 08:24t/p310.011783.170.001783.171.951062.69
    632021.07.01 18:24buy320.011769.570.001772.57
    642021.07.01 20:04t/p320.011772.570.001772.573.001065.69
    652021.07.08 17:17buy330.011807.020.001809.55
    662021.07.09 18:18t/p330.011809.550.001809.552.101067.79
    672021.07.13 17:18buy340.011809.550.001835.83
    682021.07.15 14:36buy350.011825.530.001831.93
    692021.07.15 14:36modify340.011809.550.001831.93
    702021.07.16 18:09close350.011810.530.001831.93-15.431052.36
    712021.07.16 18:33close340.011809.540.001831.93-2.161050.20
    722021.07.20 17:45buy360.011812.450.001814.60
    732021.07.21 15:16close360.011797.450.001814.60-15.431034.77
    742021.07.30 15:49buy370.011825.470.001828.47
    752021.07.30 21:39close370.011810.470.001828.47-15.001019.77
    762021.08.04 17:15buy380.011818.020.001819.52
    772021.08.05 16:39close380.011803.020.001819.52-16.291003.48
    782021.08.24 16:45buy390.011804.750.001811.50
    792021.08.25 16:37close390.011789.750.001811.50-15.43988.05
    802021.09.01 17:15buy400.011812.740.001818.32
    812021.09.02 16:15buy410.011811.890.001816.77
    822021.09.02 16:15modify400.011812.740.001816.77
    832021.09.03 15:16t/p400.011816.770.001816.772.31990.36
    842021.09.03 15:16t/p410.011816.770.001816.774.45994.81
    852021.09.07 06:45buy420.011823.350.001823.70
    862021.09.07 14:18close420.011808.350.001823.70-15.00979.81
    872021.09.09 16:49buy430.011794.470.001801.72
    882021.09.10 08:37t/p430.011801.720.001801.726.82986.63
    892021.09.15 17:04buy440.011797.210.001802.84
    902021.09.16 12:37close440.011782.210.001802.84-16.29970.34
    912021.09.22 21:51buy450.011770.120.001773.30
    922021.09.22 22:24t/p450.011773.300.001773.303.18973.52
    932021.10.07 15:45buy460.011755.480.001757.76
    942021.10.07 16:52t/p460.011757.760.001757.762.28975.80
    952021.10.08 17:30buy470.011762.890.001766.27
    962021.10.12 15:45buy480.011754.960.001756.36
    972021.10.12 15:51t/p480.011756.360.001756.361.40977.20
    982021.10.12 16:54t/p470.011766.270.001766.272.52979.72
    992021.10.22 18:46buy490.011788.300.001800.70
    1002021.10.25 07:54t/p490.011800.700.001800.7011.97991.69
    1012021.11.02 15:04buy500.011791.520.001798.77
    1022021.11.03 14:39close500.011776.520.001798.77-15.43976.26
    1032021.11.09 17:15buy510.011822.800.001828.00
    1042021.11.09 18:51t/p510.011828.000.001828.005.20981.46
    1052021.11.16 16:04buy520.011867.230.001870.78
    1062021.11.16 19:54close520.011852.230.001870.78-15.00966.46
    1072021.11.18 15:30buy530.011856.970.001860.87
    1082021.11.18 15:36t/p530.011860.870.001860.873.90970.36
    1092021.11.30 17:49buy540.011792.680.001795.41
    1102021.11.30 18:07close540.011777.680.001795.41-15.00955.36
    1112021.12.07 11:15buy550.011779.030.001780.51
    1122021.12.07 11:51t/p550.011780.510.001780.511.48956.84
    1132021.12.07 15:31buy560.011778.340.001781.34
    1142021.12.07 16:39t/p560.011781.340.001781.343.00959.84
    1152021.12.21 16:54buy570.011793.670.001796.67
    1162021.12.22 18:04t/p570.011796.670.001796.672.57962.41
    1172021.12.28 16:15buy580.011811.410.001813.51
    1182021.12.28 16:24t/p580.011813.510.001813.512.10964.51
    1192021.12.28 18:48buy590.011810.050.001810.68
    1202021.12.28 18:54t/p590.011810.680.001810.680.63965.14
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester 4.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..be29d045da4088a6f0ddcd0da199157733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alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.12.30 23:45 (2020.01.01 - 2021.12.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=4; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.01; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=700;
    Bars in test25902Ticks modelled27850269Modelling quality24.91%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit26.49Gross profit36.50Gross loss-10.01
    Profit factor3.65Expected payoff3.31
    Absolute drawdown5.52Maximal drawdown13.71 (1.33%)Relative drawdown1.33% (13.71)
    Total trades8Short positions (won %)0 (0.00%)Long positions (won %)8 (87.50%)
    Profit trades (% of total)7 (87.50%)Loss trades (% of total)1 (12.50%)
    Largestprofit trade8.37loss trade-10.01
    Averageprofit trade5.21loss trade-10.01
    Maximumconsecutive wins (profit in money)5 (30.62)consecutive losses (loss in money)1 (-10.01)
    Maximalconsecutive profit (count of wins)30.62 (5)consecutive loss (count of losses)-10.01 (1)
    Averageconsecutive wins4consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.25 18:04buy10.011852.450.001861.25
    22021.01.26 06:09t/p10.011861.250.001861.258.371008.37
    32021.01.28 20:00buy20.011837.880.001842.68
    42021.01.28 21:09t/p20.011842.680.001842.684.801013.17
    52021.03.16 09:30buy30.011728.000.001733.28
    62021.03.16 12:39t/p30.011733.280.001733.285.281018.45
    72021.05.19 22:01buy40.011862.940.001867.74
    82021.05.19 22:21t/p40.011867.740.001867.744.801023.25
    92021.09.02 16:15buy50.011811.890.001819.69
    102021.09.03 15:34t/p50.011819.690.001819.697.371030.62
    112021.09.07 07:37buy60.011822.290.001827.09
    122021.09.07 12:24close60.011812.280.001827.09-10.011020.61
    132021.10.07 15:45buy70.011755.480.001759.12
    142021.10.07 16:54t/p70.011759.120.001759.123.641024.25
    152021.10.12 15:45buy80.011754.960.001757.20
    162021.10.12 15:52t/p80.011757.200.001757.202.241026.49
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester Long 1.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester Long 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd6e3b157f792e9c8b9e6743672c33dccd7e1286 GIT binary patch literal 8037 zcmc(6gP0xAO1A`KGK-LTZs-L)*W2rNr?E}aWYBaMVK zDEs5{egBAeo|$>>bMCq4o;&mQosyKa>2tgRz!m_2#bN;f!0_-e7J&jm{va$Y5cd$m z0tCST?hh7=fq?EIgvCAcJ_KMfXb=DnxZfc3|Knl*KtTTk04T(L5`@P5j|c!*Anr@= zi|-+X1sv20!ERcB?lmD62#eNxX#fBP0<~iAQ2-qCKNSl&z+w}7PlvSLceqd9JHkRh zpnEOQe>Vtm?+*aL+`F-WAnw~hKnTozaDTPlS3>SV6aa*}XWjRK+>`ES`p?9D{yzkP z!9XzR`^e%x2Y}y8-HTd){+siD(EmS6@c#7y|NRBv5jFr26dV#779J4^j*5Dl?k%VH8_O;MeMO>USve*Lu?jp!Zb5?uH)kX0W1kuKqvayXY( zPEuOJrb?8MY1=eiVoAS_WZ~}OU~TF9SM(we>z~(YYpJ~D;YzN1uKht7$E7L(Yz4qk zdq^BH1l|J#y?R8+Oa4n-U+)bO9Wh9N&z`H=4$Ia1u*2^F7tEBP{KqZgN_dAV0IEl2E&};d^~Zo4BAz$W-mxEnZDkb z_Q;?ETfMmzIr-6hyJKhjLC|L2B;U0)FVE*Z0GFnI7+lycGL?4h!<0X}Vl2`7=+ zqzU`+{Nq#t!mYQdp|js2h}}x9BxebDrMO=b;_Gs;N8&-B7T^fL$@PeYqje()c!{4G zc~ZA@%;Ph302Jaldsy-C#l|&*S!suL3$d*GYZ2*q5_#mh07*JHfK+-FZk`BG^9&{h zYQkRu2#(3ONP~+vi%F$4tpiePCT6x$9l*O=I8$fG0h#9NiFkycmsh)UJ}u~R2TXYY zw)I{1R!dTYwFfP-ztV!XjBKwX6|LR52}`rn2+b^$9}Uy=!Na-3onkXl$wHjkR~w>mW`BLE5{T5@GAN!$>s-gi6EWiF*(+wK%t^rm5HnVOYy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6>QXU0tfIx4ORR4StBC-S~Vd?PWA}|7*@2lKp;@G z0oE6WZf9idHI+9JIW+$P%ZL;U#ZHd0txTds8jss$L}4vAW@{tS0q7_&Iin z-p@vBcpo+$jowaQx@FKF&k~F=_ZbGtKHE%GUH% zM&?QDR&G>V7fU)yzZVSC#RDr#j_e~3-89oMCk8iQDP6!-UX(w$5W+ga_K*KB}; za_=~yhxib_X2qLI?YLsbl>opA9@=*$>YY1agP9KU9u?yz&MiKmr+%%3{}Px;4RZ_? zw96+l26od8Ifgy2$S3(8(ap5y7%qE|Pv#HoVI_2mcr92!5f{gR<5Se?t?Hm9bV=3VH^f58>pKv{qA^t-@~&&Iq8*7Gi@ci#y$O(d#> z?d3t=Ma${;77lqK|@Cu~^~58(0RV&L^70zq|Tc`6|_2$#Kriy_}ZLA4?Z#9-4j= zcrpU}tf}?~pqUIap3(pKb()4+amfbzRTuAL4d|Qj_uo8DkfEg8(-`@i< z7*v-8Rp-osvyhg-ViP-ZBg?_2RBDMd!WlU}Q^i(*p>OazLul;UsmF+^j~Y?a1h^8~ z(mEP^Op`=><~p+ZfYDEjO-(qh53yUJ)Eh)dHiYjSv7HDQ6|XmlQ!zjED2@WJ$~|i> z@qh<%Q7qvIAmfi>jsibc>r=JF>U&6`Id8WwI3?&@oJ3p~T9ZtT*Ll z6emhjT%cn1gm3&$r-7?=<*m}z+ONc?!w%}J{Yef?h`iA~!ibu + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.07.28 23:45 (2020.01.01 - 2023.07.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.02; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63169Ticks modelled72369290Modelling qualityn/a
    Mismatched charts errors799
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit55.56Gross profit117.99Gross loss-62.43
    Profit factor1.89Expected payoff2.06
    Absolute drawdown7.49Maximal drawdown42.26 (3.85%)Relative drawdown3.85% (42.26)
    Total trades27Short positions (won %)0 (0.00%)Long positions (won %)27 (88.89%)
    Profit trades (% of total)24 (88.89%)Loss trades (% of total)3 (11.11%)
    Largestprofit trade7.44loss trade-21.46
    Averageprofit trade4.92loss trade-20.81
    Maximumconsecutive wins (profit in money)19 (96.37)consecutive losses (loss in money)1 (-21.46)
    Maximalconsecutive profit (count of wins)96.37 (19)consecutive loss (count of losses)-21.46 (1)
    Averageconsecutive wins8consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.02 03:43buy10.011814.730.001816.98
    22020.12.02 09:28buy20.011812.810.001816.41
    32020.12.02 09:54t/p20.011816.410.001816.413.601003.60
    42020.12.02 10:22t/p10.011816.980.001816.982.251005.85
    52020.12.02 21:54buy30.011829.880.001834.47
    62020.12.02 23:54buy40.011831.020.001835.49
    72020.12.03 05:22t/p30.011834.470.001834.473.131008.98
    82020.12.03 05:24t/p40.011835.490.001835.493.011011.99
    92020.12.03 20:34buy50.011837.840.001845.25
    102020.12.03 22:21buy60.011840.200.001847.03
    112020.12.04 15:31t/p50.011845.250.001845.256.921018.92
    122020.12.04 15:33t/p60.011847.030.001847.036.341025.26
    132020.12.08 15:04buy70.011865.620.001872.69
    142020.12.08 16:36t/p70.011872.690.001872.697.071032.33
    152020.12.15 20:52buy80.011853.000.001859.90
    162020.12.15 23:39buy90.011853.970.001858.55
    172020.12.16 10:37t/p90.011858.550.001858.554.091036.42
    182020.12.16 10:39t/p80.011859.900.001859.906.411042.84
    192020.12.16 18:58buy100.011854.870.001858.31
    202020.12.16 20:54buy110.011856.270.001862.21
    212020.12.16 21:51t/p100.011858.310.001858.313.441046.28
    222020.12.16 22:00t/p110.011862.210.001862.215.941052.22
    232020.12.17 23:54buy120.011886.280.001890.84
    242020.12.18 06:09buy130.011882.700.001887.65
    252020.12.18 07:49buy140.011885.490.001890.91
    262020.12.18 14:09t/p130.011887.650.001887.654.951057.17
    272020.12.21 01:34buy150.011884.420.001890.60
    282020.12.21 03:04t/p150.011890.600.001890.606.181063.35
    292020.12.21 03:04t/p120.011890.840.001890.843.591066.93
    302020.12.21 03:04t/p140.011890.910.001890.914.931071.87
    312020.12.31 11:00buy160.011893.630.001899.86
    322020.12.31 17:33t/p160.011899.860.001899.866.231078.10
    332021.01.05 09:45buy170.011942.050.001948.40
    342021.01.05 13:22t/p170.011948.400.001948.406.351084.45
    352021.01.06 09:19buy180.011948.700.001956.14
    362021.01.06 10:48t/p180.011956.140.001956.147.441091.89
    372021.01.19 19:19buy190.011841.460.001846.43
    382021.01.20 03:09t/p190.011846.430.001846.434.481096.37
    392021.02.01 20:17buy200.011865.270.001872.37
    402021.02.02 09:24close200.011845.270.001872.37-20.491075.89
    412021.02.08 07:28buy210.011814.800.001818.93
    422021.02.08 09:18buy220.011815.830.001819.84
    432021.02.08 12:30buy230.011813.220.001819.22
    442021.02.08 13:34t/p210.011818.930.001818.934.131080.02
    452021.02.08 13:34t/p230.011819.220.001819.226.001086.02
    462021.02.08 13:34t/p220.011819.840.001819.844.011090.03
    472021.02.08 22:24buy240.011834.090.001839.16
    482021.02.09 04:22t/p240.011839.160.001839.164.581094.61
    492021.02.10 21:09buy250.011843.000.001847.37
    502021.02.11 19:48close250.011823.000.001847.37-21.461073.15
    512021.02.19 23:06buy260.011781.950.001785.33
    522021.02.22 01:00t/p260.011785.330.001785.332.891076.04
    532021.02.23 14:49buy270.011810.900.001816.96
    542021.02.24 15:54close270.011790.900.001816.96-20.491055.56
    +
    diff --git a/Docs/Reports/Tests/XTPW/Test/StrategyTester Long 2.gif b/Docs/Reports/Tests/XTPW/Test/StrategyTester Long 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..ed26036b704ad386cdb9da1309f331edde4973b2 GIT binary patch literal 8039 zcmc(A^;;Co_x92Y3lfTy!Xnb8fC5WMDAFPzQUanZDbgujyX4ZlbhAq%uyl8WgtSOE zN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s|WLoJKPw_-Srr`MR>K z*l2Q&HWj|t8^xQ8QI){)Y=BvdlK9dP>NH4zm(LOuko6X|1OTzraK1Iwe?a!M6*F!) zh_ARsO`G;Bk6)EXIf@M6s8aj^~4OD0OkS~Xt_3Vc-qldg>tNbGSOz@xh^fXwrAhR=1T^x;RON7|hPr2L8 zM+$Ncu6_sXSBZ1dLP+XjHM?NEXMZjs)y?CNm6%V$jI=b6f@~4r-V4FThwc$|-4qFM zxiLPF<3R?|zxnoEX=ka2kfGxx$1??;0k_2-IcR&tK|!SOubGGPs16$2X9)Q9U)g7( z{V{)qV(CWpA2s{8y&EdvE_ejjEJ6zQzlO4d-IFv;#kvL?Ut7;4Q&U#_@*d^i)qYq= zDt0yQZ9gQO$ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2021.01.04 01:00 - 2021.01.29 23:45 (2021.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=1.5; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test2825Ticks modelled1863423Modelling quality25.00%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit-75.83Gross profit45.67Gross loss-121.50
    Profit factor0.38Expected payoff-3.30
    Absolute drawdown88.29Maximal drawdown108.86 (10.67%)Relative drawdown10.67% (108.86)
    Total trades23Short positions (won %)0 (0.00%)Long positions (won %)23 (65.22%)
    Profit trades (% of total)15 (65.22%)Loss trades (% of total)8 (34.78%)
    Largestprofit trade7.23loss trade-15.49
    Averageprofit trade3.04loss trade-15.19
    Maximumconsecutive wins (profit in money)6 (14.22)consecutive losses (loss in money)4 (-60.04)
    Maximalconsecutive profit (count of wins)18.71 (5)consecutive loss (count of losses)-60.04 (4)
    Averageconsecutive wins4consecutive losses3
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.01.05 07:00buy10.011939.430.001943.05
    22021.01.05 09:24t/p10.011943.050.001943.053.621003.62
    32021.01.05 09:45buy20.011942.050.001948.38
    42021.01.05 13:22t/p20.011948.380.001948.386.331009.95
    52021.01.05 20:15buy30.011951.130.001955.81
    62021.01.06 09:13buy40.011947.600.001950.59
    72021.01.06 10:32t/p40.011950.590.001950.592.991012.94
    82021.01.06 10:46t/p30.011955.810.001955.814.191017.13
    92021.01.13 02:13buy50.011859.350.001866.81
    102021.01.13 09:34buy60.011861.920.001866.03
    112021.01.13 13:04buy70.011856.150.001857.73
    122021.01.13 15:39t/p70.011857.730.001857.731.581018.71
    132021.01.13 22:54close60.011846.920.001866.03-15.001003.71
    142021.01.13 23:54close50.011844.310.001866.81-15.04988.67
    152021.01.15 10:43buy80.011852.810.001857.60
    162021.01.15 12:43buy90.011855.730.001860.13
    172021.01.15 15:49close90.011840.730.001860.13-15.00973.67
    182021.01.15 15:54close80.011837.810.001857.60-15.00958.67
    192021.01.19 08:58buy100.011840.930.001844.11
    202021.01.19 10:22t/p100.011844.110.001844.113.18961.85
    212021.01.19 12:19buy110.011843.360.001844.22
    222021.01.19 12:37t/p110.011844.220.001844.220.86962.71
    232021.01.19 19:43buy120.011842.910.001845.28
    242021.01.19 21:19buy130.011841.190.001841.76
    252021.01.20 01:34buy140.011841.110.001844.43
    262021.01.20 02:09t/p130.011841.760.001841.760.08962.80
    272021.01.20 03:04t/p140.011844.430.001844.433.32966.12
    282021.01.20 03:06t/p120.011845.280.001845.281.88968.00
    292021.01.21 20:39buy150.011865.910.001870.80
    302021.01.21 22:46t/p150.011870.800.001870.804.89972.89
    312021.01.21 22:49buy160.011870.850.001873.85
    322021.01.22 12:24close160.011855.850.001873.85-15.49957.40
    332021.01.25 03:21buy170.011857.390.001859.96
    342021.01.25 12:49t/p170.011859.960.001859.962.57959.97
    352021.01.25 14:55buy180.011861.750.001863.16
    362021.01.25 15:06t/p180.011863.160.001863.161.41961.38
    372021.01.26 03:58buy190.011858.070.001862.11
    382021.01.26 06:38buy200.011858.070.001859.60
    392021.01.26 14:52buy210.011855.730.001862.95
    402021.01.26 15:39t/p200.011859.600.001859.601.53962.91
    412021.01.27 10:04buy220.011852.410.001857.17
    422021.01.27 13:09close190.011843.070.001862.11-15.49947.43
    432021.01.27 13:39close210.011840.730.001862.95-15.49931.94
    442021.01.27 14:18close220.011837.410.001857.17-15.00916.94
    452021.01.28 12:22buy230.011842.720.001849.95
    462021.01.28 15:46t/p230.011849.950.001849.957.23924.17
    +
    diff --git a/Docs/Reports/X/Full/StrategyTester 1 Full.gif b/Docs/Reports/X/Full/StrategyTester 1 Full.gif new file mode 100644 index 0000000000000000000000000000000000000000..1345f1460a53d7e13384c3ebb6a19d60482994e7 GIT binary patch literal 7271 zcmc(DWmj9<_jQ04cPCJ+cqyegL2Eb^s6w&ZQi>MoZE-Ip2^OG0u;3Ofcpzx85Zom} zin|u4^;_)Yp%KGI_K3s+PYdw%KylbVF9ZE0Fg)p004b`eZ<;c5bUtl z&aUrUqhItbLi1;ZG00p>tKvVyZM?8dq{s#bhYj2XEDg6J4 z0DxWXP3cYX4ODA~0yV*iD|Vn8O_*J+UDJ&;0MH8pH4$%601E#<6+0BbZiRS5hc(@F zxJlkPBEmqR8!ga(C#d$u9{_;AabpLoy=emj)#7i0o1^Kb5_SXj0zkbtteZZt8`8~8 z|CzYS|A*A#@i6?p3TyL?$7Br1+Gw~9B!hSzCq!Uo@V~t&WYQXmJ8h;ASc@)gA z0e#6Cx2zK`Y=Za+k6Y1;xc^V{7-xKb_iM$R4MI;{I!76-KlkQm&i1>>NbfRHB?%wmko^5$mGXgFy>_rzU<%bkhBowr-R?aq|v18*5$ z9_{8-(ev&Lcd(iKZU$eP8m=%szD30>5-DtZ%p67?f8V0DRXJ3UjvHu+=*uFLXGmdR z5XShxLK)1>22J~WJ`2=UivC92syn_r{$=ap#0jEsm!6-QMZ;EAF{n38>uy|G!To8DBr57v?WC}Yk6_ww1@?*)RANdZkEqGt3JXHW3Z=72?x7gX zXrv!e`4>0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$#PXW|3h9$QEQxAG-)9}(H=o+p9OB-;7oWeH8Yil z1mN-lVC>|pIe{`WYq^oYi{<<%@f7AL0fZnYVk%9-j?Kg#NK3*0(snVicpTX0j1Gx& zbZ#O&D&~I*1#i+LaazveEx3!kii#$7WaR*JrITpOrrsy<_LP)u@pf{WK2-PD;vF)< zt}{pJcA4Htw6L8D4%PLF28WuGU=c*OqBcM4bq%kV(hW;21+|W_I(Jf_NZX|pScNL~ zbHnaymPug4oTLG_87y48GT&bQs&XvQJ8Lj&xl?TZQ?7> z$ea-qjh;tT0f_sQj4FQO4E)7yj% zSt#9HNBU3rYc;a}>_t{f3XV0ke+Jc*IeB<(#Ke>xtmPPAe_jnPqd)mG^oH2@0h{50 z-mZS}*ng#sGwD*SDqE#^Zs!Vl>a+4d3>rrqiC)fV%h@=Q!=V zOIftqzsRg`wqt6K&=utz)RMZpo77T0p<+P^D~^6cB+ z9jC&X9~~I6L{b5U^-PK$F*yemewa<-w~I2cbWm4pd`idV)-g%f^&S}J%8J;_HpMpe&^@AHDtmB0o6N#x@4vTzOyHQC+lp{|L$M~o2 zHfJVQC)y8pxZ|~WWE`V3C2|EAAlRo89fp&mbTCG*6eLvSyV9tkC?Px%1=mHz|lV+IZY literal 0 HcmV?d00001 diff --git a/Docs/Reports/X/Full/StrategyTester 1 Full.htm b/Docs/Reports/X/Full/StrategyTester 1 Full.htm new file mode 100644 index 0000000..34808a4 --- /dev/null +++ b/Docs/Reports/X/Full/StrategyTester 1 Full.htm @@ -0,0 +1,127 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit187.12Gross profit207.57Gross loss-20.45
    Profit factor10.15Expected payoff7.20
    Absolute drawdown30.05Maximal drawdown35.70 (3.55%)Relative drawdown3.55% (35.70)
    Total trades26Short positions (won %)5 (100.00%)Long positions (won %)21 (95.24%)
    Profit trades (% of total)25 (96.15%)Loss trades (% of total)1 (3.85%)
    Largestprofit trade16.81loss trade-20.45
    Averageprofit trade8.30loss trade-20.45
    Maximumconsecutive wins (profit in money)25 (207.57)consecutive losses (loss in money)1 (-20.45)
    Maximalconsecutive profit (count of wins)207.57 (25)consecutive loss (count of losses)-20.45 (1)
    Averageconsecutive wins25consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.011842.370.001854.79
    22020.12.07 10:38close10.011822.360.001854.79-20.45979.55
    32021.01.06 02:00buy20.011950.700.001958.50
    42021.01.06 12:00t/p20.011958.500.001958.507.80987.35
    52021.02.19 05:15buy30.011769.840.001786.37
    62021.02.19 16:09t/p30.011786.370.001786.3716.531003.88
    72021.04.08 14:00buy40.011746.230.001756.37
    82021.04.08 16:39t/p40.011756.370.001756.3710.141014.02
    92021.04.21 04:30buy50.011779.810.001788.60
    102021.04.21 16:39t/p50.011788.600.001788.608.791022.81
    112021.05.04 23:15sell60.011779.150.001777.35
    122021.05.05 03:24t/p60.011777.350.001777.352.011024.81
    132021.06.18 08:45sell70.011784.490.001777.35
    142021.06.18 15:52t/p70.011777.350.001777.357.141031.95
    152021.07.01 05:00buy80.011771.690.001788.94
    162021.07.02 15:39t/p80.011788.940.001788.9416.811048.76
    172021.07.14 12:00buy90.011814.410.001822.33
    182021.07.14 15:06t/p90.011822.330.001822.337.921056.68
    192021.08.26 13:45buy100.011787.160.001795.29
    202021.08.26 18:04t/p100.011795.290.001795.298.131064.81
    212021.10.21 09:45buy110.011786.660.001797.58
    222021.10.22 15:22t/p110.011797.580.001797.5810.481075.29
    232021.12.15 04:45sell120.011771.980.001768.80
    242021.12.15 07:39t/p120.011768.800.001768.803.181078.47
    252022.02.09 11:30buy130.011827.780.001831.59
    262022.02.09 15:09t/p130.011831.590.001831.593.811082.28
    272022.03.14 08:45sell140.011975.330.001973.05
    282022.03.14 09:54t/p140.011973.050.001973.052.281084.56
    292022.06.24 05:00sell150.011823.760.001819.89
    302022.06.24 16:00t/p150.011819.890.001819.893.871088.43
    312022.08.01 01:30buy160.011764.450.001772.37
    322022.08.01 12:57t/p160.011772.370.001772.377.921096.35
    332022.08.22 14:15buy170.011735.790.001742.63
    342022.08.23 11:42t/p170.011742.630.001742.636.401102.75
    352022.09.05 04:45buy180.011711.680.001722.30
    362022.09.06 03:46t/p180.011722.300.001722.3010.181112.92
    372022.11.15 04:45buy190.011771.790.001782.62
    382022.11.15 09:47t/p190.011782.620.001782.6210.831123.75
    392022.11.21 20:30buy200.011738.310.001753.49
    402022.11.21 23:45buy210.011738.420.001742.35
    412022.11.22 03:06t/p210.011742.350.001742.353.491127.24
    422022.11.24 02:26t/p200.011753.490.001753.4912.971140.21
    432022.11.30 10:00buy220.011755.410.001761.92
    442022.11.30 11:36t/p220.011761.920.001761.926.511146.72
    452023.01.20 09:00buy230.011926.840.001936.65
    462023.01.20 10:08t/p230.011936.650.001936.659.811156.53
    472023.03.01 04:30buy240.011829.000.001845.23
    482023.03.03 10:41t/p240.011845.230.001845.2314.461170.99
    492023.04.25 09:30buy250.011995.340.002008.12
    502023.04.26 16:27t/p250.012008.120.002008.1212.341183.33
    512023.07.04 17:45buy260.011928.490.001932.72
    522023.07.05 16:17t/p260.011932.720.001932.723.791187.12
    +
    diff --git a/Docs/Reports/X/Long/StrategyTester.gif b/Docs/Reports/X/Long/StrategyTester.gif new file mode 100644 index 0000000000000000000000000000000000000000..bb981a8263391a6e4e9fb4a1a2942573ba1780df GIT binary patch literal 7287 zcmc(?cUP0m_dOiIlF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Nq6&~>XcUO0;E3-(Bs{radF(T0A8c2BB@?duU=KhG)(U`BbFY4 zBUTGl)U1k0OO)56g?4Le^YP`LMx1W@@r=TZm7UHZj03%qDaeXWc4Fy!tmNLaDk-sdgw2dA6G(cr zMCE2x-@Cip^564R8}APHNs1%lxrCEG3`vYwRdiA`+BH25&Oc}lj8)G>Ds(Wa?qlyf z44Fpadt%TMGUnd1paF}>7V+z%`AiLhR!?PRgBw6JV%f~?FW#HhtxyF%` zQZ)mj_RhJij+#`1<&rmvujaYWY~=a9{;@v&yMNrxI4&ItUxceQMZUHV>8$`Xnc+u= zPc&8H>O!-;4`ZEfYe{|Gn>!PkBLW$`W@0;M&ZNF-Tqt!b(J8N&Y!8L?(`Z%f4ENaY417Ayj3t+5Uq{WK2&<|-$^$MWTLsxQCR+Y zO2gh=?BpAp%X_xz<(sFhKfc-4L4&gGqA&glk#OgX(Cyh^FCGY2lZ%cuXjJGaI-k%w zS7f?jCuG7|gn>zuK@mwKOYAuX;A`M2-wd2k+|jis(#pnB_Pp#|N>$wgB@PHv$8N4( zr>7eo5#e5A!u)3#@Rj`G8~@2LLN<$@sx&zuKVDhs{tM36)$@!?D9abU4eK{>@r+O3 w&KK7P4H&^a6Y^yWBwxS={weWHEORT6wgutM20W8$%L-)Q!SIi-&;m66A7XO+i2wiq literal 0 HcmV?d00001 diff --git a/Docs/Reports/X/Long/StrategyTester.htm b/Docs/Reports/X/Long/StrategyTester.htm new file mode 100644 index 0000000..692fc34 --- /dev/null +++ b/Docs/Reports/X/Long/StrategyTester.htm @@ -0,0 +1,111 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit167.90Gross profit188.39Gross loss-20.49
    Profit factor9.20Expected payoff8.00
    Absolute drawdown30.19Maximal drawdown35.74 (3.55%)Relative drawdown3.55% (35.74)
    Total trades21Short positions (won %)0 (0.00%)Long positions (won %)21 (95.24%)
    Profit trades (% of total)20 (95.24%)Loss trades (% of total)1 (4.76%)
    Largestprofit trade16.76loss trade-20.49
    Averageprofit trade9.42loss trade-20.49
    Maximumconsecutive wins (profit in money)20 (188.39)consecutive losses (loss in money)1 (-20.49)
    Maximalconsecutive profit (count of wins)188.39 (20)consecutive loss (count of losses)-20.49 (1)
    Averageconsecutive wins20consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 09:30buy10.011842.470.001854.89
    22020.12.07 10:38close10.011822.470.001854.89-20.49979.51
    32021.01.06 02:00buy20.011950.800.001958.60
    42021.01.06 12:00t/p20.011958.600.001958.607.80987.31
    52021.02.19 05:15buy30.011769.940.001786.47
    62021.02.19 16:09t/p30.011786.470.001786.4716.531003.84
    72021.04.08 14:00buy40.011746.330.001756.47
    82021.04.08 16:39t/p40.011756.470.001756.4710.141013.98
    92021.04.21 04:30buy50.011779.910.001788.70
    102021.04.21 16:39t/p50.011788.700.001788.708.791022.77
    112021.07.01 05:00buy60.011771.790.001789.04
    122021.07.02 15:39t/p60.011789.040.001789.0416.761039.54
    132021.07.14 12:00buy70.011814.510.001822.43
    142021.07.14 15:07t/p70.011822.430.001822.437.921047.46
    152021.08.26 13:45buy80.011787.260.001795.39
    162021.08.26 18:04t/p80.011795.390.001795.398.131055.59
    172021.10.21 09:45buy90.011786.760.001797.68
    182021.10.22 15:22t/p90.011797.680.001797.6810.431066.02
    192022.02.09 11:30buy100.011827.880.001831.69
    202022.02.09 15:09t/p100.011831.690.001831.693.811069.83
    212022.08.01 01:30buy110.011764.550.001772.47
    222022.08.01 12:57t/p110.011772.470.001772.477.921077.75
    232022.08.22 14:15buy120.011735.890.001742.73
    242022.08.23 11:42t/p120.011742.730.001742.736.351084.10
    252022.09.05 04:45buy130.011711.780.001722.40
    262022.09.06 03:47t/p130.011722.400.001722.4010.131094.24
    272022.11.15 04:45buy140.011771.890.001782.72
    282022.11.15 09:47t/p140.011782.720.001782.7210.831105.07
    292022.11.21 20:30buy150.011738.410.001753.59
    302022.11.21 23:45buy160.011738.520.001742.45
    312022.11.22 03:07t/p160.011742.450.001742.453.441108.51
    322022.11.24 02:26t/p150.011753.590.001753.5912.751121.26
    332022.11.30 10:00buy170.011755.510.001762.02
    342022.11.30 12:00t/p170.011762.020.001762.026.511127.77
    352023.01.20 09:00buy180.011926.940.001936.75
    362023.01.20 10:08t/p180.011936.750.001936.759.811137.58
    372023.03.01 04:30buy190.011829.100.001845.33
    382023.03.03 10:42t/p190.011845.330.001845.3314.281151.87
    392023.04.25 09:30buy200.011995.440.002008.22
    402023.04.26 16:28t/p200.012008.220.002008.2212.291164.16
    412023.07.04 17:45buy210.011928.590.001932.82
    422023.07.05 16:17t/p210.011932.820.001932.823.741167.90
    +
    diff --git a/Docs/Reports/X/Short/StrategyTester Short 1.gif b/Docs/Reports/X/Short/StrategyTester Short 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..40a51928ebad35ffa2a86c2bfa0c2ffd5275b184 GIT binary patch literal 7421 zcmc(6gre2EmT&%+2fWp*nLA z32?nU=^`frGP{y(G+ zg@U2x?lbdy4uCKR0YK(}dtY-H>i(ktf0n@g>jVD#3jjVA3V zF|l#+35iMYcS6-^v@pEzNpdssPc}RGoj{%<|m~GE)}t1 zmVgIpkBA{dVHiMwB0eP#`KFkz&Kn>dF^Henj( zA!iTu$F(-dwWj(O#jA&elw1*?Di~1{ovSxME}}G^?D=p0GeN zT^*$6=%77Y{V(pdjED87Pp4gWug+|s;!jCgDXHX4rC)-FgWo=lt!TL#>n&mkrQ

    C!!Kq=1fx%{lXYyo)FUxjZBMTY$8z*ME5PoO03n-y+8c-+!4kH^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bGS*AvU#$32BA3{ z(+_YizD=ES7Fb$vn;<=MZjc~DKrEM=-G}A4kjOCBn>dZeI>N&ADQ7xWL=aK)kOK|OO`OCn5W2{x45E>$foR9-&Fyu7Dt{npjYBh z-oKQ|A0vRj%3~qOq#a`{;DBdrA^;?xw-RXNx>iXes=*Opn>Pu^AlmL01gmBPfE~X^ z3x54YNInb~DnZr_3RVDURKx0Vj<4)m*GYf<9v$ht~l zEC&D)HugA8(V^+%2tNGJh-Mcgyl+o=RJcC&qz@~X8GABXy17?9R&1>PYcOw9;D>@0eV2Yz7#!9AIJthwE2z9B}r~ z<)QWFT&Eq^zdCyH3&@La$FqZ|IGSglMTl^8erWH*zn zOM!61x83|?Flm_UH1j1mchacc-e)Vt#-WXSjo;DxHg)l!>G(Q4TK4vq%nup9%(wrt zb^c3$pAabd0zoTrB&Z6G=P^3Jsh3An1YrGL^q3y8v9;**AgL}Ev`!~oTf3%nzNhi^ z5%Bsql4n%v12$RM4Cx5h*2sfAhcii>EEIpeIn*tZGA1#zY-b=kdVJ3Rt?gB3C!R=E zh&&T}zxb(w(rc&C7)uID#fcoAlGoPIr`hM`**UuMAN=!_a;r7qM0JsSpT%$1w_gdzuz`G!UMsIj*ks&505 zI=tEW{N`2Ov3yFn(99h9q4UP5|p$Io6>@!{;0q2dIi!=|G zStg3Y>+}m>7JG!5I*VqkPom5Ap-69xOXkg9p&XWQ98B~h>!Dzg0$JF25Z{k%V!I;6 ZCqxqvl^;2e%ZuJT3!8}8=OPD4{U6BTM`Qp1 literal 0 HcmV?d00001 diff --git a/Docs/Reports/X/Short/StrategyTester Short 1.htm b/Docs/Reports/X/Short/StrategyTester Short 1.htm new file mode 100644 index 0000000..a4e0cd2 --- /dev/null +++ b/Docs/Reports/X/Short/StrategyTester Short 1.htm @@ -0,0 +1,95 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +xShortR2R=2; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit16.30Gross profit36.30Gross loss-20.00
    Profit factor1.81Expected payoff1.25
    Absolute drawdown9.13Maximal drawdown21.03 (2.03%)Relative drawdown2.03% (21.03)
    Total trades13Short positions (won %)13 (92.31%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)12 (92.31%)Loss trades (% of total)1 (7.69%)
    Largestprofit trade5.88loss trade-20.00
    Averageprofit trade3.02loss trade-20.00
    Maximumconsecutive wins (profit in money)12 (36.30)consecutive losses (loss in money)1 (-20.00)
    Maximalconsecutive profit (count of wins)36.30 (12)consecutive loss (count of losses)-20.00 (1)
    Averageconsecutive wins12consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.18 02:30sell10.011884.040.001881.64
    22020.12.18 03:09t/p10.011881.640.001881.642.401002.40
    32021.05.04 23:15sell20.011779.150.001777.95
    42021.05.05 01:39t/p20.011777.950.001777.951.421003.82
    52021.06.18 08:45sell30.011784.490.001779.73
    62021.06.18 15:24t/p30.011779.730.001779.734.761008.58
    72021.12.15 04:45sell40.011771.980.001769.86
    82021.12.15 07:22t/p40.011769.860.001769.862.121010.70
    92022.02.14 13:30sell50.011855.860.001852.18
    102022.02.14 14:46t/p50.011852.180.001852.183.681014.38
    112022.03.14 08:45sell60.011975.330.001973.81
    122022.03.14 09:24t/p60.011973.810.001973.811.521015.90
    132022.05.17 11:30sell70.011827.110.001821.23
    142022.05.17 17:07t/p70.011821.230.001821.235.881021.78
    152022.06.24 05:00sell80.011823.760.001821.18
    162022.06.24 16:00t/p80.011821.180.001821.182.581024.36
    172022.08.08 22:30sell90.011787.280.001783.52
    182022.08.09 05:13t/p90.011783.520.001783.523.981028.34
    192022.11.15 15:00sell100.011775.140.001770.92
    202022.11.15 16:38t/p100.011770.920.001770.924.221032.56
    212023.03.21 07:45sell110.011981.970.001979.33
    222023.03.21 08:17t/p110.011979.330.001979.332.641035.20
    232023.03.31 07:15sell120.011981.510.001980.41
    242023.03.31 08:07t/p120.011980.410.001980.411.101036.30
    252023.07.07 04:30sell130.011911.150.001908.99
    262023.07.07 17:37close130.011931.150.001908.99-20.001016.30
    +
    diff --git a/Docs/Reports/X/Short/StrategyTester Short 2.gif b/Docs/Reports/X/Short/StrategyTester Short 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..65134d77f4a47aba5327e1117ed59a7d9d282d1f GIT binary patch literal 6993 zcmc(D^;;Cq_x&OgOSd#A(jg)UEG-5N21=Jmm!iP3fHVtBtaNuSwII2qNV9Y;EZq&# zy&qoh?;r7$6tq|L?gy8&we01k%(003w-8duW?f*;mcS=HP@ zHC7-v7I3$4I4m4=2h~{JG4DbE4vPT+kbt`h!u&rT?hp?89{}j9xl4jD*#8j$0IQn2 z(!1h2sKyEjYJ%fdtw490aH|@traNf>pbrFU!rh?&B=&zQR!D%=D(;RBZ@TMnm%MX? zgM&bKTA=@SP|ck`004XE#tL3@*9H!%!QKUTThm=7{0{5`fcoxOcYWY@q`NcyXW}mZ zA5w$G!m*gU$m%W!Kw5zScWQTrupj{F?$G~VhS1&Z1O9sp01?g?;2#he6dVE#4TFV8 zL`K1XMaRU(#U~^tC8wmOrDtSjW#{DP7gP_%IZ@N66`M%E8(O%AP z3ibo;cKWxA&CsiNnyb_=?gMFf!nrL^Xo5&$gpFETr2`(3voIT{qqFcOD3ci$xEnm- z0h9*%gYWu#oF3Lz@-C*|uRY-!cip}`wGVyHMZrl!t6(WB>Dw3dnk%}j@p7P}kU4}= z&;ps+8;>zyd|FQ(IuwTa#`pF%+OdI1C!zYrtqyT<3f#>fw5c_^fBlqZ#_pIvMa77a zA=>OQsl|xdql2jj2|$vyHwi%#U!Y`e1vZisKt3rRB@#kC?nj~cg`(Mbf=DWTQju^y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v2T0&^| zOCgg^qCMc%ksz|n!{rar_*c=X(u$D{1&?X1&g%s%`ijH_efutBarR1?U$%8cv2Huf z;p+9LC6K*MXsL6#iP6mAR)5a7$y0BcvtbwVnaCHimwG=e-sc>jcHq4f%WC%gWg55b z#k+%Wx76-j!Q$+4O!X8)ulM54@^ZVTBXq8AH7`61(=zYm1v}U zd1m~JJdQXc0BA-oJ{6k789sHA!xfnBuAZeXKFHScqx{Dra;adYiKT>8U3zY-H&)X5 z5mH*g_u`85tH0P0-S6S~Wfaf9%Be|HodzSzW(t2{arrI{A7@XpO!ckZ2$=affdEDI zm6$n{H{SiLPFv1T3+}=v>O7Y@JnGMV`ypVr4gLr!au7*A$#IVWUs-xmZb?!leQ{~I zn3+vsavh0)M=b?+$-O>X0}|w~HBZ%oD*wqp3BMoFujN*kwb}3@XFqDxWFBv9^I?Ts zclhVj4lVQ4n59dr15>Y5k`6#(b_PC9B-VBD-GbR=%Cp!lu*@{-1b+4+Mgr&k-pZ<<9EonBq)0gk@jQeZ!JYe4yvIuZ#!0h8@Yu$2lBwe^1H#o z_y;JxtVWes12);6E=2`I1veX(6`B8-(wKPU_W91iml}a5C7XjA + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=true; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit18.48Gross profit18.48Gross loss-0.00
    Profit factorExpected payoff3.70
    Absolute drawdown10.94Maximal drawdown14.46 (1.44%)Relative drawdown1.44% (14.46)
    Total trades5Short positions (won %)5 (100.00%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)5 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade7.14loss trade-0.00
    Averageprofit trade3.70loss trade-0.00
    Maximumconsecutive wins (profit in money)5 (18.48)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)18.48 (5)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins5consecutive losses0
    +Graph
    + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.05.04 23:15sell10.011779.150.001777.35
    22021.05.05 03:24t/p10.011777.350.001777.352.011002.01
    32021.06.18 08:45sell20.011784.490.001777.35
    42021.06.18 15:52t/p20.011777.350.001777.357.141009.15
    52021.12.15 04:45sell30.011771.980.001768.80
    62021.12.15 07:39t/p30.011768.800.001768.803.181012.33
    72022.03.14 08:45sell40.011975.330.001973.05
    82022.03.14 09:54t/p40.011973.050.001973.052.281014.61
    92022.06.24 05:00sell50.011823.760.001819.89
    102022.06.24 16:00t/p50.011819.890.001819.893.871018.48
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 1.gif b/Docs/Reports/XR/Long/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..e16f6e592c066ab71f60a8d94efeece4da808e10 GIT binary patch literal 8518 zcmc(?g;N{M_dOh-&=91!mf|j@MT$eIKq(aI)8bGl#e&qZ;K2exf+o0I@B$$?rMMRl z!QG+I;*cMo@B2r*JG(n~&OP_sySp>Hvl_2n%E?jBl>pl{!Yv)q ze4F9cd0P|sHMc{82`u|T8yWM@j|IPw%mk_=LnHBq}*2H7z|OGb=kMH!r`Su&5YaQd(ACQCan)x~3LWhplgD zY-(<4ZTs2&tE024yQjCWe_(KEc%+nQY0u>NCh^rx#x>w(hXJvu_J)-9!E6FzNnMAETV;SDcKNwBq<<6V+;~?HS$pk{MW3IL?-dN&*O}e9dPFzt z_?J{u(~OKM?gJl%_2>tlLmV@b9JH>144M1{qjWE{e=e>L&o&5~6%91*bxytV#at zr~k1D7E!k0oDx5ip~VtAnb z7@fZlKNu;H2C91V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K;qF@R1$Vuoc-PvPX5@bq>k|I2QT8txOyzn?m#|yN zslLhC>h-6>7r(~Ux8eW3+b2La;NM+8xzH~lm? + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit95.44Gross profit261.37Gross loss-165.93
    Profit factor1.58Expected payoff1.34
    Absolute drawdown5.38Maximal drawdown31.55 (2.87%)Relative drawdown2.87% (31.55)
    Total trades71Short positions (won %)0 (0.00%)Long positions (won %)71 (57.75%)
    Profit trades (% of total)41 (57.75%)Loss trades (% of total)30 (42.25%)
    Largestprofit trade17.60loss trade-10.50
    Averageprofit trade6.37loss trade-5.53
    Maximumconsecutive wins (profit in money)4 (33.04)consecutive losses (loss in money)3 (-6.71)
    Maximalconsecutive profit (count of wins)33.04 (4)consecutive loss (count of losses)-16.35 (2)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.03 23:30buy10.011841.350.001845.81
    22020.12.04 15:31t/p10.011845.810.001845.814.021004.02
    32020.12.08 18:30buy20.011870.260.001886.04
    42020.12.09 03:19close20.011867.580.001886.04-3.121000.90
    52020.12.30 03:45buy30.011883.200.001893.66
    62020.12.30 10:00close30.011878.490.001893.66-4.71996.19
    72020.12.30 18:00buy40.011885.770.001895.53
    82020.12.31 02:15t/p40.011895.530.001895.538.431004.62
    92020.12.31 13:45buy50.011894.790.001901.55
    102021.01.04 01:00t/p50.011901.550.001901.555.881010.49
    112021.01.05 11:30buy60.011944.620.001954.40
    122021.01.06 03:09t/p60.011954.400.001954.409.341019.83
    132021.04.05 17:30buy70.011729.330.001742.53
    142021.04.05 22:00close70.011725.680.001742.53-3.651016.18
    152021.04.26 21:00buy80.011779.920.001781.68
    162021.04.26 23:39t/p80.011781.680.001781.681.761017.94
    172021.05.11 09:00buy90.011837.320.001840.12
    182021.05.11 09:51close90.011834.840.001840.12-2.481015.46
    192021.05.18 23:45buy100.011870.120.001872.90
    202021.05.19 05:00close100.011867.630.001872.90-2.931012.53
    212021.05.20 08:15buy110.011876.000.001876.98
    222021.05.20 08:30t/p110.011876.980.001876.980.981013.51
    232021.05.21 11:30buy120.011876.440.001882.56
    242021.05.21 15:21t/p120.011882.560.001882.566.121019.63
    252021.05.24 19:15buy130.011883.920.001887.18
    262021.05.25 01:15close130.011880.910.001887.18-3.451016.18
    272021.05.25 10:45buy140.011884.070.001898.65
    282021.05.25 21:06t/p140.011898.650.001898.6514.581030.76
    292021.06.28 20:30buy150.011780.420.001785.26
    302021.06.28 21:15close150.011778.020.001785.26-2.401028.36
    312021.07.02 02:00buy160.011776.540.001777.70
    322021.07.02 03:39t/p160.011777.700.001777.701.161029.52
    332021.07.06 04:15buy170.011792.850.001796.01
    342021.07.06 04:53t/p170.011796.010.001796.013.161032.68
    352021.07.09 17:45buy180.011806.300.001814.82
    362021.07.12 07:16close180.011801.870.001814.82-4.871027.80
    372021.07.13 17:45buy190.011811.780.001825.18
    382021.07.13 21:07close190.011806.200.001825.18-5.581022.22
    392021.08.11 05:30buy200.011732.160.001747.52
    402021.08.11 18:06t/p200.011747.520.001747.5215.361037.58
    412021.08.12 23:00buy210.011753.700.001757.12
    422021.08.13 09:09t/p210.011757.120.001757.122.981040.56
    432021.08.18 04:30buy220.011789.060.001796.30
    442021.08.18 12:30close220.011787.880.001796.30-1.181039.38
    452021.09.01 22:30buy230.011815.240.001820.60
    462021.09.02 02:45close230.011813.220.001820.60-3.351036.04
    472021.09.02 03:15buy240.011815.340.001819.70
    482021.09.02 05:30close240.011813.160.001819.70-2.181033.86
    492021.09.03 05:15buy250.011813.400.001819.26
    502021.09.03 15:34t/p250.011819.260.001819.265.861039.72
    512021.09.27 03:45buy260.011753.840.001763.88
    522021.09.27 12:49close260.011749.120.001763.88-4.721035.00
    532021.10.22 02:15buy270.011785.940.001793.12
    542021.10.22 09:52t/p270.011793.120.001793.127.181042.18
    552021.11.16 04:45buy280.011867.770.001877.31
    562021.11.16 09:45close280.011863.300.001877.31-4.471037.71
    572021.12.07 04:30buy290.011780.920.001785.14
    582021.12.07 05:45close290.011778.500.001785.14-2.421035.29
    592021.12.07 20:30buy300.011784.340.001788.42
    602021.12.08 04:07t/p300.011788.420.001788.423.641038.92
    612021.12.28 08:15buy310.011813.060.001819.28
    622021.12.28 15:36t/p310.011819.280.001819.286.221045.14
    632022.01.10 21:30buy320.011801.130.001805.89
    642022.01.11 04:24t/p320.011805.890.001805.894.321049.46
    652022.01.19 11:15buy330.011816.040.001824.86
    662022.01.19 15:33t/p330.011824.860.001824.868.821058.28
    672022.01.24 23:15buy340.011843.290.001853.65
    682022.01.25 12:36close340.011836.700.001853.65-7.031051.25
    692022.01.31 11:30buy350.011791.190.001798.83
    702022.01.31 16:39t/p350.011798.830.001798.837.641058.89
    712022.02.16 09:30buy360.011856.020.001860.76
    722022.02.16 15:00close360.011852.740.001860.76-3.281055.61
    732022.02.28 16:15buy370.011914.370.001926.79
    742022.02.28 18:09close370.011904.370.001926.79-10.001045.61
    752022.03.03 22:15buy380.011937.320.001946.64
    762022.03.04 02:36t/p380.011946.640.001946.648.881054.49
    772022.03.04 13:00buy390.011947.540.001961.66
    782022.03.04 18:09t/p390.011961.660.001961.6614.121068.61
    792022.03.11 21:30buy400.011986.860.001999.16
    802022.03.14 00:22close400.011976.800.001999.16-10.501058.10
    812022.03.24 13:30buy410.011946.410.001957.33
    822022.03.24 14:03t/p410.011957.330.001957.3310.921069.02
    832022.04.05 16:15buy420.011935.180.001956.54
    842022.04.05 18:24close420.011925.180.001956.54-10.001059.02
    852022.04.13 08:30buy430.011969.770.001973.31
    862022.04.13 08:48t/p430.011973.310.001973.313.541062.56
    872022.05.20 09:45buy440.011848.250.001859.53
    882022.05.20 16:31close440.011840.590.001859.53-7.661054.90
    892022.05.23 01:15buy450.011845.220.001848.46
    902022.05.23 02:07t/p450.011848.460.001848.463.241058.14
    912022.05.30 06:45buy460.011859.710.001862.85
    922022.05.30 08:42t/p460.011862.850.001862.853.141061.28
    932022.06.08 15:15buy470.011851.230.001858.73
    942022.06.08 18:07t/p470.011858.730.001858.737.501068.78
    952022.07.05 02:15buy480.011809.920.001814.70
    962022.07.05 10:30close480.011806.730.001814.70-3.191065.59
    972022.10.27 08:45buy490.011669.880.001683.00
    982022.10.27 09:45close490.011661.850.001683.00-8.031057.56
    992022.11.02 04:00buy500.011650.370.001653.27
    1002022.11.02 10:00t/p500.011653.270.001653.272.901060.46
    1012022.11.16 12:15buy510.011783.530.001796.87
    1022022.11.16 16:43close510.011773.530.001796.87-10.001050.46
    1032022.11.30 05:45buy520.011754.060.001759.10
    1042022.11.30 10:53t/p520.011759.100.001759.105.041055.50
    1052022.12.08 15:15buy530.011787.270.001794.47
    1062022.12.08 17:28t/p530.011794.470.001794.477.201062.70
    1072022.12.21 16:45buy540.011818.210.001822.71
    1082022.12.21 17:36t/p540.011822.710.001822.714.501067.20
    1092023.01.09 18:45buy550.011876.890.001885.73
    1102023.01.10 02:26close550.011868.360.001885.73-8.971058.23
    1112023.01.11 06:30buy560.011877.530.001882.75
    1122023.01.11 07:37t/p560.011882.750.001882.755.221063.45
    1132023.02.09 05:00buy570.011879.440.001889.90
    1142023.02.09 16:00t/p570.011889.900.001889.9010.461073.91
    1152023.02.16 21:30buy580.011843.430.001847.45
    1162023.02.17 01:15close580.011835.010.001847.45-8.861065.05
    1172023.02.22 05:15buy590.011837.090.001840.59
    1182023.02.22 10:03t/p590.011840.590.001840.593.501068.55
    1192023.03.17 04:45buy600.011929.050.001946.65
    1202023.03.17 15:02t/p600.011946.650.001946.6517.601086.15
    1212023.03.28 17:00buy610.011963.600.001968.68
    1222023.03.28 17:57t/p610.011968.680.001968.685.081091.23
    1232023.03.30 10:45buy620.011969.470.001976.33
    1242023.03.30 19:01t/p620.011976.330.001976.336.861098.09
    1252023.04.26 13:30buy630.012000.050.002005.35
    1262023.04.26 15:30close630.011993.710.002005.35-6.341091.75
    1272023.04.27 06:00buy640.011999.070.002014.41
    1282023.04.27 15:35close640.011989.060.002014.41-10.011081.74
    1292023.05.09 08:15buy650.012026.970.002032.23
    1302023.05.09 14:30t/p650.012032.230.002032.235.261087.00
    1312023.05.15 19:45buy660.012020.210.002031.69
    1322023.05.15 22:00close660.012014.590.002031.69-5.621081.38
    1332023.06.09 17:30buy670.011967.540.001988.74
    1342023.06.09 18:30close670.011962.630.001988.74-4.911076.47
    1352023.06.13 03:15buy680.011960.910.001966.27
    1362023.06.13 15:30t/p680.011966.270.001966.275.361081.83
    1372023.07.12 03:45buy690.011936.010.001941.67
    1382023.07.12 15:30t/p690.011941.670.001941.675.661087.49
    1392023.07.19 23:00buy700.011978.690.001982.47
    1402023.07.20 04:30t/p700.011982.470.001982.472.451089.94
    1412023.07.31 15:00buy710.011959.430.001964.93
    1422023.07.31 15:31t/p710.011964.930.001964.935.501095.44
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 10.gif b/Docs/Reports/XR/Long/StrategyTester 10.gif new file mode 100644 index 0000000000000000000000000000000000000000..605ff8a8174d6898d692dd715d111857b9f310d0 GIT binary patch literal 7435 zcmc(D^?tPrc^E}V*`Sr zjZMuht$*6uJ370%(LI>nzWxF1U@6(i=-BuKZgL7gO_-UTn_pP`yR^Krx<*{z*xcIQ z+1=YeI6OMuL6Bu$JHO1h09>v!L+4cVZ!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ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.04 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63629Ticks modelled72967510Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit100.29Gross profit131.18Gross loss-30.88
    Profit factor4.25Expected payoff14.33
    Absolute drawdown5.87Maximal drawdown29.76 (2.81%)Relative drawdown2.81% (29.76)
    Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (57.14%)
    Profit trades (% of total)4 (57.14%)Loss trades (% of total)3 (42.86%)
    Largestprofit trade53.90loss trade-10.88
    Averageprofit trade32.79loss trade-10.29
    Maximumconsecutive wins (profit in money)2 (24.79)consecutive losses (loss in money)2 (-20.88)
    Maximalconsecutive profit (count of wins)53.90 (1)consecutive loss (count of losses)-20.88 (2)
    Averageconsecutive wins1consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 19:30buy10.011812.670.001867.81
    22020.12.07 18:09t/p10.011867.810.001867.8152.491052.49
    32021.02.23 04:07buy20.011813.000.001850.54
    42021.02.23 16:34close20.011803.000.001850.54-10.001042.49
    52021.07.29 04:30buy30.011816.220.001862.70
    62021.08.02 15:16close30.011806.220.001862.70-10.881031.60
    72021.11.05 18:45buy40.011814.410.001872.29
    82021.11.16 10:54t/p40.011872.290.001872.2953.901085.50
    92022.02.04 15:30buy50.011813.380.001827.74
    102022.02.04 15:37close50.011803.380.001827.74-10.001075.50
    112022.02.07 11:01buy60.011813.370.001825.93
    122022.02.07 16:19buy70.011815.990.001829.55
    132022.02.08 17:22t/p60.011825.930.001825.9312.121087.62
    142022.02.09 15:04t/p70.011829.550.001829.5512.681100.29
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 11.gif b/Docs/Reports/XR/Long/StrategyTester 11.gif new file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^yx#A+QF)Hh8Jr&l@`Kri-wD@-$W1?ZIUVy#JBA7b5>S)$Y&OTI}l&CE$~|q(y|Qjv?tQH|}L ze8OCGd0a$G=%N#r*nCyM2MMUw?x0W$(1Jg@P~P3# zJt3Mi0a`}X3k?6353uhEJAx7G`FWU3gHjU#Z@(nG`HQrgLIHKX+m&gVL1f8pkv_ag zJo+@cqBfaCH@S%kQlpZBMk7|>zTTjeh$vaZ)WuWj?g`_?H&~|>rj(c+Q1+@+k%x|9d9g?2O1dz~+dJB(@ z5D_5I5?G{-&(O*s&q()B76<@DS4z2(SPB3H;5m+o43-(h@WebAfNUl+noh4EF`XTn z1)2d}CT6y7WwIuLAAz%;2xvZH&gzs(h~(E4)X&mBPba(t-oVn2LA2~i2rNV9pfO)5i`Cy6ph{Wg>U<`UOpK%x?B(*;PAoKqK + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.07 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63721Ticks modelled73052669Modelling qualityn/a
    Mismatched charts errors959
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit66.06Gross profit313.93Gross loss-247.87
    Profit factor1.27Expected payoff1.44
    Absolute drawdown11.93Maximal drawdown111.45 (9.77%)Relative drawdown9.77% (111.45)
    Total trades46Short positions (won %)0 (0.00%)Long positions (won %)46 (43.48%)
    Profit trades (% of total)20 (43.48%)Loss trades (% of total)26 (56.52%)
    Largestprofit trade42.10loss trade-11.77
    Averageprofit trade15.70loss trade-9.53
    Maximumconsecutive wins (profit in money)4 (58.47)consecutive losses (loss in money)9 (-88.41)
    Maximalconsecutive profit (count of wins)61.47 (3)consecutive loss (count of losses)-88.41 (9)
    Averageconsecutive wins3consecutive losses4
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 19:30buy10.011812.670.001854.03
    22020.12.02 02:30buy20.011813.300.001827.99
    32020.12.02 08:45buy30.011813.220.001821.29
    42020.12.02 10:36t/p30.011821.290.001821.298.071008.07
    52020.12.02 12:22t/p20.011827.990.001827.9914.691022.76
    62020.12.07 16:54t/p10.011854.030.001854.0338.711061.47
    72021.02.05 19:15buy40.011814.870.001846.31
    82021.02.08 01:15buy50.011817.920.001853.94
    92021.02.08 07:30buy60.011815.770.001825.97
    102021.02.08 10:54close50.011807.920.001853.94-10.001051.47
    112021.02.08 11:45buy70.011813.190.001820.66
    122021.02.08 13:36t/p70.011820.660.001820.667.471058.94
    132021.02.08 14:53t/p60.011825.970.001825.9710.201069.14
    142021.02.09 11:24t/p40.011846.310.001846.3130.561099.69
    152021.02.23 04:00buy80.011813.660.001842.81
    162021.02.23 05:45buy90.011813.350.001827.83
    172021.02.23 12:03close80.011803.660.001842.81-10.001089.69
    182021.02.23 16:34close90.011803.350.001827.83-10.001079.69
    192021.05.06 18:00buy100.011815.960.001857.50
    202021.05.12 23:21close100.011815.950.001857.50-1.781077.91
    212021.07.08 14:00buy110.011817.800.001849.44
    222021.07.08 16:54close110.011807.800.001849.44-10.001067.91
    232021.07.13 15:30buy120.011813.610.001824.61
    242021.07.13 15:33close120.011803.610.001824.61-10.001057.91
    252021.07.13 18:15buy130.011812.880.001833.64
    262021.07.14 06:30buy140.011813.470.001826.19
    272021.07.14 08:30buy150.011813.850.001827.14
    282021.07.14 10:45buy160.011813.970.001827.44
    292021.07.14 15:09t/p140.011826.190.001826.1912.721070.63
    302021.07.14 15:37t/p150.011827.140.001827.1413.291083.92
    312021.07.14 15:37t/p160.011827.440.001827.4413.471097.39
    322021.07.15 10:09t/p130.011833.640.001833.6418.991116.38
    332021.07.29 04:30buy170.011816.220.001851.08
    342021.08.02 15:16close170.011806.220.001851.08-10.881105.50
    352021.08.27 19:15buy180.011814.970.001860.75
    362021.08.31 04:30buy190.011814.070.001822.88
    372021.08.31 14:15buy200.011814.320.001820.52
    382021.08.31 16:07close180.011804.970.001860.75-10.881094.61
    392021.08.31 16:09close200.011804.320.001820.52-10.001084.61
    402021.08.31 16:09close190.011804.070.001822.88-10.001074.61
    412021.08.31 20:00buy210.011814.380.001832.73
    422021.09.01 04:30buy220.011813.000.001829.28
    432021.09.03 14:00close210.011813.360.001832.73-3.231071.38
    442021.09.03 17:37t/p220.011829.280.001829.2814.511085.89
    452021.11.05 18:45buy230.011814.420.001857.85
    462021.11.10 16:24t/p230.011857.850.001857.8542.101128.00
    472021.12.27 18:00buy240.011813.070.001827.70
    482021.12.28 08:00buy250.011813.290.001822.58
    492021.12.28 17:00buy260.011814.240.001821.44
    502021.12.29 02:08close260.011804.240.001821.44-10.441117.55
    512021.12.29 10:07close250.011803.290.001822.58-10.441107.11
    522021.12.29 10:09close240.011803.070.001827.70-10.881096.23
    532021.12.30 19:00buy270.011813.910.001839.94
    542022.01.03 16:54close270.011803.910.001839.94-10.881085.34
    552022.01.04 17:45buy280.011817.100.001844.31
    562022.01.04 19:30buy290.011814.680.001838.26
    572022.01.06 03:09close280.011807.100.001844.31-11.771073.57
    582022.01.06 07:37close290.011804.680.001838.26-11.771061.80
    592022.01.11 18:30buy300.011815.760.001836.12
    602022.01.14 19:18close300.011815.750.001836.12-2.221059.58
    612022.02.04 12:30buy310.011814.110.001827.76
    622022.02.04 15:30buy320.011813.380.001824.15
    632022.02.04 15:37close310.011804.110.001827.76-10.001049.58
    642022.02.04 15:37close320.011803.380.001824.15-10.001039.58
    652022.02.07 02:45buy330.011812.890.001843.42
    662022.02.07 11:00buy340.011813.460.001823.02
    672022.02.07 14:00buy350.011814.020.001821.27
    682022.02.07 16:15buy360.011816.190.001826.66
    692022.02.07 21:07t/p350.011821.270.001821.277.251046.83
    702022.02.07 21:39t/p340.011823.020.001823.029.561056.39
    712022.02.08 17:24t/p360.011826.660.001826.6610.031066.42
    722022.02.11 20:34t/p330.011843.420.001843.4227.881094.30
    732022.12.13 16:30buy370.011818.980.001875.20
    742022.12.13 17:50close370.011808.980.001875.20-10.001084.30
    752022.12.13 18:45buy380.011813.360.001859.13
    762022.12.14 21:01close380.011803.350.001859.13-10.451073.84
    772022.12.20 17:15buy390.011820.930.001871.35
    782022.12.21 09:30buy400.011815.440.001820.23
    792022.12.21 14:00buy410.011814.150.001817.00
    802022.12.21 15:13t/p410.011817.000.001817.002.851076.69
    812022.12.21 17:08t/p400.011820.230.001820.234.791081.48
    822022.12.22 15:38close390.011810.930.001871.35-11.771069.72
    832022.12.27 17:30buy420.011821.790.001850.43
    842022.12.27 19:58close420.011811.790.001850.43-10.001059.72
    852022.12.27 20:15buy430.011815.080.001833.65
    862022.12.28 03:30buy440.011814.740.001832.80
    872022.12.28 10:15close430.011805.080.001833.65-10.441049.27
    882022.12.28 10:15close440.011804.730.001832.80-10.011039.26
    892022.12.29 17:00buy450.011814.400.001828.85
    902022.12.29 18:45buy460.011814.770.001829.77
    912023.01.03 01:05t/p450.011828.850.001828.8513.121052.39
    922023.01.03 01:07t/p460.011829.770.001829.7713.671066.06
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 2.gif b/Docs/Reports/XR/Long/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ec49d5e72004ab6488cc3d49dc2f16e4e9a2fd5 GIT binary patch literal 8102 zcmch(1yh^P+cq4m1gAxc7pPHOiUlq1l=5qFD-hh>9fAk<;E>=>&;rG+IDz18DGsH$ z<>CIn-{IZeYi8#>WRKmQow*d16+}eM-s21dwgCVP1_J;9#>dAoEn^_)X$u(K@>psC zgP>@@>X0S1ErkNt7?|9>{l$I}P=-(3LkF~NY)u<(e; zC`fcnY+QUoA~Y#EB{eNQBQq;ICpQn4Ur<<7TvA$A4o6f}R#n&3*3~yOHZ`}jBHP+K zI=i~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zVkj^vY?UkUL(J(;VB*8riog_`SmmjENfSdO7t0F=fjJCF^-y45A&7%(Vb0c}I@MVF zx;f2Es!eyMFtZCdoA$oi8SVIu#4Fc2h`*JKTa3|b&G&es)y2c>RM_9^WuNDIq7JAS7rw!^SAoeXcp>`$}vI()f9yd*!#vo-Qwul_AsRuDb`#NBqb z?pE0)=D(^fy_sjw=1zGm7nX1w&nbrU0?RlH&SKghkiqvAF7fvE#q{gIA(2s+1ox_9 z#$(8k_?}Cm|3UE!3~*SQ&=nfaS;B&`hK%F(;Bc0x;X9|${Z!^RPUReU#icjG2IEQ* zn0v*>y{p{r^2sKX(~?ah>Gd+|Nisow5r+xEn6B}bs2Zo-2aD)2!@cB~?T{ye)a0^w zseM>vkjS?RZ zF14BD?VG|M`4ui)**5GBi^|FYmSaPdHPulm0rWLe{2@^b2%>2&FSs_ zISPUEEu3H2+E4xG(nSv88aZyCK8~m2=v$X-dVz9mn3_d-4srQt3#Os2TL{7Per=zd z=*onqk}PlAkFqZFCE)Wi&d+=QIW5m=%#~Ge57_8Ng^=&$o{Ke0U>YY|C073E#oIq1l)3n52TU;o+GZfb=W@7jl&Q2%y@lG+$`(@%QZ9eZOwVO=JdhTC17D8uu(1R z_t@w|c2nd@SGd1lrLOwQ^UmpCHLh9v1lP%z6qgQ`!EItj8bB2P-}moa|Eg}_Ye#kr zkXL)DK3yH4Zp^HH}i8d)JLtMF$+6daO`0r{O;LfUE@BRx#Fd`mB=%RKq?iKsz{IpB)UD>nI2ap*Y&bui zy + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=11; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit59.63Gross profit79.64Gross loss-20.01
    Profit factor3.98Expected payoff7.45
    Absolute drawdown24.68Maximal drawdown42.62 (4.07%)Relative drawdown4.07% (42.62)
    Total trades8Short positions (won %)0 (0.00%)Long positions (won %)8 (75.00%)
    Profit trades (% of total)6 (75.00%)Loss trades (% of total)2 (25.00%)
    Largestprofit trade19.99loss trade-10.01
    Averageprofit trade13.27loss trade-10.00
    Maximumconsecutive wins (profit in money)3 (49.04)consecutive losses (loss in money)1 (-10.01)
    Maximalconsecutive profit (count of wins)49.04 (3)consecutive loss (count of losses)-10.01 (1)
    Averageconsecutive wins3consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 02:45buy10.011813.240.001823.26
    22020.11.27 07:31close10.011803.230.001823.26-10.01989.99
    32020.12.01 16:15buy20.011814.300.001836.06
    42020.12.01 19:15buy30.011813.970.001831.39
    52020.12.02 01:00buy40.011812.820.001812.82
    62020.12.02 02:09t/p40.011812.820.001812.820.00989.99
    72020.12.02 08:30buy50.011814.560.001828.18
    82020.12.02 10:45buy60.011824.380.001851.10
    92020.12.02 12:22t/p50.011828.180.001828.1813.621003.61
    102020.12.02 12:39t/p30.011831.390.001831.3916.981020.59
    112020.12.02 15:54close60.011814.380.001851.10-10.001010.59
    122020.12.02 16:15buy70.011819.680.001832.70
    132020.12.03 05:19t/p70.011832.700.001832.7011.691022.28
    142020.12.03 05:37t/p20.011836.060.001836.0619.991042.27
    152021.01.18 02:45buy80.011819.330.001836.69
    162021.01.18 07:37t/p80.011836.690.001836.6917.361059.63
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 3.gif b/Docs/Reports/XR/Long/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..da54e45c9c422c1baac6b2bab123317a313c7e0a GIT binary patch literal 8185 zcmch*^;Z^OwFqR z=9}0D1^fZ5dH^2^#KOVg2kQq7003@iFkgJA%pBhEkP;4VSbUf?z!x7}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e^wlAflZe74?IHV->QpJwd) VY>WPB9`z?Z%OT423 + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=11; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit57.80Gross profit67.80Gross loss-10.00
    Profit factor6.78Expected payoff9.63
    Absolute drawdown20.25Maximal drawdown42.62 (4.01%)Relative drawdown4.01% (42.62)
    Total trades6Short positions (won %)0 (0.00%)Long positions (won %)6 (83.33%)
    Profit trades (% of total)5 (83.33%)Loss trades (% of total)1 (16.67%)
    Largestprofit trade19.99loss trade-10.00
    Averageprofit trade13.56loss trade-10.00
    Maximumconsecutive wins (profit in money)3 (36.12)consecutive losses (loss in money)1 (-10.00)
    Maximalconsecutive profit (count of wins)36.12 (3)consecutive loss (count of losses)-10.00 (1)
    Averageconsecutive wins3consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 16:15buy10.011814.300.001836.06
    22020.12.01 19:15buy20.011813.970.001831.39
    32020.12.02 01:00buy30.011812.820.001818.34
    42020.12.02 08:30buy40.011814.560.001828.18
    52020.12.02 10:34t/p30.011818.340.001818.345.521005.52
    62020.12.02 10:45buy50.011824.380.001851.10
    72020.12.02 12:22t/p40.011828.180.001828.1813.621019.14
    82020.12.02 12:39t/p20.011831.390.001831.3916.981036.12
    92020.12.02 15:54close50.011814.380.001851.10-10.001026.12
    102020.12.02 16:15buy60.011819.680.001832.70
    112020.12.03 05:19t/p60.011832.700.001832.7011.691037.81
    122020.12.03 05:37t/p10.011836.060.001836.0619.991057.80
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 4.gif b/Docs/Reports/XR/Long/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..5d8f0b330da5d7886488d32e94010c23f849cbe9 GIT binary patch literal 7696 zcmch*g;$i%`#-#tEXxuSijE#~au;f}x?|pT0r`1pxfd5`PCbTGc?>k@(+MkUM|m9Rz{gk*wMQfDs6!9e)P^Y8L-z zYE=WU`i;L+An(AMJMb<+JQ4!Av%b>+0FcH;tHry_tdNa&Ln0xKi+7zy#{opbx0 zxN!sk8EJ$dk$0rK`Tbu)cclLtx$%y*h`&qN>J9_cSU~`gyLtcrUj*(}AMk(Q0zis~ z0)m1=Lc_vg5s~mHM05-?HZDFPF)2AEH7z|OGb=kMH!r`Su&B7Cw5+_MvZ}hKwywV6 zdt*~Gs-?B9y`!_MyQjCWe_(KE7(FsNHa;;~LGWW{c5Z$FgI!!&URlMh{rt85dt-BJ zduMm=&;G&T(edAt)3fu#8iH)X>)Wgw!0j#_5+|!pa-Vf60l6lpM!_yUN*DX{tt$PC z+r{(9{5OGYGLhO0aqEiVPqeZUQsRCq!v)PcW*Fj&20x1BZ!Znk7i;|Y=o!iPR}CMu zlohz2BsRSI(3Mf1!@(#E_>X`nuPP4$#Z3khgNR)aq93OS?**fkA%+p<21;M>1SN>{ z#`4m81e3QF|4J%?Nqxv{msOf;I7&-j%fZ;*^n}!elo;n}64Zr~GYDI27MRI%qLC7A zIU8?&5Vo3YQGGomu;0-ymY5RkJ3B4F#xIrmyFvDsmi+|#t@;Q;%ofALIEz048y0L$ zNnC(yK9g=lq&fUKY#h+#`&`lR%}|EKpEPD_#1FVIaR%hvY+`b2`mqL-yz3@uYUi@s zwe{agGWYb;#EBTrkndCTqKS=G4I%j~ zfhk915Ymg$e&Lb$N>puvC)(TWyKIj+O|vOL=k=9%7r7K8Kpq@D{9GO%6Iw!@#dbKX zKtPe|nDd4L@F^mQLd+B@PYIF5tj7az+?JMECY4l!ZCBOyJL-vZPi>$ZNlXE_=@lCk(IMWn>X3GH%MdI?7BB1i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thUR)B zGdNDFslsCQ`lvDZ@%}NX4p^2bAid7<&uoc|>XLv%Cy11-!S(z%;ie3{``UB5VN zTR9NN25OQ%qnPwKln*8NGY=;Qo4drA{avyC*v9s|Eo~) z;@sM&<`ahG;%0c_r+w^v`>=Oy>@=i-ckg#cP?H%B-2OcL1r`}<8O1>s>s31)%Lbco zU0xdCQFw!U;imjKk2yONK!$I@6h08l^}T4S0fBEi>^TRaD? zc=ds{>w1}2OG~v&|LfQ8&$3Ugl_Jd1aSw*^uNhu;(kt7Q)g{+E7qaq7fWCn8(q#L7 zKIe8BHQ73*=_Ox%K9~CDI|-3Lxp*-zZW#Ewh&Jh$cH#X;5fkq+gmWTGey?&#DD|VX zVnf)r*yEH2ovwZ);D|{iD)nV_8sojzGHk%H5>ug8C!Qw_++0FCn(ufVvhy_;-rXF% zk+%yf)D;+bS!`BgT5xh-A}V`{L3v7OJRzCYk&8%Tt3O|u?i=to_xr%K+U%ei?-wk* zk3t#8@`|WRlbg5HiVa{Hkg0r0!M7s5kU5<>wQ$0GTW-R$4*}oiDz-J!~&!<}P z?On`9bv{qjsAH9DHu>_FvS-UoWtDq1e0k5#vvuiDm1igU%2#4SfaL!JFkG&Y literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/Long/StrategyTester 4.htm b/Docs/Reports/XR/Long/StrategyTester 4.htm new file mode 100644 index 0000000..0d2ba8e --- /dev/null +++ b/Docs/Reports/XR/Long/StrategyTester 4.htm @@ -0,0 +1,85 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.01.29 23:45 (2020.01.01 - 2021.01.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.015; xRMaximumCandlesPerTrade=252; xRSwingLength=11; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test4192Ticks modelled3544155Modelling quality24.42%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit67.80Gross profit67.80Gross loss-0.00
    Profit factorExpected payoff13.56
    Absolute drawdown20.25Maximal drawdown26.20 (2.60%)Relative drawdown2.60% (26.20)
    Total trades5Short positions (won %)0 (0.00%)Long positions (won %)5 (100.00%)
    Profit trades (% of total)5 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade19.99loss trade-0.00
    Averageprofit trade13.56loss trade-0.00
    Maximumconsecutive wins (profit in money)5 (67.80)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)67.80 (5)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins5consecutive losses0
    +Graph
    + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 16:15buy10.011814.300.001836.06
    22020.12.01 19:15buy20.011813.970.001831.39
    32020.12.02 01:00buy30.011812.820.001818.34
    42020.12.02 08:30buy40.011814.560.001828.18
    52020.12.02 10:34t/p30.011818.340.001818.345.521005.52
    62020.12.02 12:22t/p40.011828.180.001828.1813.621019.14
    72020.12.02 12:39t/p20.011831.390.001831.3916.981036.12
    82020.12.02 16:15buy50.011819.680.001832.70
    92020.12.03 05:19t/p50.011832.700.001832.7011.691047.81
    102020.12.03 05:37t/p10.011836.060.001836.0619.991067.80
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 5.gif b/Docs/Reports/XR/Long/StrategyTester 5.gif new file mode 100644 index 0000000000000000000000000000000000000000..f2053e225af7c9b505a49b6fa6eaf128e653104e GIT binary patch literal 8130 zcmch1g;x{a`~N5%jYvs@(kUX~kQSuDq*Fl}De11!1CbaoIz~&3ZmErw8XGO$0@AQA z@6Ydl_}z2wIrluTxX*LzwVI053kz|A0l+!{fWzSc0Km}D5DtL?L5>jC)`+_h!Wsm@ z0`3M5hlPOdLI~?S=G_#4!=gceYQS9wq5mHbcLV|bF91Lx?m!S4`#&N8V2!ww-ibi~ zYij`Df0npA7-3xvYJ=d`tU-7FkUIzjx+7V)0RSivs10`q0IIS7GqtV;Sg+yk6p%Zx z`VP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+ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2021.03.30 23:45 (2020.01.01 - 2021.03.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.015; xRMaximumCandlesPerTrade=252; xRSwingLength=11; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test8040Ticks modelled9476561Modelling quality24.70%
    Mismatched charts errors0
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit63.48Gross profit123.48Gross loss-60.00
    Profit factor2.06Expected payoff4.53
    Absolute drawdown20.22Maximal drawdown67.32 (5.95%)Relative drawdown5.95% (67.32)
    Total trades14Short positions (won %)0 (0.00%)Long positions (won %)14 (71.43%)
    Profit trades (% of total)10 (71.43%)Loss trades (% of total)4 (28.57%)
    Largestprofit trade19.99loss trade-15.00
    Averageprofit trade12.35loss trade-15.00
    Maximumconsecutive wins (profit in money)10 (123.48)consecutive losses (loss in money)4 (-60.00)
    Maximalconsecutive profit (count of wins)123.48 (10)consecutive loss (count of losses)-60.00 (4)
    Averageconsecutive wins10consecutive losses4
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 16:15buy10.011814.290.001836.05
    22020.12.01 19:15buy20.011813.960.001831.38
    32020.12.02 01:00buy30.011812.810.001818.35
    42020.12.02 08:30buy40.011814.550.001828.17
    52020.12.02 10:34t/p30.011818.350.001818.355.541005.54
    62020.12.02 12:22t/p40.011828.170.001828.1713.621019.16
    72020.12.02 12:39t/p20.011831.380.001831.3816.981036.14
    82020.12.02 16:15buy50.011819.670.001832.69
    92020.12.03 05:19t/p50.011832.690.001832.6911.691047.83
    102020.12.03 05:37t/p10.011836.050.001836.0519.991067.82
    112021.02.05 22:30buy60.011812.580.001817.60
    122021.02.08 01:07t/p60.011817.600.001817.604.581072.40
    132021.02.08 01:15buy70.011817.820.001833.66
    142021.02.08 05:15buy80.011811.700.001817.36
    152021.02.08 09:21buy90.011816.730.001827.67
    162021.02.08 09:30t/p80.011817.360.001817.365.661078.06
    172021.02.08 13:22buy100.011817.990.001836.63
    182021.02.08 15:37t/p90.011827.670.001827.6710.941089.00
    192021.02.08 16:09t/p70.011833.660.001833.6615.841104.84
    202021.02.08 17:24t/p100.011836.630.001836.6318.641123.48
    212021.02.23 02:00buy110.011810.780.001816.74
    222021.02.23 04:00buy120.011813.560.001827.54
    232021.02.23 08:00buy130.011813.000.001818.80
    242021.02.23 16:38close120.011798.560.001827.54-15.001108.48
    252021.02.23 16:38close130.011798.000.001818.80-15.001093.48
    262021.02.23 16:48close110.011795.780.001816.74-15.001078.48
    272021.02.24 04:19buy140.011811.640.001823.28
    282021.02.24 15:47close140.011796.640.001823.28-15.001063.48
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 6.gif b/Docs/Reports/XR/Long/StrategyTester 6.gif new file mode 100644 index 0000000000000000000000000000000000000000..ca3bdd778f57c61152da0a37afb059f0b3c16e93 GIT binary patch literal 6488 zcmaKn^l zd-#0+fam;hUe~$q>wUfM^FdKwMAYofg8{%a0D#3}0RR9JiNw}hfuQsCR#x@*&b`87 z=b@ncN4?d3=3WB+cirp%asaFP`{DfyfWRsg{Ke^C$s0IILIx^Dzn zLF?}wD5!q^UerUapdcvp-uwRQCkmCiVya9i6=+B!RoyLx+!`UZX(4kCvQP-CO|<5QD*)3Y5dUl#hi zSC-d?RyWp1Hg~osb}{?E4~~z}fBr2wp2uEY-`sl5=>iNW^@3Sx12rkY>h!^EG@)t% zn}&jvg8*DTVtVQCe+K*>5C*vfy%A8v1BLe^&x0I==7S98* z_@ZGp$^u$N<9SwGg@3kIx}HPj++_SI*q-|pCOo%M{HSR$!}jon!#_|cHyvD7FAkRL z8a`a1*4U5XqD4^GC^LPO22XCx#A!u*th2M=U+#f4aLD!4$_xPC&D3M|I;$RK3KG~H z*yw_{1u|A2+g>v$8jj+D4THEfYd6@rv^z$g&VwCea$oz_QB0p=dOHKf^t}q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7MKnavEKhe)LbjGay&W0w;tcV&p{6Y#WwS_1VTD zU&8E4mBzv`m|bWUim&8PSr2#hmui8qoX=JPq$h-j@kF?NC*M~9Y&qb6EuQWwoaMLW|_w4R7#P%t!I|HzwOlOc?-jfD?Og$U-^jEr<5pG&oC#y_~C~aos z^ApQw`2de@My!ZMX1_DoR6v3=gxtFfwQPKUu)6%O30%#}8d; zPRZNPg!L36aF+Lnq=AQqJ7R(hniNuaL`Ke%k}Nz(DS4KKidX`i$e6BfuGY_8075tZ zI4YuSes3vBEr$Tmb)~`UZh5T@{u+ks($Q)LDP>A28pqzFzJHP8RD;hGjp7Dhz`Ur2 zI0`c2hPV)|RKq-V3vt7IZ8ua%{ywI7qyS2s8uez{C>|xe=tVsuvY8P-0y=1=9u+@b hh#!@_y`dhH1~Mm%$&gCWjK8NfP8gTpe25DW`#*UOJU0LU literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/Long/StrategyTester 6.htm b/Docs/Reports/XR/Long/StrategyTester 6.htm new file mode 100644 index 0000000..e7f7192 --- /dev/null +++ b/Docs/Reports/XR/Long/StrategyTester 6.htm @@ -0,0 +1,89 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2022.01.03 01:00 - 2023.08.04 23:45 (2022.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.015; xRMaximumCandlesPerTrade=252; xRSwingLength=7; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test38648Ticks modelled45067506Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit30.68Gross profit30.68Gross loss-0.00
    Profit factorExpected payoff4.38
    Absolute drawdown1.72Maximal drawdown11.16 (1.10%)Relative drawdown1.10% (11.16)
    Total trades7Short positions (won %)0 (0.00%)Long positions (won %)7 (100.00%)
    Profit trades (% of total)7 (100.00%)Loss trades (% of total)0 (0.00%)
    Largestprofit trade14.90loss trade-0.00
    Averageprofit trade4.38loss trade-0.00
    Maximumconsecutive wins (profit in money)7 (30.68)consecutive losses (loss in money)0 (-0.00)
    Maximalconsecutive profit (count of wins)30.68 (7)consecutive loss (count of losses)-0.00 (0)
    Averageconsecutive wins7consecutive losses0
    +Graph
    + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12022.01.11 02:39buy10.011803.570.001808.31
    22022.01.11 07:54t/p10.011808.310.001808.314.741004.74
    32022.01.11 16:48buy20.011803.580.001805.67
    42022.01.11 16:52t/p20.011805.670.001805.672.091006.83
    52022.02.01 10:19buy30.011803.580.001806.07
    62022.02.01 11:09t/p30.011806.070.001806.072.491009.32
    72022.02.01 16:03buy40.011803.580.001805.05
    82022.02.01 16:09t/p40.011805.050.001805.051.471010.79
    92022.02.02 14:02buy50.011803.480.001805.27
    102022.02.02 15:21t/p50.011805.270.001805.271.791012.58
    112022.12.20 11:15buy60.011803.390.001818.29
    122022.12.20 17:10t/p60.011818.290.001818.2914.901027.48
    132022.12.27 02:30buy70.011802.870.001806.07
    142022.12.27 04:45t/p70.011806.070.001806.073.201030.68
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 7.gif b/Docs/Reports/XR/Long/StrategyTester 7.gif new file mode 100644 index 0000000000000000000000000000000000000000..9e04b0ac63150042e5cff8a639eca261add7f046 GIT binary patch literal 8765 zcmc(@^;a9t^F17-5C~AL5TLj_El^xaX`y)ASBpz2rMMP%Par^WcMDJ;cyKDXdmuQ) zy}0Jf`}6z}&z{{mbMD-^GrRlCo>h7KMpEjt7+x=60|3Bcu>b&IaBvXYFdz;8*I;Sc z@BlSfO2aXLhlRyr;L;CJgXIJB!3AJ3XlVcv@Gzy({~r(g4=(+G0AQfuAt;T;{2vhj zuxxlpeMo+Q8Z430ZE)@K6RW-GF&;9!%RqCj0>$07wr!upa8bA4m^- z`dgAlSuRP+H+RfVL7`Vb-EwSRTb0Y z>)f0i6x5P29dZ77@@}Oaa`Rquok9tph>{D&X>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+ + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.04 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.015; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=650; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63629Ticks modelled72967510Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit125.81Gross profit290.45Gross loss-164.65
    Profit factor1.76Expected payoff3.70
    Absolute drawdown11.93Maximal drawdown74.32 (6.57%)Relative drawdown6.57% (74.32)
    Total trades34Short positions (won %)0 (0.00%)Long positions (won %)34 (44.12%)
    Profit trades (% of total)15 (44.12%)Loss trades (% of total)19 (55.88%)
    Largestprofit trade53.92loss trade-11.77
    Averageprofit trade19.36loss trade-8.67
    Maximumconsecutive wins (profit in money)6 (82.82)consecutive losses (loss in money)6 (-46.65)
    Maximalconsecutive profit (count of wins)105.06 (5)consecutive loss (count of losses)-46.65 (6)
    Averageconsecutive wins4consecutive losses5
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 19:30buy10.011812.670.001867.81
    22020.12.02 02:30buy20.011813.300.001832.88
    32020.12.02 08:45buy30.011813.220.001823.98
    42020.12.02 10:39t/p30.011823.980.001823.9810.761010.76
    52020.12.03 05:19t/p20.011832.880.001832.8818.251029.01
    62020.12.07 18:09t/p10.011867.810.001867.8152.491081.50
    72021.02.08 07:30buy40.011816.010.001829.61
    82021.02.08 11:45buy50.011813.190.001823.15
    92021.02.08 14:46t/p50.011823.150.001823.159.961091.46
    102021.02.08 15:49t/p40.011829.610.001829.6113.601105.06
    112021.02.23 04:00buy60.011813.660.001852.52
    122021.02.23 05:45buy70.011813.350.001832.65
    132021.02.23 12:03close60.011803.660.001852.52-10.001095.06
    142021.02.23 16:34close70.011803.350.001832.65-10.001085.06
    152021.05.06 18:00buy80.011815.960.001871.34
    162021.05.12 23:21close80.011815.950.001871.34-1.781083.28
    172021.07.08 14:00buy90.011817.800.001859.98
    182021.07.08 16:54close90.011807.800.001859.98-10.001073.28
    192021.07.13 15:30buy100.011813.610.001828.27
    202021.07.13 15:33close100.011803.610.001828.27-10.001063.28
    212021.07.13 18:15buy110.011812.880.001840.56
    222021.07.14 06:30buy120.011813.470.001830.43
    232021.07.14 08:33buy130.011814.130.001831.85
    242021.07.14 10:45buy140.011813.970.001831.93
    252021.07.15 09:06t/p120.011830.430.001830.4315.631078.91
    262021.07.15 09:09t/p130.011831.850.001831.8516.391095.31
    272021.07.15 09:09t/p140.011831.930.001831.9316.631111.94
    282021.07.16 17:52close110.011812.870.001840.56-2.221109.72
    292021.07.29 04:30buy150.011816.220.001862.70
    302021.08.02 15:16close150.011806.220.001862.70-10.881098.83
    312021.08.27 19:15buy160.011814.970.001876.01
    322021.08.31 04:30buy170.011814.070.001825.81
    332021.08.31 14:15buy180.011814.320.001822.58
    342021.08.31 16:07close160.011804.970.001876.01-10.881087.95
    352021.08.31 16:09close180.011804.320.001822.58-10.001077.95
    362021.08.31 16:09close170.011804.070.001825.81-10.001067.95
    372021.09.01 06:00buy190.011814.440.001834.00
    382021.09.07 11:09close190.011814.430.001834.00-2.661065.28
    392021.11.05 18:45buy200.011814.420.001872.32
    402021.11.16 10:54t/p200.011872.320.001872.3253.921119.20
    412021.12.27 18:00buy210.011813.070.001832.57
    422021.12.28 08:00buy220.011813.290.001825.67
    432021.12.28 17:00buy230.011814.240.001823.84
    442021.12.29 02:08close230.011804.240.001823.84-10.441108.76
    452021.12.29 10:07close220.011803.290.001825.67-10.441098.32
    462021.12.29 10:09close210.011803.070.001832.57-10.881087.43
    472022.01.11 18:30buy240.011815.760.001842.90
    482022.01.14 19:18close240.011815.750.001842.90-2.221085.21
    492022.02.04 15:30buy250.011813.380.001827.74
    502022.02.04 15:37close250.011803.380.001827.74-10.001075.21
    512022.02.07 02:49buy260.011813.160.001853.86
    522022.02.07 11:00buy270.011813.460.001826.20
    532022.02.07 14:00buy280.011814.020.001823.68
    542022.02.07 16:15buy290.011816.190.001830.15
    552022.02.08 15:54t/p280.011823.680.001823.689.221084.43
    562022.02.08 17:22t/p270.011826.200.001826.2012.301096.73
    572022.02.09 15:06t/p290.011830.150.001830.1513.081109.80
    582022.02.11 20:49t/p260.011853.860.001853.8638.051147.85
    592022.12.20 17:22buy300.011818.080.001879.60
    602022.12.21 09:31buy310.011815.890.001822.27
    612022.12.21 14:00buy320.011814.150.001817.95
    622022.12.21 15:20t/p320.011817.950.001817.953.801151.65
    632022.12.21 17:36t/p310.011822.270.001822.276.381158.03
    642022.12.22 15:53close300.011808.080.001879.60-11.771146.26
    652022.12.27 20:15buy330.011815.080.001839.84
    662022.12.28 03:30buy340.011814.740.001838.82
    672022.12.28 10:15close330.011805.080.001839.84-10.441135.82
    682022.12.28 10:15close340.011804.730.001838.82-10.011125.81
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 8.gif b/Docs/Reports/XR/Long/StrategyTester 8.gif new file mode 100644 index 0000000000000000000000000000000000000000..de9b6fbcfd723a3d36b93b68473f01c0b48885bd GIT binary patch literal 7827 zcmc(Cg;x~L_x6GaOD!QNAxKEK^dbTVA|WB&Ag**O-An8)wbI?4OLyn8G>9}P-6);= zL6g`Jm7v{vGYjqJyZv|XWp9t?EDNEfCAii@XY_?VgDh){{sM+x_c*hX8wOf002^V zA9^2r57j|X;8rAd9Rj}BL_+Eyt@qLZ00s*^aCo0?l%+uA!i zySjUN`}zmagP5V=k6TNWr)ei~Rjsg_QZ#5Y>-AZX4wYD6?XDd4!2 zM1`MQGLC4#55#e9xgk!3R^5&@52t)gSm=)Iy|-O$~whsJVHwLa5jrm%3z`xKEsX7x%jKxcFe@w7EYjkumg3WdoD%GEMEJUFEbs?~g4sAcC~`ew{%~Cw zAt%WTV-Kp9j#+%V4uEXb^B$%L_`+jqP^QO2x;a>;-QTdJ2V$Azx&Uz+6aXZ-g0hGK zD0@IbKsD4G0O1k&1_+wBo(Gapv+_@<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AKiZo zzJi{EH`Yi;bBUxu9&6F6A3fINO(H!uk{w1oHq-q;o?F>bA3eA8Ga@~AiYrDucgx#B zUVEiVT|kyWUSHs^+anUdVcR_6O>SoaxA)(kXU`=58PjKYA7gk%4~|AuyGQ^H&#EJT z&pC|xoX@GL1q+5%#I&AoWJKNnD5iXsI@8}ANo-{d93-1|VE#2h+Vjyb%r_3M@cUf#+S1|hx^R1~w5ApO7{jOjL z_t{y8j)YKv7A%n5pc99DCfl>3knxF8K)paVE&{-`$~|P+O7L_QE(OSvnocBo0U7tV zd)dFNA0XeCRvFoA8A9`EoE%?-BC;50!AM-xr=aXa9l-mUx&o*mI`Wq~f~x14I)#G3 zfnYQVaFzX&S@@e`b41*Y{OMpQ+H^oQF1DtV`V|1JrR@BeO5ru{XNeyV$)l;^tY+M` zbrRZmlL1{8d8gro3R)voi7Yo3FPgP62JyIV!&q51Jk@QC=8QukGcUmlW?;CE;v|)x z0fdK+Mn%VBAJDjvC#F7z(dLaz2^L|eZ2tY$COI%&cTZMK$Bcxa!`UxF)|8jOv7eA~ z%5~@jLZvFC{7pm?id`spK@1*IUjb3rdvCl*wHkM^MP=v7zJK*WkqG|p5jEu(JjGA? zFn>@i^;Th;+?Nj|(&m-q?{ck}0T&Z$4O3aSyqRx1161UFtHYRr3*Yc_5(m8+kFRw6 zgB$2cR20pU$V0jPhGkxIomVjwC{o`?rKbXh3_%$Fem3?lkQM*S4?(zD6Pc#xu~?PEYtYfveB4ar^Uk!@2AOgu3~1mBz8>&e`WMO4 z`e160eI{j5h%TswLT`m@f>`G7l3N?eh5ge@%&Q*mAZAeIp*cb7l2%Q9nyYBrj4=SVlY;$A*0IB~2`2pe8 literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/Long/StrategyTester 8.htm b/Docs/Reports/XR/Long/StrategyTester 8.htm new file mode 100644 index 0000000..1daf914 --- /dev/null +++ b/Docs/Reports/XR/Long/StrategyTester 8.htm @@ -0,0 +1,97 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.04 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.0001; xRShortMaxDrawdownPerTradePercent=0.15; xRLongR2R=2; xRLongLotsPerTradePercent=0.0001; xRLongMaxDrawdownPerTradePercent=0.1; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63629Ticks modelled72967510Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit1586.83Gross profit2026.73Gross loss-439.91
    Profit factor4.61Expected payoff144.26
    Absolute drawdown96.42Maximal drawdown616.71 (32.38%)Relative drawdown32.38% (616.71)
    Total trades11Short positions (won %)0 (0.00%)Long positions (won %)11 (54.55%)
    Profit trades (% of total)6 (54.55%)Loss trades (% of total)5 (45.45%)
    Largestprofit trade538.99loss trade-108.85
    Averageprofit trade337.79loss trade-87.98
    Maximumconsecutive wins (profit in money)2 (1072.41)consecutive losses (loss in money)3 (-317.69)
    Maximalconsecutive profit (count of wins)1072.41 (2)consecutive loss (count of losses)-317.69 (3)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 19:30buy10.101812.670.001867.81
    22020.12.02 10:36buy20.101821.850.001841.33
    32020.12.03 09:52t/p20.101841.330.001841.33181.531181.53
    42020.12.07 18:09t/p10.101867.810.001867.81524.861706.39
    52021.02.23 04:07buy30.101813.000.001850.54
    62021.02.23 16:34close30.101803.000.001850.54-100.001606.39
    72021.07.29 04:30buy40.101816.220.001862.70
    82021.07.29 09:52buy50.101818.920.001868.58
    92021.08.02 04:39close50.101808.920.001868.58-108.851497.55
    102021.08.02 15:16close40.101806.220.001862.70-108.851388.70
    112021.11.05 18:45buy60.101814.410.001872.29
    122021.11.08 03:07buy70.101819.710.001876.59
    132021.11.16 10:54t/p60.101872.290.001872.29538.991927.69
    142021.11.16 15:18t/p70.101876.590.001876.59533.422461.11
    152022.02.04 15:30buy80.101813.380.001827.74
    162022.02.04 15:37close80.101803.380.001827.74-100.002361.11
    172022.02.07 11:01buy90.101813.370.001825.93
    182022.02.07 16:19buy100.101815.990.001829.55
    192022.02.07 20:25buy110.101821.630.001843.73
    202022.02.08 17:22t/p90.101825.930.001825.93121.182482.29
    212022.02.09 15:04t/p100.101829.550.001829.55126.752609.04
    222022.02.10 15:33close110.101821.620.001843.73-22.222586.83
    +
    diff --git a/Docs/Reports/XR/Long/StrategyTester 9.gif b/Docs/Reports/XR/Long/StrategyTester 9.gif new file mode 100644 index 0000000000000000000000000000000000000000..13f7a09c0d00560c3ba60cbdb17cb6646f996064 GIT binary patch literal 8847 zcmc(Dg;!MX_w@jRGc<@uDjkxF)R2P8&>>0+64D@&Lk~Rz%rJD9ba#hb`>x<^j_gNUfn8=M}%CIEoJU;qHXz`y{erXP&{TVrNc z^8nSDfzk7ThX;e1M}r@r8nXxHLkPgk&wv4CfQK7A^Z$65zi9CP06>4uLlQhQ|34xC zU{>=``cV7;)tHrmo6(pJGw_2Z+N{Q``9T^0=m&$FF%Kx9Z2o^LW@P}g4a@@_-Tctu zA^G44g9d{iw7~zZ;F<@20Koi%8#8pxLmM=>X8s{~SehRy(GOrh0Nnq;dgz0GAU*8q zKNAo6|B#ybdG!3uLuB@l1C*J80S{^qhUUQl@WZD6zg*l8Zy)gASpXhmU;sb=fWV+& zI3gr842cRyM?^+N$Hd0PCnP2%r=+H(XZ*~}%FfBn%P%M_DlRE4E3c@ms;;T6t8Zv* zYHs<}+SdNNqqD2Kr?;5aJ1hcBAM#o2PD1`DDwMvL;_5Hm3Y`4cHqabZ}0;0NZ&lBVmS z&ODl6DlX%)^uE{`U8-00WQdWF83zva`$*fy$7*racP@1WSLdLEoMDSv{YSU2$QP{6 za3K(VJj%$gECj}5Uzv_)pT&XjH|632r@p}nU2-jir$8JcY;W=Lv{{)DIC=a(vAD`e zbqILFwBaBQ!q*0F6iuzOcr>j5>2Q_~1{^$r5jB4X$^q?648z_kJOM{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su%M+i;dsZrW$D$fc zGx3JaIaUt2tC4#>QD7%nXh_8Mp1T!9qUMO5mHzIPquX@Tp)*rflcd0&?sN-pP5B*{!zi5{dT56}ez8qp)3-y+w^J=lPY`@D>HQ8u?hBiGj0Kpx_ zp5hG)cdii~hnhbeq|0TOmeR4j^ui*O5434CV^3bo_(#2(TSM-`iKac^QHOLTH;cuo zHcWIY;;U%?#}mg(3F+BrAQ+%;aMtE#yIJ|QK8BVTlzB==&b?gU!Zm7xmzBJ&{i0#C zQN=0CznOwR?)_APN@$VX@osbvcxYA7fU$zb^|w! zL27aDrh9BQb)0NZEBN)cXT1QO0+>|tFU%6V?4{SkKE?lL)ZBKM$vhKWS1!Q0PWzT* zmQM5Sr}D!tJS~Hs>)rfU=yZn13ZxFJIMNie)AwU?j9#N22V<|@~pb_alqgt>#_U|Vbz-wXqf6wqUrR~b4y^FSN0W-$; zxvr>SA7rafOe^fKmNmPum;Ga>qmKkHYXS5S5Mv#XfyM1lu8*&l3~wF~X8th$l)C74 zd*$R2RqH~r?UTzM@b}yo$?yM`!*PY(mIVTm7m;PlgFyoP6!UCf_V|SX0@Z{F$ejXE z3~%+ciS^>}4LLwxDQ$<%&j>6y>@=XRs^#jHw+on6)D)O4vr{ z((e^TFxW!YQ5#AF2|_^Z&EkQ^m%))`fsZT#14$8h@xg&mpuC7{7##HJYcL96hN=Uq zumx?v>{sQS6Q%M0YzA271_@t;lpp(7wEmbD#&4Wg?kF!=zaRS=-J4w*!17Y+1V*ha1aQKM9#**wq? z2dE8#Tn6ILS)f9?k= + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.04 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=false; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.0001; xRShortMaxDrawdownPerTradePercent=0.15; xRLongR2R=2; xRLongLotsPerTradePercent=0.0001; xRLongMaxDrawdownPerTradePercent=0.1; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63629Ticks modelled72967510Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit868.35Gross profit2155.53Gross loss-1287.18
    Profit factor1.67Expected payoff36.18
    Absolute drawdown96.42Maximal drawdown851.58 (44.06%)Relative drawdown44.06% (851.58)
    Total trades24Short positions (won %)0 (0.00%)Long positions (won %)24 (37.50%)
    Profit trades (% of total)9 (37.50%)Loss trades (% of total)15 (62.50%)
    Largestprofit trade539.19loss trade-117.69
    Averageprofit trade239.50loss trade-85.81
    Maximumconsecutive wins (profit in money)3 (842.39)consecutive losses (loss in money)5 (-489.58)
    Maximalconsecutive profit (count of wins)842.39 (3)consecutive loss (count of losses)-489.58 (5)
    Averageconsecutive wins2consecutive losses4
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.01 19:30buy10.101812.670.001867.81
    22020.12.02 10:36buy20.101821.850.001841.33
    32020.12.03 09:52t/p20.101841.330.001841.33181.531181.53
    42020.12.07 18:09t/p10.101867.810.001867.81524.861706.39
    52021.02.08 07:30buy30.101815.770.001829.37
    62021.02.08 15:49t/p30.101829.370.001829.37136.001842.39
    72021.02.23 04:00buy40.101813.660.001852.52
    82021.02.23 08:07buy50.101813.980.001826.90
    92021.02.23 11:54close50.101803.980.001826.90-100.001742.39
    102021.02.23 12:03close40.101803.660.001852.52-100.001642.39
    112021.05.06 18:04buy60.101815.740.001870.68
    122021.05.12 23:21close60.101815.730.001870.68-17.791624.60
    132021.07.13 15:30buy70.101813.610.001828.27
    142021.07.13 15:33close70.101803.610.001828.27-100.001524.60
    152021.07.14 10:45buy80.101813.970.001831.93
    162021.07.14 13:37buy90.101817.470.001838.05
    172021.07.15 09:09t/p80.101831.930.001831.93166.331690.93
    182021.07.19 07:30close90.101813.820.001838.05-58.621632.32
    192021.07.29 04:30buy100.101816.220.001862.70
    202021.07.29 09:51buy110.101818.660.001868.32
    212021.08.02 04:39close110.101808.660.001868.32-108.851523.47
    222021.08.02 15:16close100.101806.220.001862.70-108.851414.62
    232021.08.27 19:21buy120.101814.650.001875.05
    242021.08.27 22:54buy130.101819.260.001887.44
    252021.08.30 18:39close130.101809.260.001887.44-104.421310.20
    262021.08.31 16:09close120.101804.650.001875.05-108.851201.36
    272021.11.05 18:45buy140.101814.420.001872.32
    282021.11.08 07:54buy150.101821.600.001845.16
    292021.11.10 15:39t/p150.101845.160.001845.16226.751428.11
    302021.11.16 10:54t/p140.101872.320.001872.32539.191967.30
    312022.01.11 18:43buy160.101816.350.001843.49
    322022.01.14 19:15close160.101816.340.001843.49-22.221945.09
    332022.02.04 15:30buy170.101813.380.001827.74
    342022.02.04 15:37close170.101803.380.001827.74-100.001845.09
    352022.02.07 11:00buy180.101813.460.001826.20
    362022.02.07 14:00buy190.101814.020.001823.68
    372022.02.07 21:36buy200.101823.260.001848.06
    382022.02.08 15:54t/p190.101823.680.001823.6892.181937.26
    392022.02.08 17:22t/p180.101826.200.001826.20122.982060.24
    402022.02.10 15:31close200.101823.250.001848.06-22.222038.03
    412022.12.20 17:22buy210.101818.080.001879.60
    422022.12.21 10:00buy220.101816.930.001825.99
    432022.12.22 15:53close210.101808.080.001879.60-117.691920.33
    442022.12.22 15:58close220.101806.930.001825.99-113.271807.07
    452022.12.27 20:15buy230.101815.080.001839.84
    462022.12.28 10:15close230.101805.080.001839.84-104.421702.64
    472022.12.28 10:15buy240.101805.660.001824.00
    482022.12.30 16:07t/p240.101824.000.001824.00165.711868.35
    +
    diff --git a/Docs/Reports/XR/Short/StrategyTester 1.gif b/Docs/Reports/XR/Short/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..848a4a0f71e145677d4343e71108f31e91d6c459 GIT binary patch literal 9417 zcmch5^8g#g_A3L0SKf8cZUMX=l`c-RSvLP$KBDvx~eFqKzAOm--yFTbU(%nq| znYhdUht$r`qvvPtBCER`pxg=qxKq0`bT_Hh-QjNCjsE}n61aQ&fd9S);6BbD5C{(n z4hcmdQDNZ`kx}UA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7q_GlElYY|85FDp-C?g1K|D)wBOvH`je*cCldB8UrTFZ_IgbQ26*%)9e(PfZAg84NhSdZ!E+CK#bAuh>%dGz z8Y}d3Z%76MGSeTGV1rB>LCq=zCvVZrw?RWCkzebf92hY9D#e&{NE;OJ!UcI6>i^t^ zq~s0iBQU%*pM*RBF?d7~)f4{i2#<(@bc!K36CE)v8U9=+JeeW_?jIh82?HqLsg*~h zv4#xspkjE)w$DSG@=5;8MC|sWcFrS+DIycgqvU@_792&bVk5hcpm<5(!s_t2m9W|^ zJhHxswk`D8IgaKHG%Uz`EKKvRZ6ZLs=wQ=ld9rFmZH7Z?ikd}Y?`W+|11S1QVlde>os-}Id~EI36oycrnCo2S4C#v z%^?R_eNSK@s!ti8w^5ZdQQ<3LgMG1LQq&q-85j4-_U;GCSkNRi#6#MtB@N)x0RSP+ z^eFRh2lwOYnF3fZGh;`xo(E(JFwrm-reCXNC5mLRt7kt^|0c-eP6!K;AN3>eq#jYr z@srGc&znQXl%gYo%xb1RmZy7VLeb-SRvM{AM3M&^#kVz@a4nR^M$B^0O|h&K2*w^ literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/Short/StrategyTester 1.htm b/Docs/Reports/XR/Short/StrategyTester 1.htm new file mode 100644 index 0000000..e95644f --- /dev/null +++ b/Docs/Reports/XR/Short/StrategyTester 1.htm @@ -0,0 +1,283 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.04 23:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=false; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63629Ticks modelled72967534Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit138.50Gross profit694.79Gross loss-556.29
    Profit factor1.25Expected payoff1.33
    Absolute drawdown75.42Maximal drawdown148.46 (13.84%)Relative drawdown13.84% (148.46)
    Total trades104Short positions (won %)104 (44.23%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)46 (44.23%)Loss trades (% of total)58 (55.77%)
    Largestprofit trade50.75loss trade-11.05
    Averageprofit trade15.10loss trade-9.59
    Maximumconsecutive wins (profit in money)10 (194.09)consecutive losses (loss in money)11 (-108.64)
    Maximalconsecutive profit (count of wins)194.09 (10)consecutive loss (count of losses)-108.64 (11)
    Averageconsecutive wins4consecutive losses5
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 06:45sell10.011807.850.001793.49
    22020.11.27 12:30sell20.011808.700.001798.70
    32020.11.27 15:07t/p20.011798.700.001798.7010.001010.00
    42020.11.27 15:09t/p10.011793.490.001793.4914.361024.36
    52020.12.01 17:30sell30.011806.320.001788.90
    62020.12.01 20:15close30.011816.330.001788.90-10.011014.35
    72020.12.02 05:15sell40.011809.570.001794.49
    82020.12.02 10:34close40.011819.570.001794.49-10.001004.35
    92021.02.04 16:00sell50.011808.190.001770.49
    102021.02.05 21:00sell60.011810.160.001800.30
    112021.02.05 23:00sell70.011810.890.001802.49
    122021.02.08 01:09close50.011818.190.001770.49-9.59994.76
    132021.02.08 04:45sell80.011810.250.001793.39
    142021.02.08 11:00sell90.011809.020.001789.70
    152021.02.08 13:31close90.011819.020.001789.70-10.00984.76
    162021.02.08 13:34close60.011820.170.001800.30-9.80974.96
    172021.02.08 13:34close80.011820.250.001793.39-10.00964.96
    182021.02.08 13:36close70.011820.890.001802.49-9.79955.16
    192021.02.16 15:15sell100.011811.040.001780.54
    202021.02.16 18:30sell110.011803.470.001759.29
    212021.02.17 15:24t/p100.011780.540.001780.5430.71985.87
    222021.02.22 16:37close110.011803.480.001759.291.23987.10
    232021.02.22 19:30sell120.011809.990.001805.03
    242021.02.23 09:45sell130.011809.820.001797.80
    252021.02.23 11:54t/p120.011805.030.001805.035.17992.26
    262021.02.23 14:45sell140.011810.320.001799.30
    272021.02.23 16:37t/p140.011799.300.001799.3011.021003.28
    282021.02.23 16:45t/p130.011797.800.001797.8012.021015.30
    292021.02.24 05:00sell150.011810.060.001802.60
    302021.02.24 15:21t/p150.011802.600.001802.607.461022.76
    312021.05.13 13:15sell160.011810.390.001785.51
    322021.05.13 15:39close160.011820.390.001785.51-10.001012.76
    332021.06.17 10:30sell170.011809.210.001747.49
    342021.07.06 10:54close170.011809.220.001747.493.491016.26
    352021.07.06 16:15sell180.011806.750.001790.71
    362021.07.06 19:24t/p180.011790.710.001790.7116.041032.30
    372021.07.08 17:00sell190.011808.270.001788.55
    382021.07.09 21:45sell200.011811.020.001808.80
    392021.07.09 22:54t/p200.011808.800.001808.802.221034.52
    402021.07.13 06:15sell210.011811.020.001808.06
    412021.07.13 08:37t/p210.011808.060.001808.062.961037.48
    422021.07.13 10:15sell220.011811.280.001808.84
    432021.07.13 11:00close190.011810.250.001788.55-1.361036.12
    442021.07.13 11:06t/p220.011808.840.001808.842.441038.56
    452021.07.13 16:15sell230.011809.710.001795.17
    462021.07.13 20:15sell240.011808.830.001792.53
    472021.07.14 15:04close240.011818.830.001792.53-9.791028.76
    482021.07.14 15:04close230.011819.710.001795.17-9.791018.97
    492021.07.16 22:30sell250.011810.350.001778.15
    502021.07.19 09:15sell260.011806.190.001784.27
    512021.07.19 18:15sell270.011807.210.001790.91
    522021.07.19 23:30sell280.011811.470.001803.69
    532021.07.20 04:09close260.011816.190.001784.27-9.791009.17
    542021.07.20 04:31close270.011817.210.001790.91-9.79999.38
    552021.07.20 15:36close250.011820.350.001778.15-9.59989.79
    562021.07.20 15:37close280.011821.470.001803.69-9.79980.00
    572021.07.20 18:15sell290.011810.140.001780.96
    582021.07.20 20:30sell300.011810.840.001783.06
    592021.07.21 10:30sell310.011808.770.001799.15
    602021.07.21 15:09t/p310.011799.150.001799.159.62989.62
    612021.07.26 10:22close290.011810.150.001780.961.23990.84
    622021.07.26 10:24close300.011810.850.001783.061.23992.07
    632021.07.30 21:45sell320.011810.450.001768.95
    642021.08.02 04:45sell330.011809.440.001774.22
    652021.08.02 06:30sell340.011811.380.001786.42
    662021.08.02 09:15sell350.011810.310.001797.51
    672021.08.02 20:09close330.011819.440.001774.22-10.00982.07
    682021.08.03 04:30sell360.011809.740.001790.54
    692021.08.04 15:06close360.011819.740.001790.54-9.79972.28
    702021.08.04 15:07close350.011820.310.001797.51-9.59962.69
    712021.08.04 15:07close320.011820.450.001768.95-9.38953.31
    722021.08.04 15:09close340.011821.380.001786.42-9.59943.72
    732021.08.04 18:30sell370.011806.630.001756.91
    742021.08.04 21:45sell380.011810.860.001769.60
    752021.08.05 01:00sell390.011811.890.001772.69
    762021.08.05 03:15sell400.011810.920.001769.78
    772021.08.06 16:07t/p390.011772.690.001772.6939.41983.13
    782021.08.06 16:39t/p400.011769.780.001769.7841.351024.47
    792021.08.06 16:39t/p380.011769.600.001769.6042.081066.56
    802021.08.09 01:22t/p370.011756.910.001756.9150.751117.31
    812021.08.30 18:30sell410.011811.210.001797.55
    822021.08.31 16:15sell420.011803.320.001771.96
    832021.08.31 16:37close420.011813.320.001771.96-10.001107.31
    842021.08.31 18:15sell430.011805.950.001779.85
    852021.08.31 20:09close430.011815.950.001779.85-10.001097.31
    862021.09.01 11:15sell440.011809.570.001794.93
    872021.09.01 15:52close440.011819.570.001794.93-10.001087.31
    882021.09.01 18:15sell450.011810.930.001793.05
    892021.09.02 07:30sell460.011811.430.001801.71
    902021.09.02 12:30close410.011815.680.001797.55-3.441083.87
    912021.09.02 17:30sell470.011807.760.001789.30
    922021.09.03 04:45sell480.011811.190.001806.13
    932021.09.03 15:18close470.011817.760.001789.30-9.791074.07
    942021.09.03 15:34close450.011820.930.001793.05-9.181064.90
    952021.09.03 15:34close480.011821.190.001806.13-10.001054.90
    962021.09.03 15:34close460.011821.430.001801.71-9.791045.10
    972021.09.07 13:15sell490.011810.900.001778.58
    982021.09.07 16:15sell500.011810.490.001777.53
    992021.09.16 12:54t/p490.011778.580.001778.5834.591079.69
    1002021.09.16 13:00t/p500.011777.530.001777.5335.231114.92
    1012021.10.22 18:30sell510.011800.480.001774.18
    1022021.10.28 05:24close510.011800.490.001774.181.231116.14
    1032021.11.22 19:45sell520.011810.200.001736.88
    1042021.11.23 04:15sell530.011807.780.001740.54
    1052021.11.26 09:54close530.011807.790.001740.541.021117.17
    1062021.11.26 12:03close520.011810.210.001736.881.231118.39
    1072021.11.26 14:30sell540.011809.150.001796.79
    1082021.11.26 16:54t/p540.011796.790.001796.7912.361130.75
    1092021.12.17 16:00sell550.011806.620.001791.74
    1102021.12.20 21:49t/p550.011791.740.001791.7415.091145.84
    1112021.12.27 19:15sell560.011809.010.001800.49
    1122021.12.27 23:30sell570.011811.240.001807.18
    1132021.12.28 02:30sell580.011811.150.001806.91
    1142021.12.28 15:24close560.011819.010.001800.49-9.791136.04
    1152021.12.28 18:15sell590.011809.840.001789.48
    1162021.12.28 20:00sell600.011810.260.001790.74
    1172021.12.28 20:51t/p570.011807.180.001807.184.271140.31
    1182021.12.28 20:51t/p580.011806.910.001806.914.241144.55
    1192021.12.29 15:09t/p600.011790.740.001790.7419.731164.28
    1202021.12.31 09:07close590.011819.840.001789.48-8.971155.31
    1212022.01.03 16:00sell610.011806.970.001765.87
    1222022.01.04 17:39close610.011816.970.001765.87-9.791145.51
    1232022.01.05 22:30sell620.011810.000.001771.12
    1242022.01.11 08:16close620.011810.010.001771.121.231146.74
    1252022.01.18 12:00sell630.011810.270.001785.65
    1262022.01.18 15:30sell640.011806.890.001775.51
    1272022.01.18 15:37close640.011816.890.001775.51-10.001136.74
    1282022.01.18 16:04close630.011820.270.001785.65-10.001126.74
    1292022.01.19 05:15sell650.011810.740.001792.48
    1302022.01.19 07:00sell660.011811.540.001803.30
    1312022.01.19 15:19close650.011820.740.001792.48-10.001116.74
    1322022.01.19 15:19close660.011821.540.001803.30-10.001106.74
    1332022.01.27 09:00sell670.011810.600.001765.34
    1342022.01.27 13:15sell680.011810.700.001788.24
    1352022.01.28 12:52t/p680.011788.240.001788.2422.671129.41
    1362022.02.02 17:24close670.011810.610.001765.340.811130.22
    1372022.02.04 13:45sell690.011810.330.001802.37
    1382022.02.04 15:39t/p690.011802.370.001802.377.961138.18
    1392022.02.04 16:00sell700.011795.320.001756.60
    1402022.02.04 16:39close700.011805.320.001756.60-10.001128.18
    1412022.02.07 03:45sell710.011809.750.001799.03
    1422022.02.07 10:30sell720.011811.100.001803.08
    1432022.02.07 12:30sell730.011811.530.001804.37
    1442022.02.07 19:37close710.011819.750.001799.03-10.001118.18
    1452022.02.07 20:22close720.011821.100.001803.08-10.001108.18
    1462022.02.07 20:24close730.011821.530.001804.37-10.001098.18
    1472022.05.13 16:15sell740.011802.800.001751.28
    1482022.05.13 17:02close740.011812.800.001751.28-10.001088.18
    1492022.05.13 19:00sell750.011808.990.001769.85
    1502022.05.16 02:00sell760.011810.840.001791.70
    1512022.05.16 06:45sell770.011809.830.001794.67
    1522022.05.16 10:43t/p770.011794.670.001794.6715.161103.34
    1532022.05.16 10:51t/p760.011791.700.001791.7019.141122.48
    1542022.05.16 21:55close750.011819.020.001769.85-9.821112.66
    1552022.05.18 06:30sell780.011808.180.001778.32
    1562022.05.18 10:00sell790.011809.610.001789.63
    1572022.05.18 12:33close780.011818.190.001778.32-10.011102.65
    1582022.05.18 12:37close790.011819.610.001789.63-10.001092.65
    1592022.05.18 15:15sell800.011808.580.001785.34
    1602022.05.18 18:32close800.011818.580.001785.34-10.001082.65
    1612022.06.14 19:00sell810.011810.290.001768.19
    1622022.06.14 21:30sell820.011810.070.001767.53
    1632022.06.15 09:22close820.011820.070.001767.53-9.791072.85
    1642022.06.15 09:28close810.011820.290.001768.19-9.791063.06
    1652022.06.30 13:45sell830.011810.240.001787.18
    1662022.06.30 15:39close830.011820.240.001787.18-10.001053.06
    1672022.06.30 18:00sell840.011808.930.001776.99
    1682022.06.30 20:00sell850.011809.760.001779.48
    1692022.07.04 05:45sell860.011809.120.001799.24
    1702022.07.04 07:45sell870.011811.720.001807.04
    1712022.07.04 11:39t/p870.011807.040.001807.044.681057.74
    1722022.07.05 05:30sell880.011810.210.001806.77
    1732022.07.05 10:24t/p880.011806.770.001806.773.441061.18
    1742022.07.05 14:18t/p860.011799.240.001799.2410.091071.26
    1752022.07.05 17:03t/p850.011779.480.001779.4830.901102.16
    1762022.07.05 17:05t/p840.011776.990.001776.9932.561134.72
    1772022.12.13 19:45sell890.011809.040.001778.50
    1782022.12.13 21:30sell900.011809.730.001780.57
    1792022.12.14 04:00sell910.011810.570.001783.09
    1802022.12.14 06:15sell920.011809.880.001798.28
    1812022.12.14 21:02t/p920.011798.280.001798.2811.601146.32
    1822022.12.14 22:45sell930.011808.630.001797.87
    1832022.12.15 03:53t/p930.011797.870.001797.8711.381157.70
    1842022.12.15 10:12t/p910.011783.090.001783.0928.101185.80
    1852022.12.15 10:20t/p900.011780.570.001780.5729.981215.78
    1862022.12.15 10:31t/p890.011778.500.001778.5031.361247.15
    1872022.12.22 16:15sell940.011807.890.001783.23
    1882022.12.27 17:20close940.011817.890.001783.23-9.381237.76
    1892022.12.28 02:30sell950.011810.310.001764.09
    1902022.12.28 04:30sell960.011810.330.001764.15
    1912022.12.28 08:00sell970.011810.300.001787.62
    1922022.12.29 20:25close970.011820.300.001787.62-9.381228.38
    1932022.12.29 20:25close950.011820.310.001764.09-9.381219.00
    1942022.12.29 20:25close960.011820.330.001764.15-9.381209.62
    1952023.02.24 18:15sell980.011809.460.001776.14
    1962023.02.24 20:00sell990.011809.720.001776.92
    1972023.02.24 23:15sell1000.011811.200.001785.56
    1982023.02.27 05:30sell1010.011810.190.001799.31
    1992023.02.27 17:03close980.011819.460.001776.14-9.791199.83
    2002023.02.27 17:03close990.011819.720.001776.92-9.791190.03
    2012023.02.27 17:18close1010.011820.190.001799.31-10.001180.03
    2022023.02.28 10:00sell1020.011810.360.001792.60
    2032023.02.28 12:00sell1030.011810.170.001792.03
    2042023.02.28 17:00close1030.011821.220.001792.03-11.051168.98
    2052023.02.28 17:00close1020.011821.220.001792.60-10.861158.12
    2062023.02.28 17:00close1000.011821.220.001785.56-9.611148.51
    2072023.03.08 05:15sell1040.011809.930.001763.01
    2082023.03.08 16:48close1040.011819.940.001763.01-10.011138.50
    +
    diff --git a/Docs/Reports/XR/Short/StrategyTester 2.gif b/Docs/Reports/XR/Short/StrategyTester 2.gif new file mode 100644 index 0000000000000000000000000000000000000000..fa9c0ff3ec48758fb1b48ffd85126fe24558d227 GIT binary patch literal 8153 zcmc(Dg;!MH_x2FN3?(HJA|TzUAUH^?Af;juf*>M|AWC=7FvQT^HFWn3jD#>SbPe6z z-OP{A_x&T@yUsmpuV+8|+56nP);VWwIAF+0C+qe003aISbR-47=BP= zYFcv()tG|elYrY7kDr8tZ=o8~Tjs3^z)#}9fHJ`C0OS524}Sm${|^9k*W5b6xXJ$! z0RYpQ+tAzKTd2mg42*)~mrcR9nsCz^Q`D_A0MHEvqwu#VpltGgDyC%s(`EcE9ge!q zaO=FS2oDE?Z?(Yx&ET5b`T&5*+iFbVHMeQt;F`%><90&bM#68wZUDIZmUWv4eoMMt z(|<+W`u{^}CMV&OxLeEg)(0pv1p{tHZv}5_x?Sl1pGWBS>jVD#7XVVcH^A4=KOis& z0u6?RgocH~BO;@sV`Agt6B3h>Q&Q8?GcvQXb8_<#`2~eV#U-U>rz6o-vrLjz-NDQLo3E?(5rVSvA64pnfpZh(cWMMW)#byvm+)ZSd z<8E|?``y*k?bGVP{N$*u;GIt;u07@)`Mr5@Vg-H1NySb}Cuj0P(z`q0HD_cA@}jpL z!5qXWXk3=w6^qkjd|Xch?GMJ;^S!@`v}q)L7gv4lSXXd<0@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Iis1D#T_a!dTdd%CfgXlu{ + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.07 01:15 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=false; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63631Ticks modelled72968765Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit43.39Gross profit91.75Gross loss-48.35
    Profit factor1.90Expected payoff3.94
    Absolute drawdown1.08Maximal drawdown32.09 (3.09%)Relative drawdown3.09% (32.09)
    Total trades11Short positions (won %)11 (54.55%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)6 (54.55%)Loss trades (% of total)5 (45.45%)
    Largestprofit trade40.11loss trade-10.00
    Averageprofit trade15.29loss trade-9.67
    Maximumconsecutive wins (profit in money)3 (33.04)consecutive losses (loss in money)2 (-19.59)
    Maximalconsecutive profit (count of wins)49.09 (2)consecutive loss (count of losses)-19.59 (2)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 12:34sell10.011808.470.001798.47
    22020.11.27 15:09t/p10.011798.470.001798.4710.001010.00
    32021.02.23 09:54sell20.011808.360.001796.34
    42021.02.23 14:54sell30.011809.080.001798.06
    52021.02.23 16:45t/p30.011798.060.001798.0611.021021.02
    62021.02.23 16:48t/p20.011796.340.001796.3412.021033.04
    72021.07.13 16:15sell40.011808.460.001793.92
    82021.07.13 20:16sell50.011808.250.001791.95
    92021.07.14 15:01close50.011818.250.001791.95-9.791023.25
    102021.07.14 15:02close40.011818.460.001793.92-9.791013.45
    112021.07.21 10:34sell60.011808.650.001799.03
    122021.07.21 15:09t/p60.011799.030.001799.039.621023.07
    132021.08.03 04:39sell70.011811.070.001794.53
    142021.08.04 15:09close70.011821.070.001794.53-9.791013.28
    152021.08.05 01:39sell80.011811.540.001771.64
    162021.08.05 15:30sell90.011809.510.001800.53
    172021.08.05 16:45t/p90.011800.530.001800.538.981022.26
    182021.08.06 16:08t/p80.011771.640.001771.6440.111062.36
    192021.10.22 18:39sell100.011786.660.001760.36
    202021.10.22 19:39close100.011796.660.001760.36-10.001052.36
    212021.12.28 18:19sell110.011809.950.001789.81
    222021.12.31 09:09close110.011819.950.001789.81-8.971043.39
    +
    diff --git a/Docs/Reports/XR/Short/StrategyTester 3.gif b/Docs/Reports/XR/Short/StrategyTester 3.gif new file mode 100644 index 0000000000000000000000000000000000000000..32e8d5e0df8dc8fbc8f4d4bc06402050fee11773 GIT binary patch literal 7795 zcmch5^;=Z!_w|4RGnAAF14wrXNDUxmASGbYpdwwObPX{u3`loN4nqw{=b&_V4lUi? z%$Mi${txeo``Tyiwbx$zKEIsnyn6joO8V2&d!2w)004)>0RVvB-dpW|Ks5fBO(6-06kTANyy~P|A+v9 zdDUI%UGW`MWsZh4M&ee?A$OXQ=2hm6chUer4+PSPyF&r!ng6MnqXFhCxI21e<6Vcl z=pfb`t4?)pUDk?v;t z&%|B+Kcs4ACUR!-E;7H%0np|Uz@6Hip}R@V?;h^XyV3tY9|Cu~5BTq00Elo>FJzD>UY+-}iCE+}XcP(H@SMlLF8kg-1NrHNX4uKrNucIFI` zt?0)hk9bEH{ZA#BQ#(C2F?vNcRPa;NC|yim#|O#m4Q$u%{5Q(_#P#)FkkFAr_<8L(OKowSZ3GyX-RaUi z@O`bTquuP^oSG*&2;?t`ef!Z^)Ns9?k~f`%B3bO0L}1K23N_t!n~ z2g$Sxob?`&0T1-`26Xzm>{+YJxfj##SD&ztec!q~wF!}6CugCemN%1?g!aH*vPYLR zT=usi!NGL=pV67!@ss*=BDItugNR8d9_`y`yLuw6gvuM28q~!pXeV#LvfA+ewFni~ z`j|jP#gLFT+LVLj^ROw~{?wxc5b^4(1lagjIH^m%rQ|q>M~X|4m{6CKE#w~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nN0+8^8;C=ahM$%5Y_$WkS=nygaqX>p43EhLm3ax5xVN+A{*F*B;hl84-#3 zHw(O=V0=Kv);pxs)s&Wpet&90q~#7ob%5%_pI_VC>ypY-8Y)^9{>P-DLPQ>+{&mz~ zQZJY~`={4os!A@Txvd(H4*IR9V{%UzH(7j8!1rw8lsLmViP|Jmea$1JXPBj$NwOA! z(z{&2Tt1cJsH$zf%5=3Cfv>(N|BXL9E)3+cVaur+Q&H*57JS#nwaoiYtF9qUh zqMTblU!g``gpHSdIpH&SeKqu2z~y&vFkbk*>iCv@BZ4%uIb^|Hx%D@ zsji=^cu`y*gDIg3;RkK|Pc$BC*n1`U0Voe2VK$l2PZw+!EV>`LliH&Lm`N9bYHojM mO3*OjuticEx4(?L=wNx$C5lkDRt}-EkT+qU@d)q%GXDq0+tpP7 literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/Short/StrategyTester 3.htm b/Docs/Reports/XR/Short/StrategyTester 3.htm new file mode 100644 index 0000000..6203c5b --- /dev/null +++ b/Docs/Reports/XR/Short/StrategyTester 3.htm @@ -0,0 +1,95 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.07 01:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=false; +enableXRShort=true; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63633Ticks modelled72969323Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (60)
    Total net profit44.66Gross profit83.01Gross loss-38.35
    Profit factor2.16Expected payoff4.47
    Absolute drawdown12.08Maximal drawdown40.24 (3.91%)Relative drawdown3.91% (40.24)
    Total trades10Short positions (won %)10 (60.00%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)6 (60.00%)Loss trades (% of total)4 (40.00%)
    Largestprofit trade40.11loss trade-9.79
    Averageprofit trade13.84loss trade-9.59
    Maximumconsecutive wins (profit in money)3 (21.88)consecutive losses (loss in money)3 (-29.38)
    Maximalconsecutive profit (count of wins)40.11 (1)consecutive loss (count of losses)-29.38 (3)
    Averageconsecutive wins2consecutive losses2
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 12:34sell10.011808.470.001798.47
    22020.11.27 15:09t/p10.011798.470.001798.4710.001010.00
    32021.02.23 14:54sell20.011809.080.001798.06
    42021.02.23 16:45t/p20.011798.060.001798.0611.021021.02
    52021.07.13 16:15sell30.011808.460.001793.92
    62021.07.13 20:16sell40.011808.250.001791.95
    72021.07.14 15:01close40.011818.250.001791.95-9.791011.23
    82021.07.14 15:02close30.011818.460.001793.92-9.791001.43
    92021.08.03 04:39sell50.011811.070.001794.53
    102021.08.04 15:09close50.011821.070.001794.53-9.79991.64
    112021.08.05 01:39sell60.011811.540.001771.64
    122021.08.06 16:08t/p60.011771.640.001771.6440.111031.74
    132021.12.28 18:19sell70.011809.950.001789.81
    142021.12.31 09:09close70.011819.950.001789.81-8.971022.77
    152022.12.14 19:11sell80.011808.980.001804.16
    162022.12.14 21:01t/p80.011804.160.001804.164.821027.59
    172022.12.14 22:47sell90.011808.170.001797.41
    182022.12.15 04:13t/p90.011797.410.001797.4111.381038.97
    192023.02.27 14:00sell100.011811.310.001805.83
    202023.02.28 10:18t/p100.011805.830.001805.835.691044.66
    +
    diff --git a/Docs/Reports/XR/Short/StrategyTester 4.gif b/Docs/Reports/XR/Short/StrategyTester 4.gif new file mode 100644 index 0000000000000000000000000000000000000000..e10972474a04c80cc35b0522edeb58c30aa8e557 GIT binary patch literal 9432 zcmch7^wdNi$kvba$h~MvEf7 z53l$4fB0UH`#O(vJVF3lXf$A)8m^UtfurLb&R03`u$n5{)5q_f}{{sL6bvHrC?85(u z0DxuPP3leZ4OC}Y328wQHY_1GnkdUU%a$8y0AK(DX(8O8fXapcsaRG5EH?-@bX3bt zg`40_M+6iEa-#+L&q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ZTd;}7&{~&FXA$fqIfgt3dO`w2k;u$t=_EzeEV0st} zSqXPqhFsuWavBx~uGC3u;R^RpPEAb8$QzA#Z9u+-%ebt`K)0t{!BWaRQ?ubwO>@CZ z2>5Vgq^w}lh5=}fC=-v%+?I>08qKIM%M{m7nNCDEG6w;fqvll5v6Vr;fT(sjfDWIf zfJN`hX2R9<1E#p_;9#P0SPM(=cPOj~${ClJT_}-5-kv>ihR9YikP8b_=m)HOg00|y zN08iwEx0NqLlvJ>^dwgqoI)_q)tTp1$LCs}W(%KlY8!&(Qi5u%eV>E#`|GoqnzUwE z6tfZ^8C=ML<%II}AYPxnazoqma#!>0yn;N73%vUaeDMYT;KBf*!XWj+VB5mbutG#} QA+o + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.07 17:45 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    Bars in test63697Ticks modelled73031931Modelling qualityn/a
    Mismatched charts errors826
    Initial deposit1000.00SpreadCurrent (51)
    Total net profit64.59Gross profit429.97Gross loss-365.38
    Profit factor1.18Expected payoff1.09
    Absolute drawdown64.19Maximal drawdown151.17 (13.91%)Relative drawdown13.91% (151.17)
    Total trades59Short positions (won %)59 (37.29%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)22 (37.29%)Loss trades (% of total)37 (62.71%)
    Largestprofit trade50.75loss trade-11.05
    Averageprofit trade19.54loss trade-9.88
    Maximumconsecutive wins (profit in money)4 (173.59)consecutive losses (loss in money)8 (-80.50)
    Maximalconsecutive profit (count of wins)173.59 (4)consecutive loss (count of losses)-80.50 (8)
    Averageconsecutive wins2consecutive losses4
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 06:45sell10.011807.850.001793.49
    22020.11.27 15:09t/p10.011793.490.001793.4914.361014.36
    32021.02.04 16:00sell20.011808.190.001770.49
    42021.02.08 01:09close20.011818.190.001770.49-9.591004.77
    52021.02.16 15:15sell30.011811.040.001780.54
    62021.02.16 18:30sell40.011803.470.001759.29
    72021.02.17 15:24t/p30.011780.540.001780.5430.711035.48
    82021.02.22 16:37close40.011803.480.001759.291.231036.70
    92021.05.13 13:15sell50.011810.390.001785.51
    102021.05.13 15:39close50.011820.390.001785.51-10.001026.70
    112021.06.17 10:30sell60.011809.210.001747.49
    122021.07.06 10:54close60.011809.220.001747.493.491030.20
    132021.07.16 22:30sell70.011810.350.001778.15
    142021.07.19 09:15sell80.011806.190.001784.27
    152021.07.19 18:15sell90.011807.210.001790.91
    162021.07.19 23:30sell100.011811.470.001803.69
    172021.07.20 04:09close80.011816.190.001784.27-9.791020.40
    182021.07.20 04:31close90.011817.210.001790.91-9.791010.61
    192021.07.20 15:36close70.011820.350.001778.15-9.591001.02
    202021.07.20 15:37close100.011821.470.001803.69-9.79991.23
    212021.07.20 18:15sell110.011810.140.001780.96
    222021.07.20 20:30sell120.011810.840.001783.06
    232021.07.21 10:30sell130.011808.770.001799.15
    242021.07.21 15:09t/p130.011799.150.001799.159.621000.85
    252021.07.26 10:22close110.011810.150.001780.961.231002.08
    262021.07.26 10:24close120.011810.850.001783.061.231003.30
    272021.07.30 21:45sell140.011810.450.001768.95
    282021.08.02 04:45sell150.011809.440.001774.22
    292021.08.02 06:30sell160.011811.380.001786.42
    302021.08.02 09:15sell170.011810.310.001797.51
    312021.08.02 20:09close150.011819.440.001774.22-10.00993.30
    322021.08.03 04:30sell180.011809.740.001790.54
    332021.08.04 15:06close180.011819.740.001790.54-9.79983.51
    342021.08.04 15:07close170.011820.310.001797.51-9.59973.92
    352021.08.04 15:07close140.011820.450.001768.95-9.38964.54
    362021.08.04 15:09close160.011821.380.001786.42-9.59954.95
    372021.08.04 18:30sell190.011806.630.001756.91
    382021.08.04 21:45sell200.011810.860.001769.60
    392021.08.05 01:00sell210.011811.890.001772.69
    402021.08.05 03:15sell220.011810.920.001769.78
    412021.08.06 16:07t/p210.011772.690.001772.6939.41994.36
    422021.08.06 16:39t/p220.011769.780.001769.7841.351035.70
    432021.08.06 16:39t/p200.011769.600.001769.6042.081077.79
    442021.08.09 01:22t/p190.011756.910.001756.9150.751128.54
    452021.09.01 11:15sell230.011809.570.001794.93
    462021.09.01 15:52close230.011819.570.001794.93-10.001118.54
    472021.09.01 18:15sell240.011810.930.001793.05
    482021.09.02 07:30sell250.011811.430.001801.71
    492021.09.02 17:30sell260.011807.760.001789.30
    502021.09.03 04:45sell270.011811.190.001806.13
    512021.09.03 15:18close260.011817.760.001789.30-9.791108.74
    522021.09.03 15:34close240.011820.930.001793.05-9.181099.57
    532021.09.03 15:34close270.011821.190.001806.13-10.001089.57
    542021.09.03 15:34close250.011821.430.001801.71-9.791079.77
    552021.09.07 13:15sell280.011810.900.001778.58
    562021.09.07 16:15sell290.011810.490.001777.53
    572021.09.16 12:54t/p280.011778.580.001778.5834.591114.36
    582021.09.16 13:00t/p290.011777.530.001777.5335.231149.59
    592021.11.22 19:45sell300.011810.200.001736.88
    602021.11.23 04:15sell310.011807.780.001740.54
    612021.11.26 09:54close310.011807.790.001740.541.021150.61
    622021.11.26 12:03close300.011810.210.001736.881.231151.84
    632022.01.03 16:00sell320.011806.970.001765.87
    642022.01.04 17:39close320.011816.970.001765.87-9.791142.04
    652022.01.05 22:30sell330.011810.000.001771.12
    662022.01.11 08:16close330.011810.010.001771.121.231143.27
    672022.01.18 12:00sell340.011810.270.001785.65
    682022.01.18 15:30sell350.011806.890.001775.51
    692022.01.18 15:37close350.011816.890.001775.51-10.001133.27
    702022.01.18 16:04close340.011820.270.001785.65-10.001123.27
    712022.01.19 05:15sell360.011810.740.001792.48
    722022.01.19 07:00sell370.011811.540.001803.30
    732022.01.19 15:19close360.011820.740.001792.48-10.001113.27
    742022.01.19 15:19close370.011821.540.001803.30-10.001103.27
    752022.01.27 09:00sell380.011810.600.001765.34
    762022.01.27 13:15sell390.011810.700.001788.24
    772022.01.28 12:52t/p390.011788.240.001788.2422.671125.93
    782022.02.02 17:24close380.011810.610.001765.340.811126.75
    792022.05.13 16:15sell400.011802.800.001751.28
    802022.05.13 17:02close400.011812.800.001751.28-10.001116.75
    812022.05.13 19:00sell410.011808.990.001769.85
    822022.05.16 02:00sell420.011810.840.001791.70
    832022.05.16 06:45sell430.011809.830.001794.67
    842022.05.16 10:43t/p430.011794.670.001794.6715.161131.91
    852022.05.16 10:51t/p420.011791.700.001791.7019.141151.05
    862022.05.16 21:55close410.011819.020.001769.85-9.821141.23
    872022.05.18 06:30sell440.011808.180.001778.32
    882022.05.18 10:00sell450.011809.610.001789.63
    892022.05.18 12:33close440.011818.190.001778.32-10.011131.22
    902022.05.18 12:37close450.011819.610.001789.63-10.001121.22
    912022.05.18 15:15sell460.011808.580.001785.34
    922022.05.18 18:32close460.011818.580.001785.34-10.001111.22
    932022.06.14 19:00sell470.011810.290.001768.19
    942022.06.14 21:30sell480.011810.070.001767.53
    952022.06.15 09:22close480.011820.070.001767.53-9.791101.42
    962022.06.15 09:28close470.011820.290.001768.19-9.791091.63
    972022.06.30 13:45sell490.011810.240.001787.18
    982022.06.30 15:39close490.011820.240.001787.18-10.001081.63
    992022.06.30 18:00sell500.011808.930.001776.99
    1002022.06.30 20:00sell510.011809.760.001779.48
    1012022.07.05 17:03t/p510.011779.480.001779.4830.901112.53
    1022022.07.05 17:05t/p500.011776.990.001776.9932.561145.08
    1032022.12.22 16:15sell520.011807.890.001783.23
    1042022.12.27 17:20close520.011817.890.001783.23-9.381135.70
    1052023.02.24 18:15sell530.011809.460.001776.14
    1062023.02.24 20:00sell540.011809.720.001776.92
    1072023.02.24 23:15sell550.011811.200.001785.56
    1082023.02.27 05:30sell560.011810.190.001799.31
    1092023.02.27 17:03close530.011819.460.001776.14-9.791125.91
    1102023.02.27 17:03close540.011819.720.001776.92-9.791116.11
    1112023.02.27 17:18close560.011820.190.001799.31-10.001106.11
    1122023.02.28 10:00sell570.011810.360.001792.60
    1132023.02.28 12:00sell580.011810.170.001792.03
    1142023.02.28 17:00close580.011821.220.001792.03-11.051095.06
    1152023.02.28 17:00close570.011821.220.001792.60-10.861084.20
    1162023.02.28 17:00close550.011821.220.001785.56-9.611074.60
    1172023.03.08 05:15sell590.011809.930.001763.01
    1182023.03.08 16:48close590.011819.940.001763.01-10.011064.59
    +
    diff --git a/Docs/Reports/XR/StrategyTester 1 - Full.gif b/Docs/Reports/XR/StrategyTester 1 - Full.gif new file mode 100644 index 0000000000000000000000000000000000000000..b08e5bc55f9cde1b711727b3c781fdb87057d8c4 GIT binary patch literal 9202 zcmch6g;!MX_w~@j5CS3~sDz{-CEcLXAYqV#qBK&{%@7mB&_fLkLpKbKNOv=&fYL2U z!~FPs-~Zvg@vL+A*=L{q+`HCYcRg1{O<6+nlL$dCU>yL!;cx%|U~q5{S2rMq_*-Xb zS$7B3SxO=10e2@3H;<6IgX%2rn0FxnH;S{DeV8_;r=3|{s#aC>h6+K*!lkv z0RYRoyVASjJE+dGLaGIUTeFn9(?nR-S+?9s0{{b3QZ2YU6i_k$KNZUgfaMzQj*e)# z>u{I6bA&@kN!@8l{WnV0-T4Cm=I`8CBI@qiAf)Q%?}EFb<*pKO2Mz$F2JTpQeGqq~ zyE*-5;x7LmQa3-3n8)5lmUlTog{2hWPVLUnycFPWx4gT)oBIFfjqmR61O9s!01{jv zAQ&7H8Ws+L!r&2+QPGH)*tqzF#3W>LN@`jOO|{jhC7@JkXJZmK_`MuxA+7|5k~c^o*(?QtAkMD6bT zbLIJrggRHp`#IH=PYyXcALy>MLay|*)~J;TNohDEIKKR&2?fPHH)(H|1hY{vF`A+V zvj{}*rO+*NG^@-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@nmS#v1 zS&oKh?xNgexOPX-vSTHJIhh1ht%#>)4o+$ZcZ-AL3AI&_A&JYuJ0F-}Rsl~XK%4c! z1QI}f1~MH?=w5h;hN_P$5-f}*mEXiUegS&kbOUTRgHoKr-l~Qq35FYoguDi-2{BN) zZ2|=$Or8v(aKVu8+|=40?mQ~)b5U`tFgf5&1dz%)JnXpv{&Oy9ORi^fuQwFp z{n!bb9_RuM4|Tyn%afqLlVJ47z~^X)Was0&Ww*g~7o@nqzz4S|30R^NJcAxijAeje zKyyDdz}BR5pP)72J}DB=%9)4^v~R2xO`d_*Y;?gk! zzil1!+CWX@A{Z$Wou26^O&S9XbmP4MnmvpUw4#v$Cgc~mTUB&sUv-U1$}81ecDA{G1C{w yQp0oxwq)vHRueANZ#C4K4Qd05+A2it^r7~)PzR(LM?4wFY8n5$P(c8I^#1|!9*_e7 literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/StrategyTester 1 - Full.htm b/Docs/Reports/XR/StrategyTester 1 - Full.htm new file mode 100644 index 0000000..67b4780 --- /dev/null +++ b/Docs/Reports/XR/StrategyTester 1 - Full.htm @@ -0,0 +1,297 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.08 10:00 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.008; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.008; xRMaximumCandlesPerTrade=96; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63758Ticks modelled73078285Modelling qualityn/a
    Mismatched charts errors901
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit210.35Gross profit662.75Gross loss-452.40
    Profit factor1.46Expected payoff1.90
    Absolute drawdown4.01Maximal drawdown124.53 (9.39%)Relative drawdown9.39% (124.53)
    Total trades111Short positions (won %)65 (38.46%)Long positions (won %)46 (34.78%)
    Profit trades (% of total)41 (36.94%)Loss trades (% of total)70 (63.06%)
    Largestprofit trade46.50loss trade-8.45
    Averageprofit trade16.16loss trade-6.46
    Maximumconsecutive wins (profit in money)5 (72.43)consecutive losses (loss in money)10 (-52.73)
    Maximalconsecutive profit (count of wins)99.30 (4)consecutive loss (count of losses)-55.38 (7)
    Averageconsecutive wins3consecutive losses5
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 06:45sell10.011807.850.001797.08
    22020.11.27 15:09t/p10.011797.080.001797.0810.771010.77
    32020.12.01 19:30buy20.011812.640.001854.00
    42020.12.02 02:30buy30.011813.270.001827.96
    52020.12.02 08:45buy40.011813.190.001821.26
    62020.12.02 10:36t/p40.011821.260.001821.268.071018.84
    72020.12.02 12:22t/p30.011827.960.001827.9614.691033.53
    82020.12.07 16:52t/p20.011854.000.001854.0038.711072.24
    92021.02.04 16:00sell50.011808.190.001779.92
    102021.02.05 17:24close50.011808.200.001779.920.201072.43
    112021.02.05 19:15buy60.011814.840.001846.28
    122021.02.08 01:15buy70.011817.890.001853.91
    132021.02.08 04:24close70.011809.890.001853.91-8.001064.43
    142021.02.08 07:30buy80.011815.740.001825.94
    152021.02.08 10:54close80.011807.740.001825.94-8.001056.43
    162021.02.08 11:45buy90.011813.160.001820.63
    172021.02.08 13:36t/p90.011820.630.001820.637.471063.90
    182021.02.09 11:24t/p60.011846.280.001846.2830.561094.46
    192021.02.16 15:15sell100.011811.040.001788.17
    202021.02.16 18:30sell110.011803.470.001770.34
    212021.02.17 01:09t/p100.011788.170.001788.1723.081117.53
    222021.02.17 18:09t/p110.011770.340.001770.3433.341150.87
    232021.02.23 04:00buy120.011813.630.001842.78
    242021.02.23 05:45buy130.011813.320.001827.80
    252021.02.23 11:24close120.011805.630.001842.78-8.001142.87
    262021.02.23 11:24close130.011805.320.001827.80-8.001134.87
    272021.05.06 18:00buy140.011815.930.001857.47
    282021.05.12 23:21close140.011815.910.001857.47-1.791133.08
    292021.05.13 13:15sell150.011810.390.001791.73
    302021.05.13 15:36close150.011818.390.001791.73-8.001125.08
    312021.06.17 10:30sell160.011809.210.001762.92
    322021.06.18 22:54t/p160.011762.920.001762.9246.501171.58
    332021.07.08 14:00buy170.011817.770.001849.41
    342021.07.08 16:39close170.011809.770.001849.41-8.001163.58
    352021.07.13 15:30buy180.011813.580.001824.58
    362021.07.13 15:31close180.011805.570.001824.58-8.011155.57
    372021.07.13 18:15buy190.011812.850.001833.61
    382021.07.14 03:09close190.011804.840.001833.61-8.451147.11
    392021.07.14 06:30buy200.011813.440.001826.16
    402021.07.14 08:30buy210.011813.820.001827.11
    412021.07.14 10:45buy220.011813.940.001827.41
    422021.07.14 15:09t/p200.011826.160.001826.1612.721159.83
    432021.07.14 15:37t/p210.011827.110.001827.1113.291173.12
    442021.07.14 15:37t/p220.011827.410.001827.4113.471186.59
    452021.07.16 22:30sell230.011810.350.001786.20
    462021.07.19 09:15sell240.011806.190.001789.75
    472021.07.19 16:18close240.011814.190.001789.75-8.001178.59
    482021.07.19 18:15sell250.011807.210.001794.99
    492021.07.19 23:30sell260.011811.470.001805.64
    502021.07.19 23:30close230.011812.040.001786.20-1.481177.11
    512021.07.20 03:00sell270.011811.350.001805.34
    522021.07.20 04:06close250.011815.210.001794.99-7.791169.32
    532021.07.20 05:08close270.011819.350.001805.34-8.001161.32
    542021.07.20 05:18close260.011819.470.001805.64-7.791153.52
    552021.07.20 18:15sell280.011810.140.001788.26
    562021.07.20 20:30sell290.011810.840.001790.01
    572021.07.21 10:30sell300.011808.770.001801.56
    582021.07.21 14:03t/p300.011801.560.001801.567.211160.73
    592021.07.23 10:54close280.011810.150.001788.261.021161.75
    602021.07.23 14:34t/p290.011790.010.001790.0121.861183.61
    612021.07.29 04:30buy310.011816.190.001851.05
    622021.07.30 19:51close310.011816.180.001851.05-0.451183.16
    632021.07.30 21:45sell320.011810.450.001779.33
    642021.08.02 04:45sell330.011809.440.001783.03
    652021.08.02 06:30sell340.011811.380.001792.66
    662021.08.02 09:15sell350.011810.310.001800.71
    672021.08.02 19:36close330.011817.440.001783.03-8.001175.16
    682021.08.02 19:39close350.011818.310.001800.71-8.001167.16
    692021.08.02 19:52close320.011818.450.001779.33-7.791159.37
    702021.08.02 20:07close340.011819.380.001792.66-8.001151.37
    712021.08.03 04:30sell360.011809.740.001795.34
    722021.08.03 06:15sell370.011810.010.001796.02
    732021.08.03 08:15sell380.011810.150.001796.37
    742021.08.03 12:00sell390.011810.640.001805.50
    752021.08.04 05:30close360.011813.440.001795.34-3.491147.87
    762021.08.04 07:15close370.011812.810.001796.02-2.591145.28
    772021.08.04 09:15close380.011813.010.001796.37-2.651142.63
    782021.08.04 13:00close390.011815.210.001805.50-4.361138.26
    792021.08.04 18:30sell400.011806.630.001769.34
    802021.08.04 21:45sell410.011810.860.001779.92
    812021.08.05 01:00sell420.011811.890.001782.49
    822021.08.05 03:15sell430.011810.920.001780.07
    832021.08.05 10:54close400.011814.630.001769.34-7.381130.88
    842021.08.05 11:30sell440.011809.830.001802.96
    852021.08.05 16:39t/p440.011802.960.001802.966.871137.75
    862021.08.06 15:39t/p420.011782.490.001782.4929.611167.36
    872021.08.06 15:39t/p430.011780.070.001780.0731.061198.41
    882021.08.06 15:39t/p410.011779.920.001779.9231.761230.18
    892021.08.27 19:15buy450.011814.940.001860.72
    902021.08.30 20:15close450.011810.010.001860.72-5.371224.80
    912021.08.31 04:30buy460.011814.040.001822.85
    922021.08.31 14:15buy470.011814.290.001820.49
    932021.08.31 16:06close470.011806.290.001820.49-8.001216.80
    942021.08.31 16:06close460.011806.040.001822.85-8.001208.80
    952021.08.31 20:00buy480.011814.350.001832.70
    962021.09.01 04:30buy490.011812.970.001829.25
    972021.09.01 11:15sell500.011809.570.001798.59
    982021.09.01 15:39close500.011817.570.001798.59-8.001200.80
    992021.09.01 18:15sell510.011810.930.001797.52
    1002021.09.01 21:00close480.011812.490.001832.70-2.301198.50
    1012021.09.02 06:04close490.011812.960.001829.25-1.341197.17
    1022021.09.02 07:30sell520.011811.430.001804.14
    1032021.09.02 17:30sell530.011807.760.001793.92
    1042021.09.02 21:07close510.011810.940.001797.520.611197.77
    1052021.09.03 04:45sell540.011811.190.001807.40
    1062021.09.03 07:45sell550.011811.510.001806.85
    1072021.09.03 08:30close520.011811.860.001804.14-0.221197.55
    1082021.09.03 15:06close530.011815.760.001793.92-7.791189.76
    1092021.09.03 15:34close540.011819.190.001807.40-8.001181.76
    1102021.09.03 15:34close550.011819.510.001806.85-8.001173.76
    1112021.09.07 13:15sell560.011810.900.001786.66
    1122021.09.07 16:15sell570.011810.490.001785.77
    1132021.09.08 16:54t/p560.011786.660.001786.6624.451198.20
    1142021.09.08 16:54t/p570.011785.770.001785.7724.931223.13
    1152021.11.05 18:45buy580.011814.390.001857.82
    1162021.11.10 16:24t/p580.011857.820.001857.8242.101265.23
    1172021.11.22 19:45sell590.011810.200.001755.21
    1182021.11.23 04:15sell600.011807.780.001757.35
    1192021.11.26 09:54close600.011807.790.001757.351.021266.25
    1202021.11.26 11:55close590.011810.210.001755.211.231267.48
    1212021.12.27 18:00buy610.011813.040.001827.67
    1222021.12.28 08:00buy620.011813.260.001822.55
    1232021.12.28 17:00buy630.011814.210.001821.41
    1242021.12.28 19:00close610.011810.530.001827.67-2.951264.53
    1252021.12.28 20:52close630.011806.210.001821.41-8.001256.53
    1262021.12.28 20:54close620.011805.250.001822.55-8.011248.52
    1272021.12.30 19:00buy640.011813.880.001839.91
    1282022.01.03 15:09close640.011813.860.001839.91-0.901247.61
    1292022.01.03 16:00sell650.011806.970.001776.15
    1302022.01.04 17:00close650.011811.780.001776.15-4.601243.01
    1312022.01.04 17:45buy660.011817.070.001844.28
    1322022.01.04 19:30buy670.011814.650.001838.23
    1332022.01.05 21:09close660.011817.050.001844.28-0.461242.55
    1342022.01.05 21:09close670.011814.640.001838.23-0.451242.09
    1352022.01.05 22:30sell680.011810.000.001780.84
    1362022.01.11 08:09close680.011810.010.001780.841.231243.32
    1372022.01.11 18:30buy690.011815.730.001836.09
    1382022.01.13 17:51close690.011815.720.001836.09-1.781241.54
    1392022.01.18 12:00sell700.011810.270.001791.81
    1402022.01.18 15:30sell710.011806.890.001783.36
    1412022.01.18 15:34close710.011814.890.001783.36-8.001233.54
    1422022.01.18 15:37close700.011818.270.001791.81-8.001225.54
    1432022.01.19 05:15sell720.011810.740.001797.05
    1442022.01.19 07:00sell730.011811.540.001805.36
    1452022.01.19 12:35close720.011818.740.001797.05-8.001217.54
    1462022.01.19 12:39close730.011819.540.001805.36-8.001209.54
    1472022.01.27 09:00sell740.011810.600.001776.66
    1482022.01.27 13:15sell750.011810.700.001793.86
    1492022.01.27 18:24t/p750.011793.860.001793.8616.841226.38
    1502022.02.02 17:24close740.011810.610.001776.660.811227.19
    1512022.02.04 12:30buy760.011814.080.001827.73
    1522022.02.04 15:30buy770.011813.350.001824.12
    1532022.02.04 15:36close760.011806.080.001827.73-8.001219.19
    1542022.02.04 15:36close770.011805.350.001824.12-8.001211.19
    1552022.02.07 02:45buy780.011812.860.001843.39
    1562022.02.07 11:00buy790.011813.430.001822.99
    1572022.02.07 14:00buy800.011813.990.001821.24
    1582022.02.07 16:15buy810.011816.160.001826.63
    1592022.02.07 21:06t/p800.011821.240.001821.247.251218.44
    1602022.02.07 21:39t/p790.011822.990.001822.999.561228.00
    1612022.02.08 17:24t/p810.011826.630.001826.6310.031238.03
    1622022.02.11 20:34t/p780.011843.390.001843.3927.881265.91
    1632022.05.13 16:15sell820.011802.800.001764.16
    1642022.05.13 17:01close820.011810.800.001764.16-8.001257.91
    1652022.05.13 19:00sell830.011808.990.001779.64
    1662022.05.16 02:00sell840.011810.840.001796.49
    1672022.05.16 04:08close830.011817.000.001779.64-7.801250.10
    1682022.05.16 06:45sell850.011809.830.001798.46
    1692022.05.16 10:42t/p850.011798.460.001798.4611.371261.47
    1702022.05.16 10:43t/p840.011796.490.001796.4914.351275.82
    1712022.05.18 06:30sell860.011808.180.001785.79
    1722022.05.18 10:00sell870.011809.610.001794.63
    1732022.05.18 10:31close860.011816.190.001785.79-8.011267.81
    1742022.05.18 12:32close870.011817.620.001794.63-8.011259.80
    1752022.05.18 15:15sell880.011808.580.001791.15
    1762022.05.18 18:08close880.011816.580.001791.15-8.001251.80
    1772022.06.14 19:00sell890.011810.290.001778.72
    1782022.06.14 21:30sell900.011810.070.001778.17
    1792022.06.15 05:31close900.011818.070.001778.17-7.791244.01
    1802022.06.15 05:31close890.011818.290.001778.72-7.791236.22
    1812022.06.30 13:45sell910.011810.240.001792.95
    1822022.06.30 15:37close910.011818.240.001792.95-8.001228.22
    1832022.06.30 18:00sell920.011808.930.001784.98
    1842022.06.30 20:00sell930.011809.760.001787.05
    1852022.07.01 14:39t/p930.011787.050.001787.0522.921251.13
    1862022.07.01 15:25t/p920.011784.980.001784.9824.161275.29
    1872022.12.13 16:30buy940.011818.950.001875.17
    1882022.12.13 17:48close940.011810.950.001875.17-8.001267.29
    1892022.12.13 18:45buy950.011813.330.001859.10
    1902022.12.13 19:25close950.011805.330.001859.10-8.001259.29
    1912022.12.20 17:15buy960.011820.900.001871.32
    1922022.12.21 07:23close960.011812.900.001871.32-8.441250.85
    1932022.12.21 09:30buy970.011815.410.001820.20
    1942022.12.21 14:00buy980.011814.120.001816.97
    1952022.12.21 15:13t/p980.011816.970.001816.972.851253.70
    1962022.12.21 17:07t/p970.011820.200.001820.204.791258.49
    1972022.12.22 16:15sell990.011807.890.001789.40
    1982022.12.22 20:02t/p990.011789.400.001789.4018.491276.98
    1992022.12.27 17:30buy1000.011821.760.001850.40
    2002022.12.27 19:56close1000.011813.760.001850.40-8.001268.98
    2012022.12.27 20:15buy1010.011815.050.001833.62
    2022022.12.28 03:30buy1020.011814.710.001832.77
    2032022.12.28 10:08close1010.011807.040.001833.62-8.451260.52
    2042022.12.28 10:08close1020.011806.710.001832.77-8.001252.52
    2052022.12.29 17:00buy1030.011814.370.001828.82
    2062022.12.29 18:45buy1040.011814.740.001829.74
    2072022.12.30 18:38close1030.011814.350.001828.82-0.461252.06
    2082023.01.03 01:07t/p1040.011829.740.001829.7413.671265.74
    2092023.02.24 18:15sell1050.011809.460.001784.47
    2102023.02.24 20:00sell1060.011809.720.001785.12
    2112023.02.24 23:15sell1070.011811.200.001791.97
    2122023.02.27 05:30sell1080.011810.190.001802.03
    2132023.02.27 16:23close1050.011817.460.001784.47-7.791257.94
    2142023.02.27 16:23close1060.011817.720.001785.12-7.791250.15
    2152023.02.27 16:55close1080.011818.190.001802.03-8.001242.15
    2162023.02.27 16:57close1070.011819.200.001791.97-7.791234.35
    2172023.02.28 10:00sell1090.011810.360.001797.04
    2182023.02.28 12:00sell1100.011810.170.001796.57
    2192023.02.28 16:47close1100.011818.170.001796.57-8.001226.35
    2202023.02.28 16:47close1090.011818.360.001797.04-8.001218.35
    2212023.03.08 05:15sell1110.011809.930.001774.74
    2222023.03.08 16:32close1110.011817.930.001774.74-8.001210.35
    +
    diff --git a/Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.gif b/Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ce41b5c72ff72558f92d3cd9672e5c36a82f653 GIT binary patch literal 9133 zcmc(Dg;x~L_x2(PyGw_(h$5-d-H1qssI-8fw19%JOT!Y&E-XuT*Mf962+|!&cP*%X3>&&P>t0c^Ueg|W~U?pWq`XbIraZ|xMQ^B{{TRL&7D(nYW9Cb z0Klr|F7z(=4yv&#lWa!g)~zJ(G|^TyR?T9CGWH(|C=Ri?&<>oX78%8Lf71-K}*)m-WhjO^IatR4(ta=_TRDY@}TcX zcWe5uh&%s(NX_gldUop0vbysD%B&;-l2(8_T`TnL-9rEWwC8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=_V7{%qGAJ>{RQLiJQl*>h1A!n#OKO`B!VkQ5JQuI`Yg=)ohd4iCuO$MU*pn`{sLy?jk0_&(I}GoCb(A()p&WkS z`9t6<@~zh@6)C28OEv?tudP9#Z`&LtonKtbu=Hb z^{F*>8F+*f7ft^};K@Fpz?H(5?4i2DlL1AXYFOLLe<9*NBXYX*>y7Pf z@XQur;dYPDt^}9uhc}zrt>8r=Gx}Pb>~lwQzoo{N(=8mq&S0s}(t)4o;#o77LHZ4z zzue3ip2 zJ^6(!!DXD&1C{|*5DUQ8et~qmvKxTAH@&js11esTaGV9WPAcOkeE0t3_XFTB-UDO8 zV#i^DeL)2B& zzR?F$bHUuEC}g+5o^=QnV4%AVD4Yu!?}uy+2`zc^Gc?O6YanR!_xPN>=Qi5mIC-rKG&$dcf zj}3?s4_UrN&_ED2b&gVpsMiO6%dS(tsSR6601DP2Nk00l5k-vFDHBbHJ*;E>zy(wz zfGBL@!fE}3X+mA83P{MOJ(xlPd+vTVJ&}WOwGov-pmTWBrpGU5)}_cO*AS+q(WrY2 zpl*E>2H+wD^(pB_V*pWXs$Mtd9zq89;me^2{TRx`m|FvnM)#Q7I&>aUR6`GfED^nd zhKNHWP;}&ZuC9>~O=-HYGiyx}R{N{`*vdQ&y6J#N0a3OgabGUTEqdK?e$dCZ09OXT zfSmAhVAyB(SOjaFcRiRrfZPx2*Ff+R0S#SM34iiUGf+7^cse196=K#K8&V&ePM>I4 zAG&lF<3*onZ3sqVV-4t%BF&THt;r3!d_UMGc|ct%RgkE<_dy|{7RLQNN Vl%L!w9jYmvwkh3Epg#a0^?wQgSv>#% literal 0 HcmV?d00001 diff --git a/Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.htm b/Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.htm new file mode 100644 index 0000000..73d7435 --- /dev/null +++ b/Docs/Reports/XR/StrategyTester 2 - 0.2 - Full.htm @@ -0,0 +1,301 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +

    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.08 11:00 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +enableXLong=true; +enableXShort=true; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=true; +enableXRLong=true; +enableXRShort=true; +xRShortR2R=1.5; xRShortLotsPerTradePercent=0.0002; xRShortMaxDrawdownPerTradePercent=0.15; xRLongR2R=1.5; xRLongLotsPerTradePercent=0.0002; xRLongMaxDrawdownPerTradePercent=0.15; xRMaximumCandlesPerTrade=96; xRSwingLength=48; xRSharpDetectionFactor=1350; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=false; +enableXTPWLong=true; +enableXTPWShort=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63762Ticks modelled73083601Modelling qualityn/a
    Mismatched charts errors902
    Initial deposit1000.00SpreadCurrent (50)
    Total net profit3076.78Gross profit11645.54Gross loss-8568.76
    Profit factor1.36Expected payoff27.23
    Absolute drawdown78.80Maximal drawdown2946.14 (44.93%)Relative drawdown44.93% (2946.14)
    Total trades113Short positions (won %)66 (46.97%)Long positions (won %)47 (25.53%)
    Profit trades (% of total)43 (38.05%)Loss trades (% of total)70 (61.95%)
    Largestprofit trade929.92loss trade-159.05
    Averageprofit trade270.83loss trade-122.41
    Maximumconsecutive wins (profit in money)6 (2894.35)consecutive losses (loss in money)9 (-793.75)
    Maximalconsecutive profit (count of wins)2894.35 (6)consecutive loss (count of losses)-1042.16 (7)
    Averageconsecutive wins2consecutive losses4
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.11.27 06:45sell10.201807.850.001797.08
    22020.11.27 15:09t/p10.201797.080.001797.08215.401215.40
    32020.11.27 15:09sell20.201796.570.001788.89
    42020.11.27 15:36t/p20.201788.890.001788.89153.601369.00
    52020.12.01 19:30buy30.201812.570.001853.93
    62020.12.02 10:39buy40.201824.800.001839.41
    72020.12.02 14:45close40.201817.290.001839.41-150.201218.80
    82020.12.07 16:52t/p30.201853.930.001853.93774.121992.92
    92021.02.04 16:00sell50.201808.190.001779.92
    102021.02.05 17:24close50.201808.200.001779.923.921996.85
    112021.02.05 19:15buy60.201814.770.001846.21
    122021.02.08 14:48buy70.201823.880.001843.17
    132021.02.09 09:54t/p70.201843.170.001843.17376.952373.80
    142021.02.09 11:24t/p60.201846.210.001846.21611.112984.91
    152021.02.16 15:15sell80.201811.040.001788.17
    162021.02.16 18:30sell90.201803.470.001770.34
    172021.02.17 01:09t/p80.201788.170.001788.17461.523446.43
    182021.02.17 18:09t/p90.201770.340.001770.34666.724113.15
    192021.02.23 04:00buy100.201813.560.001842.71
    202021.02.23 05:45buy110.201813.250.001827.73
    212021.02.23 11:24close100.201806.060.001842.71-150.003963.15
    222021.02.23 11:24close110.201805.750.001827.73-150.003813.15
    232021.02.23 11:24buy120.201806.240.001820.63
    242021.02.23 16:38close120.201798.740.001820.63-150.003663.15
    252021.05.06 18:00buy130.201815.860.001857.40
    262021.05.12 23:21close130.201815.850.001857.40-35.583627.57
    272021.05.13 13:15sell140.201810.390.001791.73
    282021.05.13 15:08close140.201817.890.001791.73-150.003477.57
    292021.05.13 15:08sell150.201817.380.001809.21
    302021.05.13 17:52close150.201824.880.001809.21-150.003327.57
    312021.06.17 10:30sell160.201809.210.001762.92
    322021.06.18 22:54t/p160.201762.920.001762.92929.924257.49
    332021.07.08 14:00buy170.201817.700.001849.34
    342021.07.08 16:39close170.201810.200.001849.34-150.004107.49
    352021.07.13 15:30buy180.201813.510.001824.51
    362021.07.13 15:30close180.201806.000.001824.51-150.203957.29
    372021.07.13 18:15buy190.201812.780.001833.54
    382021.07.13 21:09close190.201805.280.001833.54-150.003807.29
    392021.07.14 06:30buy200.201813.370.001826.09
    402021.07.14 08:30buy210.201813.750.001827.04
    412021.07.14 15:06buy220.201822.680.001840.68
    422021.07.14 15:09t/p200.201826.090.001826.09254.404061.69
    432021.07.14 15:37t/p210.201827.040.001827.04265.804327.49
    442021.07.15 16:00close220.201822.670.001840.68-26.744300.75
    452021.07.16 22:30sell230.201810.350.001786.20
    462021.07.19 09:15sell240.201806.190.001789.75
    472021.07.19 14:54sell250.201800.540.001777.82
    482021.07.19 15:52close250.201808.040.001777.82-150.004150.75
    492021.07.19 16:09close240.201813.690.001789.75-150.004000.75
    502021.07.19 18:15sell260.201807.210.001794.99
    512021.07.19 23:30close230.201811.970.001786.20-28.283972.47
    522021.07.20 04:04close260.201814.710.001794.99-145.883826.60
    532021.07.20 04:04sell270.201814.220.001812.51
    542021.07.20 11:09t/p270.201812.510.001812.5134.203860.80
    552021.07.20 18:15sell280.201810.140.001788.26
    562021.07.20 20:30sell290.201810.840.001790.01
    572021.07.21 13:54sell300.201801.740.001784.64
    582021.07.22 15:36close300.201801.750.001784.6412.173872.96
    592021.07.23 10:54close280.201810.150.001788.2620.413893.37
    602021.07.23 14:34t/p290.201790.010.001790.01437.214330.58
    612021.07.29 04:30buy310.201816.120.001850.98
    622021.07.30 19:52close310.201816.110.001850.98-9.054321.54
    632021.07.30 21:45sell320.201810.450.001779.33
    642021.08.02 04:45sell330.201809.440.001783.03
    652021.08.02 19:24close330.201816.940.001783.03-150.004171.54
    662021.08.02 19:39close320.201817.950.001779.33-145.884025.66
    672021.08.02 19:39sell340.201817.460.001799.73
    682021.08.03 04:30sell350.201809.740.001795.34
    692021.08.04 05:30close350.201813.370.001795.34-68.483957.18
    702021.08.04 05:30sell360.201812.880.001810.08
    712021.08.04 14:36close340.201817.470.001799.738.043965.22
    722021.08.04 15:07close360.201820.380.001810.08-150.003815.22
    732021.08.04 18:30sell370.201806.630.001769.34
    742021.08.05 10:52close370.201814.130.001769.34-137.633677.59
    752021.08.05 10:52sell380.201813.640.001805.63
    762021.08.05 15:30sell390.201810.170.001803.44
    772021.08.05 16:37t/p380.201805.630.001805.63160.203837.79
    782021.08.05 16:39t/p390.201803.440.001803.44134.603972.39
    792021.08.27 19:15buy400.201814.870.001860.65
    802021.08.30 20:15close400.201810.010.001860.65-106.053866.34
    812021.08.31 04:30buy410.201813.970.001822.78
    822021.08.31 14:15buy420.201814.220.001820.42
    832021.08.31 16:06close420.201806.720.001820.42-150.003716.34
    842021.08.31 16:06close410.201806.470.001822.78-150.003566.34
    852021.08.31 16:06buy430.201806.960.001825.02
    862021.08.31 20:00buy440.201814.280.001832.63
    872021.09.01 21:00close440.201812.490.001832.63-44.653521.70
    882021.09.01 21:00sell450.201812.480.001801.41
    892021.09.02 07:30sell460.201811.430.001804.14
    902021.09.02 17:09close430.201806.950.001825.02-35.583486.11
    912021.09.03 04:07close450.201812.490.001801.4116.293502.40
    922021.09.03 04:39sell470.201810.530.001806.77
    932021.09.03 08:30close460.201811.790.001804.14-3.083499.32
    942021.09.03 15:34close470.201818.030.001806.77-150.003349.32
    952021.09.03 15:34sell480.201817.540.001806.17
    962021.09.03 15:37close480.201825.040.001806.17-150.003199.32
    972021.09.07 13:15sell490.201810.900.001786.66
    982021.09.07 17:01sell500.201808.280.001782.29
    992021.09.08 16:54t/p490.201786.660.001786.66488.923688.25
    1002021.09.14 15:30t/p500.201782.290.001782.29548.654236.90
    1012021.11.05 18:45buy510.201814.320.001857.75
    1022021.11.10 16:24t/p510.201857.750.001857.75842.065078.96
    1032021.11.22 19:45sell520.201810.200.001755.21
    1042021.11.23 04:15sell530.201807.780.001757.35
    1052021.11.23 08:48sell540.201803.200.001790.24
    1062021.11.23 15:07t/p540.201790.240.001790.24259.205338.16
    1072021.11.26 09:54close530.201807.790.001757.3520.415358.57
    1082021.11.26 12:03close520.201810.210.001755.2124.535383.10
    1092021.12.27 18:00buy550.201812.970.001827.60
    1102021.12.28 08:00buy560.201813.190.001822.48
    1112021.12.28 13:01buy570.201818.480.001832.73
    1122021.12.28 16:09close570.201810.980.001832.73-150.005233.10
    1132021.12.28 19:00close550.201810.530.001827.60-57.655175.46
    1142021.12.28 19:00buy580.201811.040.001813.04
    1152021.12.28 20:54close560.201805.680.001822.48-150.205025.26
    1162021.12.29 10:07close580.201803.540.001813.04-158.854866.41
    1172021.12.30 19:00buy590.201813.810.001839.84
    1182022.01.03 15:09close590.201813.790.001839.84-18.094848.32
    1192022.01.03 16:00sell600.201806.970.001776.15
    1202022.01.04 17:00close600.201811.710.001776.15-90.684757.64
    1212022.01.04 17:45buy610.201817.000.001844.21
    1222022.01.04 19:30buy620.201814.580.001838.16
    1232022.01.05 15:30buy630.201823.000.001835.98
    1242022.01.05 21:09close610.201816.980.001844.21-9.254748.40
    1252022.01.05 21:09close630.201815.500.001835.98-150.004598.40
    1262022.01.05 21:09close620.201814.570.001838.16-9.054589.35
    1272022.01.05 22:30sell640.201810.000.001780.84
    1282022.01.11 08:16close640.201810.010.001780.8424.534613.88
    1292022.01.11 18:30buy650.201815.660.001836.02
    1302022.01.13 17:51close650.201815.650.001836.02-35.584578.30
    1312022.01.18 12:00sell660.201810.270.001791.81
    1322022.01.18 15:30sell670.201806.890.001783.36
    1332022.01.18 15:34close670.201814.390.001783.36-150.004428.30
    1342022.01.18 15:37close660.201817.770.001791.81-150.004278.30
    1352022.01.19 05:15sell680.201810.740.001797.05
    1362022.01.19 07:00sell690.201811.540.001805.36
    1372022.01.19 12:34close680.201818.240.001797.05-150.004128.30
    1382022.01.19 12:37close690.201819.040.001805.36-150.003978.30
    1392022.01.19 12:37sell700.201818.550.001805.80
    1402022.01.19 16:37close700.201826.050.001805.80-150.003828.30
    1412022.01.27 09:00sell710.201810.600.001776.66
    1422022.01.27 13:15sell720.201810.700.001793.86
    1432022.01.27 15:49sell730.201801.610.001779.70
    1442022.01.27 16:39close730.201809.110.001779.70-150.003678.30
    1452022.01.27 18:24t/p720.201793.860.001793.86336.804015.10
    1462022.02.02 17:24close710.201810.610.001776.6616.294031.39
    1472022.02.04 12:30buy740.201814.010.001827.66
    1482022.02.04 15:30buy750.201813.280.001824.05
    1492022.02.04 15:36close740.201806.510.001827.66-150.003881.39
    1502022.02.04 15:36close750.201805.780.001824.05-150.003731.39
    1512022.02.07 02:45buy760.201812.790.001843.32
    1522022.02.07 11:00buy770.201813.360.001822.92
    1532022.02.07 21:24buy780.201822.380.001840.10
    1542022.02.07 21:37t/p770.201822.920.001822.92191.203922.59
    1552022.02.10 15:33close780.201822.370.001840.10-44.433878.16
    1562022.02.11 20:34t/p760.201843.320.001843.32557.524435.68
    1572022.05.13 16:15sell790.201802.800.001764.16
    1582022.05.13 17:01close790.201810.310.001764.16-150.204285.48
    1592022.05.13 19:00sell800.201808.990.001779.64
    1602022.05.16 02:00sell810.201810.840.001796.49
    1612022.05.16 03:58close800.201816.500.001779.64-146.084139.40
    1622022.05.16 05:01sell820.201812.910.001807.12
    1632022.05.16 08:05t/p820.201807.120.001807.12115.804255.20
    1642022.05.16 08:05sell830.201806.620.001791.70
    1652022.05.16 10:43t/p810.201796.490.001796.49287.004542.20
    1662022.05.16 10:51t/p830.201791.700.001791.70298.404840.60
    1672022.05.18 06:30sell840.201808.180.001785.79
    1682022.05.18 10:00sell850.201809.610.001794.63
    1692022.05.18 10:28close840.201815.680.001785.79-150.004690.60
    1702022.05.18 11:12close850.201817.120.001794.63-150.204540.40
    1712022.05.18 15:15sell860.201808.580.001791.15
    1722022.05.18 16:43close860.201816.080.001791.15-150.004390.40
    1732022.06.14 19:00sell870.201810.290.001778.72
    1742022.06.14 21:30sell880.201810.070.001778.17
    1752022.06.15 04:38close880.201817.580.001778.17-146.084244.32
    1762022.06.15 05:20close870.201817.790.001778.72-145.884098.45
    1772022.06.15 05:20sell890.201817.300.001812.70
    1782022.06.15 12:40close890.201824.800.001812.70-150.003948.45
    1792022.06.30 13:45sell900.201810.240.001792.95
    1802022.06.30 15:37close900.201817.740.001792.95-150.003798.45
    1812022.06.30 18:00sell910.201808.930.001784.98
    1822022.06.30 20:06sell920.201809.330.001786.62
    1832022.07.01 08:31sell930.201800.240.001786.49
    1842022.07.01 14:39t/p920.201786.620.001786.62458.324256.77
    1852022.07.01 14:39t/p930.201786.490.001786.49275.004531.77
    1862022.07.01 15:24t/p910.201784.980.001784.98483.125014.89
    1872022.12.13 16:30buy940.201818.880.001875.10
    1882022.12.13 17:47close940.201811.380.001875.10-150.004864.89
    1892022.12.13 18:45buy950.201813.260.001859.03
    1902022.12.13 19:25close950.201805.760.001859.03-150.004714.89
    1912022.12.20 17:15buy960.201820.830.001871.25
    1922022.12.21 06:43close960.201813.330.001871.25-158.854556.04
    1932022.12.21 09:30buy970.201815.340.001820.13
    1942022.12.21 14:00buy980.201814.050.001816.90
    1952022.12.21 15:13t/p980.201816.900.001816.9057.004613.04
    1962022.12.21 17:07t/p970.201820.130.001820.1395.804708.84
    1972022.12.22 16:15sell990.201807.890.001789.40
    1982022.12.22 20:02t/p990.201789.400.001789.40369.805078.64
    1992022.12.27 17:30buy1000.201821.690.001850.33
    2002022.12.27 19:56close1000.201814.190.001850.33-150.004928.64
    2012022.12.27 20:15buy1010.201814.980.001833.55
    2022022.12.28 03:30buy1020.201814.640.001832.70
    2032022.12.28 09:03close1010.201807.470.001833.55-159.054769.60
    2042022.12.28 09:16buy1030.201809.440.001810.49
    2052022.12.28 10:00t/p1030.201810.490.001810.4921.004790.60
    2062022.12.28 10:08close1020.201807.130.001832.70-150.204640.40
    2072022.12.29 17:00buy1040.201814.300.001828.75
    2082022.12.29 18:45buy1050.201814.670.001829.67
    2092022.12.30 09:01buy1060.201821.980.001831.55
    2102022.12.30 12:31close1060.201814.470.001831.55-150.204490.20
    2112022.12.30 18:38close1040.201814.280.001828.75-9.254480.95
    2122023.01.03 01:07t/p1050.201829.670.001829.67273.464754.41
    2132023.02.24 18:15sell1070.201809.460.001784.47
    2142023.02.24 20:00sell1080.201809.720.001785.12
    2152023.02.27 16:00close1070.201816.960.001784.47-145.884608.54
    2162023.02.27 16:08sell1090.201814.370.001811.82
    2172023.02.27 16:22close1080.201817.220.001785.12-145.884462.66
    2182023.02.28 09:22t/p1090.201811.820.001811.8255.124517.78
    2192023.02.28 10:00sell1100.201810.360.001797.04
    2202023.02.28 12:00sell1110.201810.170.001796.57
    2212023.02.28 16:46close1110.201817.670.001796.57-150.004367.78
    2222023.02.28 16:47close1100.201817.860.001797.04-150.004217.78
    2232023.02.28 16:47sell1120.201817.370.001816.92
    2242023.02.28 16:51t/p1120.201816.920.001816.929.004226.78
    2252023.03.08 05:15sell1130.201809.930.001774.74
    2262023.03.08 16:32close1130.201817.430.001774.74-150.004076.78
    +
    diff --git a/Docs/Reports/XTPW/Full/StrategyTester 1.gif b/Docs/Reports/XTPW/Full/StrategyTester 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..dabf25d4cfc60174ad3603702df31da6b9706319 GIT binary patch literal 7717 zcmch6g;N{f_jb?*cZwG;ZY>tH)XWYCcR`X3FA@Fqla3$hi} z*52{+S7%puPj6rUz#w{Pcx1E^Z(?$4dS-TReqnKGd1ZBNePeTLduMkKvwv`SbbNAp z_WRHI#ov=!yd3DYZl6AGRrM7S4aZ_q+?tvW1(!0KK7Rd~HiP8d!r#b(CxM(Q zk?)uiHr2!V-oTR561Fs>L_f7nG9?!GevmELTkQW)^7<*WI8o!{2E8|$FCX$HH$2vR ztB&`*Iw8^;fTvAF9x)J!0R%n0M=Ln7@OJDRU4W+Bx5 z_xq^e2PMY|Ul+rhwYG?VdOBM)YJ?=T{7^p2bJ|eSL{XED4*6hi3RV_V7&?zYnks{F zl@I9^7ffYjIHEVy|COt${^1&ou<4v<>ihong&jnOhmw<)PQ_ADHefLH1y4eC>-BJV zDN8t$utja|K+3EUlVmduWHfTtS>VlGf&=oNZffJL8>0N`g5E3uZHCJ~V1e?m%Zz{d?CD3!>^6RxE; zBol)gM34xOOPP7nw|2}CvvdGdV|lwc35Xw!>IQQ%q74eLocn7L=>#&l)CK@qrdj}{ z{A#UbB0$?Sm=dU4`xHQOLcL8HT(nh0DW_`_kXko3wVnDka&H@N;?GGyrln3I0jd7- zYA5Xdydi(Uga=^9=sRY$I5k+WADsP}5wvY)cLhu_? zCx#Ml6&Dv_7%Du7PfGNo>WLp#dD50oWdLNZ1@hvTPY5Vw0W=kOMVcV{61?1LzPu;z zSRR&=cg)!*I}w+QBzH5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G!>Tagf#?zh3oOpc(rfc zP5~6vCxM$~zXGn1)1zoB0(kmKP+Hm=r@dS&6Mk+m-{hx>gxp^`v!kZ2pIIm&c?h2E z=G%;=@up)_Q2m`q-VxUEg+D zu(6gseKtQFYuvfMFL%}V^!oI3(mVEt&3u|f)@QElOoj|fG@2S}XE9ZT`drL{5MA3N ze{x_U-i6$tX2@V_gTfbquyi#`;xXC*UP}P^9?6%ZdiO-^O%dXFb16f`d@R(@i2O0 z=HzFi5~Qt;S0l85Y+}iHE^&L>PMc&C%WK8vDiK=l(hr5^R9ii7^(H3+VIf~$LNM>X zs-4I5nCx<=%r_J@)+Qn>w>OKu&|iJEO2#Iq8!O9!=6+5df?XJTBG0#Qey2)NS1YLz zqfs3LyQ;%WQvs1)*&34ikQSjWE_raT&a4oC+`vB4LUhewF#26xy+x&EGlZm<)Fm+4 z_ko4Jx;UYnTUH)Q#AYfKFp+>?n;*(;{idREV%)Z&;!Bn-c0jJ0c{&%mV0t}UTG1ay z6O(uAfLXUyUM2q6bfJ~!Xy+~5ZsgE1Syk;?6SZ_;>yBJJtafiFTRw?&Z`~BF@f?X- U{!{LbI&i4*UfEAm1ppNO4>l~Z)c^nh literal 0 HcmV?d00001 diff --git a/Docs/Reports/XTPW/Full/StrategyTester 1.htm b/Docs/Reports/XTPW/Full/StrategyTester 1.htm new file mode 100644 index 0000000..e6ae90d --- /dev/null +++ b/Docs/Reports/XTPW/Full/StrategyTester 1.htm @@ -0,0 +1,169 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit209.11Gross profit297.85Gross loss-88.73
    Profit factor3.36Expected payoff4.18
    Absolute drawdown5.97Maximal drawdown30.04 (2.64%)Relative drawdown2.64% (30.04)
    Total trades50Short positions (won %)35 (85.71%)Long positions (won %)15 (93.33%)
    Profit trades (% of total)44 (88.00%)Loss trades (% of total)6 (12.00%)
    Largestprofit trade22.02loss trade-15.49
    Averageprofit trade6.77loss trade-14.79
    Maximumconsecutive wins (profit in money)10 (74.81)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)74.81 (10)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins6consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 17:39sell10.011836.610.001825.20
    22020.12.07 10:37t/p10.011825.200.001825.2011.631011.63
    32021.01.29 16:54sell20.011865.800.001855.99
    42021.01.29 19:22t/p20.011855.990.001855.999.811021.44
    52021.02.09 17:45sell30.011841.990.001838.33
    62021.02.09 18:09t/p30.011838.330.001838.333.661025.10
    72021.02.10 17:00sell40.011841.300.001827.41
    82021.02.11 19:09t/p40.011827.410.001827.4114.551039.65
    92021.02.16 17:09sell50.011804.040.001801.47
    102021.02.16 18:49t/p50.011801.470.001801.472.571042.22
    112021.03.03 16:51sell60.011712.530.001708.07
    122021.03.03 17:36t/p60.011708.070.001708.074.461046.68
    132021.03.11 16:48buy70.011719.900.001728.00
    142021.03.11 20:09t/p70.011728.000.001728.008.101054.78
    152021.03.17 13:48buy80.011728.340.001737.00
    162021.03.17 20:06t/p80.011737.000.001737.008.661063.44
    172021.04.19 15:15buy90.011775.900.001781.90
    182021.04.21 04:39t/p90.011781.900.001781.905.031068.46
    192021.04.27 18:24buy100.011778.420.001784.35
    202021.04.28 12:24close100.011763.420.001784.35-15.491052.98
    212021.05.10 17:45sell110.011839.580.001833.85
    222021.05.11 03:39t/p110.011833.850.001833.855.951058.93
    232021.05.19 22:00buy120.011863.460.001881.95
    242021.05.20 19:49t/p120.011881.950.001881.9517.031075.96
    252021.07.06 19:07buy130.011794.080.001807.68
    262021.07.07 13:24t/p130.011807.680.001807.6813.111089.07
    272021.07.08 18:04buy140.011801.930.001814.59
    282021.07.13 15:39t/p140.011814.590.001814.5911.201100.27
    292021.07.13 17:21sell150.011811.750.001808.46
    302021.07.13 20:37t/p150.011808.460.001808.463.291103.56
    312021.08.17 17:15buy160.011782.680.001787.76
    322021.08.18 04:09t/p160.011787.760.001787.764.591108.16
    332021.08.20 17:39sell170.011781.750.001777.75
    342021.08.23 03:16t/p170.011777.750.001777.754.221112.38
    352021.08.31 15:30sell180.011811.860.001809.11
    362021.08.31 16:04t/p180.011809.110.001809.112.751115.13
    372021.10.27 18:09sell190.011793.560.001789.11
    382021.10.28 16:30close190.011808.560.001789.11-14.341100.78
    392021.11.03 04:00sell200.011783.060.001779.26
    402021.11.03 08:15t/p200.011779.260.001779.263.801104.58
    412021.11.30 17:48sell210.011794.770.001781.02
    422021.11.30 18:04t/p210.011781.020.001781.0213.751118.33
    432021.12.13 16:49sell220.011785.140.001782.99
    442021.12.14 10:24t/p220.011782.990.001782.992.371120.70
    452021.12.15 16:54sell230.011769.740.001766.01
    462021.12.15 17:39t/p230.011766.010.001766.013.731124.43
    472021.12.20 17:01sell240.011793.800.001789.41
    482021.12.20 22:09t/p240.011789.410.001789.414.391128.82
    492021.12.21 16:52buy250.011793.790.001799.79
    502021.12.22 20:09t/p250.011799.790.001799.795.511134.34
    512022.01.18 18:19sell260.011813.030.001806.19
    522022.01.19 16:51close260.011828.030.001806.19-14.781119.55
    532022.02.15 11:19buy270.011856.930.001866.99
    542022.02.16 19:19t/p270.011866.990.001866.999.571129.13
    552022.02.18 17:33sell280.011895.770.001893.21
    562022.02.18 17:37t/p280.011893.210.001893.212.561131.69
    572022.03.02 18:16sell290.011921.470.001907.56
    582022.03.03 13:34close290.011936.470.001907.56-14.341117.35
    592022.04.22 19:22sell300.011936.790.001932.93
    602022.04.22 20:28t/p300.011932.930.001932.933.861121.21
    612022.04.26 16:08sell310.011905.800.001905.21
    622022.04.26 16:57t/p310.011905.210.001905.210.591121.80
    632022.06.10 16:01sell320.011839.900.001834.17
    642022.06.10 16:18t/p320.011834.170.001834.175.731127.53
    652022.07.20 16:52sell330.011708.520.001702.79
    662022.07.20 19:48t/p330.011702.790.001702.795.731133.26
    672022.08.02 18:02sell340.011776.930.001767.92
    682022.08.02 21:02t/p340.011767.920.001767.929.011142.27
    692022.09.30 20:35buy350.011663.130.001667.34
    702022.10.03 04:30t/p350.011667.340.001667.343.721145.99
    712022.11.02 21:03sell360.011647.760.001626.40
    722022.11.03 10:26t/p360.011626.400.001626.4022.021168.01
    732022.11.30 17:18buy370.011751.890.001763.12
    742022.11.30 21:20t/p370.011763.120.001763.1211.231179.24
    752022.12.09 17:23buy380.011791.230.001800.19
    762022.12.09 18:20t/p380.011800.190.001800.198.961188.20
    772023.01.11 17:38buy390.011870.980.001874.94
    782023.01.11 19:21t/p390.011874.940.001874.943.961192.16
    792023.01.12 17:10sell400.011884.680.001867.96
    802023.01.12 21:03close400.011899.680.001867.96-15.001177.16
    812023.02.07 16:32sell410.011869.860.001868.93
    822023.02.07 16:45t/p410.011868.930.001868.930.931178.09
    832023.02.09 17:00sell420.011879.160.001868.22
    842023.02.09 18:03t/p420.011868.220.001868.2210.941189.03
    852023.03.02 20:35sell430.011835.870.001834.80
    862023.03.03 21:27close430.011850.870.001834.80-14.781174.25
    872023.04.26 19:17buy440.011989.040.001995.12
    882023.04.27 05:13t/p440.011995.120.001995.124.621178.87
    892023.05.15 17:34sell450.012016.660.002011.32
    902023.05.16 09:04t/p450.012011.320.002011.325.561184.43
    912023.05.26 17:09sell460.011951.200.001949.72
    922023.05.26 17:19t/p460.011949.720.001949.721.481185.91
    932023.06.07 17:32sell470.011958.950.001947.93
    942023.06.07 18:51t/p470.011947.930.001947.9311.021196.93
    952023.07.13 18:04sell480.011959.610.001957.54
    962023.07.13 18:51t/p480.011957.540.001957.542.071199.00
    972023.07.19 18:12sell490.011974.940.001970.18
    982023.07.20 17:35t/p490.011970.180.001970.185.421204.41
    992023.07.25 15:30sell500.011958.580.001953.88
    1002023.07.25 17:00t/p500.011953.880.001953.884.701209.11
    +
    diff --git a/Docs/Reports/XTPW/Long/StrategyTester Long 13.gif b/Docs/Reports/XTPW/Long/StrategyTester Long 13.gif new file mode 100644 index 0000000000000000000000000000000000000000..36be70dfeb3e67e84aafd8cf408b5b95cb88f39b GIT binary patch literal 7329 zcmc(D^;Zr-dFKPb@1*WTEu%3QX@KE-kODuB~ruZf#?CcK7xV4v&ui z{yRB6JA~t9;$Pop+yHKO=%SYtKisE&I2Rwi{7RktvHSpC%*q?J2hVOXXW-nIf7lhk zpBQ7;ltZ|*GUAhB*Hyy=&6_6};|h8{OXP0P^;H#Wyk-)%diRkK^jP-}-wWU0%R^PxI>U zer^@T!$Ypl2U^R`p;y}K>(sCA5z}yobA3Ib2_lITG-_>?3V1@!!fc!|kWC;?nL@wB z)#wo&Kxv>qtUcK0__(g}>2k)sx)Y8`mz~Q~JJ1Ub3U(S=g|D&_eyE^#9I<6hmqT4e z%pr{Y7Vxb8#2Ev|XZ6&e5%7#NkJfFhLnDzUq~_)~0(NmqyjL)6U1xOf`Welf?Z5lV z%0`6rv1Xj47Gq{l4rdu4#3UO^kf5n=p=7@cttF<2c_g`Ck`U@~JpmCEiR9q%!>RO1 zg~IhhiFwGLo4C_8wayYUw*nNSI6K)12t`LU1K8;Y^m1|RJIkTT1TV6v^Z*i!Z~%qW z68vi%K+QdX0;map4InczK=q@aE zWayyvx&6l70GkFb*rftUfOel{`WJfX4HLTy&?_5PZj!?EBoYg&1fl_^r-ga=2xb^z zIN^FhK|c0Du^ZuGp>9|u;nPxg8rWnC;Ke0RcFe*d0fhvBx)?8CRocD~FKdb``{gI* zr$uC~v-Sz!31I>WUGyxQWhmzU0H{B}Za>+UEsHbPYpj>=v4)&>Img+HSYeJU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3KUs10}Km86am9Qz1APVFPdL{c`SA7 z%<)~WwlbGnp^_$#{q5)HUmwqtSLU&+ml1u7*Z!dLEn!hp@ji*a88n}LQJ>f{$s$t4 zGCB6=-S57&|8%NDx#XduV-f4Cx>Xw+YS>o1!g~IFm&}3c!vFHMxs$V3e)um=kZ{bBF45&D$z_uXY zVo+*dwLwZ4NrQhYQ)#t~=8j2Yb{5K^;lQ@9?Lps=r|{!73;%sYaz=Yu)l^Pfv@9o+7Sgu+p4t+{a0vhEx>Kb&ubPr$L7QKl-diUk8d=n|+}@gx82C33_= zZ<_jMumoM}*R*n5aNKX)J?G5*hV~dX62Pi{h?3yH5$?hXJ0**@3!^r9NO)GswX_cDp{tB6?XuGB|qJ) z`L!AwZTWmjZjUBR`2~SQTy*cnv0h<+zw*Ek=CCJ}&51zzLsro@k z=0d|xv8X0u7Sa@n*pF-4|GHhfn8>qHxf6U@%l4hEaR)_-FWav;?W6J+CgAupt%pzO zn#cYs15`t*=}U4NE8>70{iqaG*D|l`TXzw~I_NR~DL}#Z`T!??HH8_X@cU=(@11vL z3ag%$)TGk%i40vhW0jCOiiz^={<6f8$l0nU0K)kVi0I9U#I$L75nBekbOFojS~LT9 z4fHEb0SEL_UU(xxCaUJQvcF!9OBFj6@Gor;w&j0(GaT?L%^dist&P>v->;rO=P2V_ z$2<72zxKT)5*@21_JS1|rL@l9lD%X)$uOg8;#Q)!)UanJC4tkJ48DhMf@rs)A5BuL zT;IRElSOOMc&zErF^non92ZNFDX-G@DJ$y?Qqy?^uJZmv6dcbI;aSLXa$grIshkqx z1y68h;rDiHo>#=>wtmIPf&gaO&tvmhKQo=VwHd3Asa2Qc3p#;NMp$P^({8@7FY$mG oiAz$aK*6&p(7;zdm*fHa0?|z3L2Ff)lnKI;0&#aHAVB8-0A-yVZvX%Q literal 0 HcmV?d00001 diff --git a/Docs/Reports/XTPW/Long/StrategyTester Long 13.htm b/Docs/Reports/XTPW/Long/StrategyTester Long 13.htm new file mode 100644 index 0000000..bb47461 --- /dev/null +++ b/Docs/Reports/XTPW/Long/StrategyTester Long 13.htm @@ -0,0 +1,103 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.02 06:00 (2020.01.01 - 2023.08.31)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=true; +allowShortTrades=false; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63374Ticks modelled72620713Modelling qualityn/a
    Mismatched charts errors809
    Initial deposit1000.00SpreadCurrent (57)
    Total net profit91.72Gross profit107.20Gross loss-15.49
    Profit factor6.92Expected payoff5.40
    Absolute drawdown0.80Maximal drawdown21.17 (2.03%)Relative drawdown2.03% (21.17)
    Total trades17Short positions (won %)0 (0.00%)Long positions (won %)17 (94.12%)
    Profit trades (% of total)16 (94.12%)Loss trades (% of total)1 (5.88%)
    Largestprofit trade17.03loss trade-15.49
    Averageprofit trade6.70loss trade-15.49
    Maximumconsecutive wins (profit in money)13 (89.63)consecutive losses (loss in money)1 (-15.49)
    Maximalconsecutive profit (count of wins)89.63 (13)consecutive loss (count of losses)-15.49 (1)
    Averageconsecutive wins8consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12021.03.11 16:48buy10.011719.900.001725.30
    22021.03.11 17:07t/p10.011725.300.001725.305.401005.40
    32021.03.17 13:48buy20.011728.340.001737.00
    42021.03.17 20:06t/p20.011737.000.001737.008.661014.06
    52021.04.19 15:15buy30.011775.900.001779.90
    62021.04.20 19:24t/p30.011779.900.001779.903.511017.57
    72021.04.27 18:24buy40.011778.420.001784.35
    82021.04.28 12:24close40.011763.420.001784.35-15.491002.09
    92021.05.19 22:00buy50.011863.460.001881.95
    102021.05.20 19:49t/p50.011881.950.001881.9517.031019.12
    112021.07.06 19:07buy60.011794.080.001807.68
    122021.07.07 13:24t/p60.011807.680.001807.6813.111032.23
    132021.07.08 18:04buy70.011801.930.001814.59
    142021.07.13 15:39t/p70.011814.590.001814.5911.201043.43
    152021.08.17 17:15buy80.011782.680.001786.06
    162021.08.17 17:24t/p80.011786.060.001786.063.381046.81
    172021.12.21 16:52buy90.011793.790.001799.79
    182021.12.22 20:09t/p90.011799.790.001799.795.511052.33
    192022.02.15 11:19buy100.011856.930.001863.63
    202022.02.16 16:39t/p100.011863.630.001863.636.211058.54
    212022.04.26 17:36buy110.011901.340.001904.58
    222022.04.26 17:38t/p110.011904.580.001904.583.241061.78
    232022.09.30 20:35buy120.011663.130.001665.93
    242022.10.03 04:23t/p120.011665.930.001665.932.311064.09
    252022.11.30 17:18buy130.011751.890.001763.12
    262022.11.30 21:20t/p130.011763.120.001763.1211.231075.32
    272022.12.09 17:23buy140.011791.230.001800.19
    282022.12.09 18:20t/p140.011800.190.001800.198.961084.28
    292023.01.11 17:38buy150.011870.980.001873.62
    302023.01.11 18:51t/p150.011873.620.001873.622.641086.92
    312023.04.26 19:17buy160.011989.040.001993.09
    322023.04.27 04:34t/p160.011993.090.001993.092.591089.52
    332023.07.13 19:00buy170.011955.090.001957.29
    342023.07.13 19:18t/p170.011957.290.001957.292.201091.72
    +
    diff --git a/Docs/Reports/XTPW/Short/StrategyTester 13.gif b/Docs/Reports/XTPW/Short/StrategyTester 13.gif new file mode 100644 index 0000000000000000000000000000000000000000..8e75c527d0ac1523fb04af79e4730a0d4bf87ed4 GIT binary patch literal 7848 zcmc(BWmg+a*L9H6;93fySaB#)oZwWDLV+r7r8osji$jBl1PL14-8De);_hw%3dOCs z<>9*DAMwtbnRV7a`|Pu4=F2FnzLu0S6~*fTYybdQEEWI&3=9llQT<@VG0MUMbq}E| zz=(Ok{la4B5#W0WWpU5E4*}Tu88Dz6a6iE_|Br_~Mu7hZ0Qyn)N$|}4|A+v91?s-^ zzW5$OS(JmD5ZHAK@VzF&0%g&3FAV_ngTYPMdlXPU|34Lra)8A;_MVPty6fRp!Fn{mH0)e`3g8-xE?}PiT>An(i5B3AV{r9ZKasST|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O z{Uj6MO-C64dGT0s)=XN?FTA(jAMXRjQ|ZQsp{*H5k3>{6Xn&5rKKn@-F0GQW*2oQ) z#8n7w8eyX!?CAo7GN0I*2Qp3SDCz#tj%bZvV_|}H>q%C6M}A;uzntlL6GzEt$Zr1B zc=Xjvy)}kV^)*_q0(eBaAkoL-P6;9UNM9i(f5@Lqw%@uG^5K@`#KSzfB=n#mohT`p- zF?pYW`H;(kChSw9SS4b%`YNN%G8F7(9$$x1AT$G#ln)Arn%c60L0Z((sYlVbH;W1! zTTpK~n#71hE`P4Kq#x@>(A@TQS zrOds}b?It7m`M;`e63x9^b5a_@2jbcGwV1dF9@|AFyuK?FE`E$`zRYgr#UJqJRCD1 zqN=6XJnR~;k$fcpovTz1dGrb^1%tuA1I3Hp_7KukfttHk*TOt&Y(V4NY9qORERIdQ zGE>S^R>HWUb#&e4YjYB#L76H0wk2#TMKh7FPaG=O@g=q2%qS~-D)92&|^z+N1_@QnZNc3c9}a?!D^YDx*CqfdJ|M1L2Yt8UO$Q literal 0 HcmV?d00001 diff --git a/Docs/Reports/XTPW/Short/StrategyTester 13.htm b/Docs/Reports/XTPW/Short/StrategyTester 13.htm new file mode 100644 index 0000000..b78cc40 --- /dev/null +++ b/Docs/Reports/XTPW/Short/StrategyTester 13.htm @@ -0,0 +1,139 @@ + + + + Strategy Tester: x-saherelm.ea + + + + + + + +
    +
    Strategy Tester Report
    +
    x-saherelm.ea
    +
    Alpari-Demo (Build 1382)

    + + + + + + + + + + + + + + + + + + + + + + +
    SymbolXAUUSD (Gold (Spot))
    Period15 Minutes (M15) 2020.11.25 18:30 - 2023.08.01 23:45 (2020.01.01 - 2023.08.02)
    ModelEvery tick (the most precise method based on all available least timeframes)
    ParameterssignalPrefix="XST_EA"; bullishSignalLabel="X_BUY"; bullishSignalColor=Aqua; bearishSignalLabel="X_SELL"; bearishSignalColor=Magenta; signalEntryColor=Aquamarine; signalSLColor=Red; signalTPColor=Green; candleGapBetweenSignals=7; allowTrade=true; +allowLongTrades=false; +allowShortTrades=true; +alertEvents=true; +alertPositions=true; +longPositionAlerts=true; +shortPositionAlerts=true; +terminalAlert=false; +pushAlert=false; +lotsPerTradePercent=0.00001; maxOpenTrades=4; maxDrawdownPercentPerPTrade=0.1; minBalancePercent=0.5; maxEquityPercent=0.1; xStarter="- X Signal Provider -"; enableXSignalling=false; +xShortR2R=3; xShortLotsPerTradePercent=0.00001; xShortMaxDrawdownPerTradePercent=0.02; xLongR2R=3; xLongLotsPerTradePercent=0.00001; xLongMaxDrawdownPerTradePercent=0.02; xSharpDetectorFactor=700; xMaximumCandlesPerTrade=206; xOscillatorLength=7; xPSarStep=0.02; xPSarMaximum=0.2; xRangeMarketLength=5; xSwingLength=7; xRStarter="- XR Signal Provider -"; enableXRSignalling=false; +xRShortR2R=2; xRShortLotsPerTradePercent=0.00001; xRShortMaxDrawdownPerTradePercent=0.01; xRLongR2R=2; xRLongLotsPerTradePercent=0.00001; xRLongMaxDrawdownPerTradePercent=0.01; xRMaximumCandlesPerTrade=252; xROscillatorLength=7; xRFastLength=20; xRSlowLength=50; xRRangeMarketLength=50; xRSwingLength=7; xTPWStarter="- XTPW Signal Provider -"; enableXTPWSignalling=true; +xTPWShortR2R=2; xTPWShortLotsPerTradePercent=0.00001; xTPWShortMaxDrawdownPerTradePercent=0.015; xTPWLongR2R=2; xTPWLongLotsPerTradePercent=0.00001; xTPWLongMaxDrawdownPerTradePercent=0.015; xTPWMaximumCandlesPerTrade=206; xTPWPSarStep=0.02; xTPWPSarMaximum=0.2; xTPWSwingLength=7; xTPWSharpDetectionFactor=650;
    Bars in test63353Ticks modelled72601176Modelling qualityn/a
    Mismatched charts errors808
    Initial deposit1000.00SpreadCurrent (59)
    Total net profit109.29Gross profit182.54Gross loss-73.25
    Profit factor2.49Expected payoff3.12
    Absolute drawdown5.99Maximal drawdown31.30 (2.90%)Relative drawdown2.90% (31.30)
    Total trades35Short positions (won %)35 (85.71%)Long positions (won %)0 (0.00%)
    Profit trades (% of total)30 (85.71%)Loss trades (% of total)5 (14.29%)
    Largestprofit trade22.02loss trade-15.00
    Averageprofit trade6.08loss trade-14.65
    Maximumconsecutive wins (profit in money)10 (62.88)consecutive losses (loss in money)1 (-15.00)
    Maximalconsecutive profit (count of wins)62.88 (10)consecutive loss (count of losses)-15.00 (1)
    Averageconsecutive wins5consecutive losses1
    +Graph
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #TimeTypeOrderSizePriceS / LT / PProfitBalance
    12020.12.04 17:39sell10.011836.610.001825.20
    22020.12.07 10:37t/p10.011825.200.001825.2011.631011.63
    32021.01.29 16:54sell20.011865.800.001855.99
    42021.01.29 19:22t/p20.011855.990.001855.999.811021.44
    52021.02.09 17:45sell30.011841.990.001838.33
    62021.02.09 18:09t/p30.011838.330.001838.333.661025.10
    72021.02.10 17:00sell40.011841.300.001827.41
    82021.02.11 19:09t/p40.011827.410.001827.4114.551039.65
    92021.02.16 17:09sell50.011804.040.001801.47
    102021.02.16 18:49t/p50.011801.470.001801.472.571042.22
    112021.03.03 16:51sell60.011712.530.001708.07
    122021.03.03 17:36t/p60.011708.070.001708.074.461046.68
    132021.05.10 17:45sell70.011839.580.001833.85
    142021.05.11 03:39t/p70.011833.850.001833.855.951052.63
    152021.07.13 17:21sell80.011811.750.001808.46
    162021.07.13 20:37t/p80.011808.460.001808.463.291055.92
    172021.08.20 17:39sell90.011781.750.001777.75
    182021.08.23 03:16t/p90.011777.750.001777.754.221060.13
    192021.08.31 15:30sell100.011811.860.001809.11
    202021.08.31 16:04t/p100.011809.110.001809.112.751062.88
    212021.10.27 18:09sell110.011793.560.001789.11
    222021.10.28 16:30close110.011808.560.001789.11-14.341048.54
    232021.11.03 04:00sell120.011783.060.001779.26
    242021.11.03 08:16t/p120.011779.260.001779.263.801052.34
    252021.11.30 17:48sell130.011794.770.001781.02
    262021.11.30 18:04t/p130.011781.020.001781.0213.751066.09
    272021.12.13 16:49sell140.011785.140.001782.99
    282021.12.14 10:24t/p140.011782.990.001782.992.371068.46
    292021.12.15 16:54sell150.011769.740.001766.01
    302021.12.15 17:39t/p150.011766.010.001766.013.731072.19
    312021.12.20 17:01sell160.011793.800.001789.41
    322021.12.20 22:09t/p160.011789.410.001789.414.391076.58
    332022.01.18 18:19sell170.011813.030.001806.19
    342022.01.19 16:51close170.011828.030.001806.19-14.781061.80
    352022.02.18 17:33sell180.011895.770.001893.21
    362022.02.18 17:37t/p180.011893.210.001893.212.561064.36
    372022.03.02 18:16sell190.011921.470.001907.56
    382022.03.03 13:34close190.011936.470.001907.56-14.341050.02
    392022.04.22 19:22sell200.011936.790.001932.93
    402022.04.22 20:28t/p200.011932.930.001932.933.861053.88
    412022.04.26 16:08sell210.011905.800.001905.21
    422022.04.26 16:57t/p210.011905.210.001905.210.591054.47
    432022.06.10 16:01sell220.011839.900.001834.17
    442022.06.10 16:18t/p220.011834.170.001834.175.731060.20
    452022.07.20 16:52sell230.011708.520.001702.79
    462022.07.20 19:48t/p230.011702.790.001702.795.731065.93
    472022.08.02 18:02sell240.011776.930.001767.92
    482022.08.02 21:02t/p240.011767.920.001767.929.011074.94
    492022.11.02 21:03sell250.011647.760.001626.40
    502022.11.03 10:26t/p250.011626.400.001626.4022.021096.95
    512023.01.12 17:10sell260.011884.680.001867.96
    522023.01.12 21:03close260.011899.680.001867.96-15.001081.95
    532023.02.07 16:32sell270.011869.860.001868.93
    542023.02.07 16:45t/p270.011868.930.001868.930.931082.88
    552023.02.09 17:00sell280.011879.160.001868.22
    562023.02.09 18:03t/p280.011868.220.001868.2210.941093.82
    572023.03.02 20:35sell290.011835.870.001834.78
    582023.03.03 21:27close290.011850.870.001834.78-14.781079.04
    592023.05.15 17:34sell300.012016.660.002011.32
    602023.05.16 09:05t/p300.012011.320.002011.325.561084.60
    612023.05.26 17:09sell310.011951.200.001949.72
    622023.05.26 17:19t/p310.011949.720.001949.721.481086.08
    632023.06.07 17:32sell320.011958.950.001947.93
    642023.06.07 18:51t/p320.011947.930.001947.9311.021097.10
    652023.07.13 18:04sell330.011959.610.001957.54
    662023.07.13 18:51t/p330.011957.540.001957.542.071099.17
    672023.07.19 18:12sell340.011974.940.001970.18
    682023.07.20 17:35t/p340.011970.180.001970.185.421104.59
    692023.07.25 15:30sell350.011958.580.001953.88
    702023.07.25 17:00t/p350.011953.880.001953.884.701109.29
    +
    diff --git a/Docs/Signalling Conditions.md b/Docs/Signalling Conditions.md new file mode 100644 index 0000000..ac8aec4 --- /dev/null +++ b/Docs/Signalling Conditions.md @@ -0,0 +1,501 @@ +# OSC Signalling Conditions + +there are some Verifications For signals. +here i described them. + +## Long + +- OSC +- When Market Middleage Cross Over MC Fast +- When MCFast Under MC Slow +- When MakretMiddleage + +```mql4 + // // + // // XMA Based Signals ... + // hasLongSignal = + // // + // // XMA ... + // // + // // SC Fast Cross Over Market Middleage ... + // xmaState.scFast > xmaState.marketMiddleage + // && !(xmaState.scFastPrev > xmaState.marketMiddleage) + // // + // // when Short Cycle is Trending Up ... + // && xmaState.scFast > xmaState.scSlow + // && xmaState.scFastPrev > xmaState.scSlowPrev + // // + // // When Medium Cycle is Trending Up ... + // && xmaState.mcFast > xmaState.mcSlow + // && xmaState.mcFastPrev > xmaState.mcSlowPrev + // // + // // and Medium Cycle TrendPower is Going Up ... + // && MathAbs(xmaState.mcFast - xmaState.mcSlow) > + // MathAbs(xmaState.mcFastPrev - xmaState.mcSlowPrev) + // // + // // When Long Cycle is Trending Up ... + // && xmaState.lcFast > xmaState.lcSlow + // && xmaState.lcFastPrev > xmaState.lcSlowPrev + // // + // // and Long Cycle TrendPower is Going Up ... + // && MathAbs(xmaState.lcFast - xmaState.lcSlow) > + // MathAbs(xmaState.lcFastPrev - xmaState.lcSlowPrev) + // // + // // Short Cycle Slow bigger thhan Medium Cycle Fast ... + // && xmaState.scSlow > xmaState.mcFast + // // + // // OSC ... + // // Check OSC Fast and Slow is Less than 0.5 ... + // && oscState.fastOSC < 0.5 + // && oscState.slowOSC < 0.5 + // && oscState.fastOSCPrev < 0.5 + // && oscState.slowOSCPrev < 0.5 + // && oscState.fastOSC > oscState.fastOSCPrev + // // + // // Check OSC Minimum Signal Power ... + // // this Helps for Detect Market exits from Ranging ... + // && minPowOSC > 0 + // ? + // // + // // Check Conditions only if value provided ... + // oscState.powerOSCPrev < 0 + // && MathAbs(oscState.powerOSCPrev) > minPowOSC + // : + // // + // // ... other wise, ignore ... + // true + // // + // // Check Previous Candle Signal Power must be Lower than + // // Current Signal Power and the Direction Must be Up Trend ... + // && oscState.powerOSCPrev < oscState.powerOSC + // // + // // Also we Have to Check Market not ranging ... + // && !IsOSCMarketRanging( + // bar_index + 1, + // marketLen, + // minPowOSC, + // fastOSCLen, + // fastOSCMul, + // slowOSCLen, + // slowOSCMul + // ) + // // + // // ZIGZAG ... + // && zigZagState.isWaitForTrendDown + // && !zigZagState.isWaitForTrendUp + // // + // // XADX ... + // // TODO: add XADX Base Conditions for Long Trades ... + // // When ADX Trend Power bigger than 20 and less than 50 ... + // && !adxState.trendPower < 23 + // && !adxState.trendPowerPrev < 23 + // // + // // Check Trend Direction for Signals ... + // && adxState.upDirection > adxState.downDirection + // && adxState.upDirectionPrev > adxState.downDirectionPrev + // // && adxState.trendPower < 50 + // // && adxState.trendPower > adxState.trendPowerPrev + // // + // // PRICE Checking ... + // // price must be less than Candle High at openning time ... + // && longEntryPrice <= candleHigh + // // + // // also Candle High and Low must be above than lc Fast & lc Slow ... + // && longEntryPrice > xmaState.lcFast + // && longEntryPrice > xmaState.lcSlow + // && ( + // !IsSharpBullishHappens( + // bar_index, + // marketLen * 2 + // ) + // || IsSharpBearishHappens( + // bar_index, + // marketLen * 2 + // ) + // ) + // ; + + // + // Check for Long Trades if some Sharp Bullish Happens, + // Decrease sl size for fixing tps ... + // if (isSharpBullishHappens) { + // sl = sl / 1.5; + // } + + // + // TODO: Remove this ... + // if (xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage) { + // r2rRatio = r2rRatio * 2; + // } + + // + hasLongSignal = + // + // Global ... + true + // + && ( + // + // XMA ... + ( + // + true + // + // Check Medium Cycle is in TrendDown ... + && xmaStates[0].mcSlow > xmaStates[0].mcFast + && xmaStates[1].mcSlow > xmaStates[1].mcFast + && xmaStates[2].mcSlow > xmaStates[2].mcFast + // + // Check Market Middleage Cross Over MC Slow ... + // && isMarketMiddleCrossOverMCSlow + // && xmaStates[0].marketMiddleage >= (5 * _Point); + && xmaStates[0].marketMiddleage > xmaStates[0].mcSlow + && !(xmaStates[1].marketMiddleage >= xmaStates[1].mcSlow) + // + // IMPORTANT: by passing this condition i can Increase r2r ration ... + // && xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[0].marketMiddleage - xmaStates[1].marketMiddleage) > _Point + ) + // || + // + // OSC ... + // ( + // // + // true + // // + // // Check osc fast cross over slow ... + // && oscStates[1].fastOSC > oscStates[1].slowOSC + // && !(oscStates[2].fastOSC >= oscStates[2].slowOSC) + // // + // // Check OSC Fast bigger than 0.5 ... + // && oscStates[1].fastOSC > 0.5 + // && ( + // xmaStates[1].mcFast > xmaStates[1].mcSlow + // ? + // // + // xmaStates[1].marketMiddleage > xmaStates[1].mcSlow + // // + // && xmaStates[1].marketMiddleage > xmaStates[2].marketMiddleage + // && xmaStates[1].marketMiddleage > xmaStates[3].marketMiddleage + // && xmaStates[2].marketMiddleage > xmaStates[3].marketMiddleage + // : + // true + // ) + // ) + ) + ; +``` + +```mql4 + // + // TODO: Determines Where and How close Long Trades on Trend Reversal Points ... + closeLongTrades = + false + // + // This is One Conditions ... + // ( + // // + // xmaStates[0].marketMiddleage < xmaStates[0].mcFast + // && ( + // xmaStates[0].marketMiddleage < xmaStates[0].mcSlow + // || xmaStates[1].marketMiddleage < xmaStates[1].mcSlow + // || xmaStates[2].marketMiddleage < xmaStates[2].mcSlow + // ) + // // + // && xmaStates[0].mcFast > xmaStates[0].mcSlow + // // + // && xmaStates[0].marketMiddleage < xmaStates[1].marketMiddleage + // && xmaStates[1].marketMiddleage < xmaStates[2].marketMiddleage + // ) + ; + + // + waitForLongSignals = + true; + // waitForLongSignals + // ? + // // + // true + // // + // // Closing Options ... + // // + // // Trades Doesnt Closed ... + // && !closeLongTrades + // // + // // PRICE ... + // // + // // Bullish Sharp doesnt occured ... + // && !isSharpBullishHappens + // // + // // XMA ... + // // + // && xmaStates[0].marketMiddleage < xmaStates[0].mcFast + // && !( + // // + // // On MC Trend Up ... + // xmaStates[0].mcFast > xmaStates[0].mcSlow + // ? + // // + // // Market Middleage doesnt Trending Down ... + // xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[1].marketMiddleage - xmaStates[1].mcFast + // && xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[2].marketMiddleage - xmaStates[2].mcFast + // && xmaStates[0].marketMiddleage - xmaStates[0].mcFast > xmaStates[3].marketMiddleage - xmaStates[3].mcFast + // && xmaStates[1].marketMiddleage - xmaStates[1].mcFast > xmaStates[3].marketMiddleage - xmaStates[3].mcFast + // : + // true + // ) + // : + // // + // true + // && ( + // // + // // PRICE ... + // // isSharpBearishHappens + // // + // // XMA ... + // isMCFastCrossUnderSlow + // || isMarketMiddleCrossUnderMCSlow + // ) + ; +``` + +```mql4 + // + bool xmaHasLongSignal = + // + // Global ... + true + // + // XMA ... + // + // Check Medium Cycle is in TrendDown ... + // && xmaStates[0].mcSlow > xmaStates[0].mcFast + // && xmaStates[1].mcSlow > xmaStates[1].mcFast + // && xmaStates[2].mcSlow > xmaStates[2].mcFast + // + // Check Market Middleage Cross Over MC Slow ... + && isMarketMiddleageTrendUp + // + // Check distance between Medium Cycle Market + && isMarketMiddleCrossOverMCSlow + // && xmaStates[0].marketMiddleage > xmaStates[0].mcSlow + // && MathAbs(xmaStates[1].marketMiddleage - xmaStates[2].mcSlow) > _Point + // + // IMPORTANT: by passing this condition i can Increase r2r ration ... + // && xmaStates[0].marketMiddleage > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[1].marketMiddleage - xmaStates[2].marketMiddleage) > _Point + // + // OSC ... + && oscStates[1].fastOSC > 0.5 + && !isOSCPowerTrendDown + && oscStates[1].powerOSC > 0 + // + // PRICE ... + && !isSharpBullishHappens + && longEntryPrice < marketHigh[0] + && marketHigh[0] > marketHigh[1] + && marketHigh[0] > marketHigh[2] + ; + + // + bool oscHasLongSignal = + // + false + // + // OSC ... + // + // Check osc is Trending Up ... + // isOSCTrendUp + // + // Check osc fast cross over slow ... + // isOSCFastCrossOverSlow + // + // Check OSC Market not Ranging ... + // && !isOSCMarketRanging + // + // Check OSC Fast bigger than 0.5 ... + // && oscStates[1].fastOSC > 0.5 + // && oscStates[1].slowOSC > 0.5 + // + // PRICE ... + // && !isSharpBullishHappens + // && longEntryPrice < marketHigh[0] + // && marketHigh[0] > marketHigh[1] + // && marketHigh[0] > marketHigh[2] + ; + + // + bool hasLongSignal = + xmaHasLongSignal + || + oscHasLongSignal + ; +``` + +```mql4 + // + bool hasLongSignal = + // + // Global ... + true + // + && + // XMA ... + // + // Check Parabolic Sar Cross Under Market Middleage + // Or Trending Down ... + isParabolicCrossUnderMarketMiddle + && + // + // Check PSar Value is Bigger Than Market Middleage ... + xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + && + // + // Check Parabolic Revrse Change bigger than Prev Cancle Close ... + xmaStates[1].parabolicSAR < MathMin(marketOpen[1], marketClose[1]) + && + // + // Now We Have Separate our Conditions based on + // Market Trends ... + // + // Medium Cycle Market Trends Up ... + isMCTrendUp + ? + ( + // + // Market Middle must be in Trending Up ... + isMarketMiddleageTrendUp + && + // + // Market Middle Must be less than Maximum in Cycle ... + xmaStates[1].marketMiddleage < marketMiddlesMinMax.max + && + // + // Market Middleage must be above of MC Fast ... + xmaStates[1].marketMiddleage > xmaStates[1].mcFast + && + // + // Check Distance between SC Fast and Market Middle ... + MathAbs(xmaStates[1].scFast - xmaStates[1].scSlow) > (3 * _Point) + // + // Minimum Signal Power of OSC ... + // MathAbs(oscStates[1].powerOSC > minPowOSC) + ) + : + // + // Medium Cycle Market Trends Down ... + false + // () + ; +``` + +```mql4 + // + // Based On MC Market Trend Up ... + // + // Based On MC Market Down Trend ... + // isMCTrendDown + // || isMCFastCrossUnderSlow + // ? + // ( + // + // Find SC Fast Cross Over SC Slow, which happens betweentwo of SC Fast Under SC Slow ... + // isSCFastCrossOverSlow + + // // + // // Find the Moment which Market Middleage Cross Over MC Fast ... + // isMarketMiddleCrossOverMCFast + // // + // // Check Parabolix SAR for Long Trades ... + // && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + // && xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + // // + // // Check Market Middle and Parabolic SAR Distance ... + // && MathAbs(xmaStates[1].marketMiddleage - xmaStates[1].parabolicSAR) >= 1 + // // + // // Check Distance between MCSlow and MCFast bigger than MarketMiddle and Parabolic SAR ... + // && MathAbs(xmaStates[1].mcFast - xmaStates[1].mcSlow) > MathAbs(xmaStates[1].marketMiddleage - xmaStates[1].parabolicSAR) + // ) + // : + // // + // // Based On MC Market Up Trend ... + // false +``` + +```mql4 + // + oscHasLongSignal = + // + oscStates[0].fastOSC > oscStates[0].slowOSC + && ( + ( + oscStates[0].fastOSC > 0.5 + && oscStates[0].fastOSC < 0.75 + ) + || oscStates[0].fastOSC <= 0.5 + ) + && ( + oscStates[0].powerOSC > 0 + || oscStates[1].powerOSC > 0 + ) + // + && xmaStates[0].scFast > xmaStates[0].marketMiddleage + && MathAbs(xmaStates[0].scFast - xmaStates[0].marketMiddleage) > (20 * _Point) + // + && xmaStates[1].scFast > xmaStates[1].marketMiddleage + && MathAbs(xmaStates[1].scFast - xmaStates[1].marketMiddleage) > (20 * _Point) + // + && xmaStates[2].scFast > xmaStates[2].marketMiddleage + // + && xmaStates[0].mcFast > xmaStates[0].mcSlow + && MathAbs(xmaStates[0].mcFast - xmaStates[0].mcSlow) > (50 * _Point) + // + && xmaStates[0].mcFast < xmaStates[0].scFast + && xmaStates[0].mcFast < xmaStates[0].parabolicSAR + // + && xmaStates[0].parabolicSAR < xmaStates[0].marketMiddleage + && xmaStates[1].parabolicSAR < xmaStates[1].marketMiddleage + // + && !isSharpBullishHappens + // + && longEntryPrice > xmktStates[0].highestLow + && longEntryPrice > xmaStates[0].marketMiddleage + // + && xmktStates[0].highestLow > xmaStates[0].scFast + && xmktStates[0].lowestHigh < xmaStates[0].scFast + && xmktStates[0].lowestHigh < xmaStates[0].marketMiddleage + ; +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` + +```mql4 +``` diff --git a/Docs/x-saherelm.ea.x.full.set b/Docs/x-saherelm.ea.x.full.set new file mode 100644 index 0000000..31d34d3 --- /dev/null +++ b/Docs/x-saherelm.ea.x.full.set @@ -0,0 +1,276 @@ +signalPrefix=XST_EA +bullishSignalLabel=X_BUY +bullishSignalColor=16776960 +bearishSignalLabel=X_SELL +bearishSignalColor=16711935 +signalEntryColor=13959039 +signalSLColor=255 +signalTPColor=32768 +candleGapBetweenSignals=7 +candleGapBetweenSignals,F=0 +candleGapBetweenSignals,1=6 +candleGapBetweenSignals,2=0 +candleGapBetweenSignals,3=0 +allowTrade=1 +allowTrade,F=0 +allowTrade,1=0 +allowTrade,2=1 +allowTrade,3=1 +allowLongTrades=1 +allowLongTrades,F=0 +allowLongTrades,1=0 +allowLongTrades,2=1 +allowLongTrades,3=1 +allowShortTrades=1 +allowShortTrades,F=0 +allowShortTrades,1=0 +allowShortTrades,2=1 +allowShortTrades,3=1 +alertEvents=1 +alertEvents,F=0 +alertEvents,1=0 +alertEvents,2=1 +alertEvents,3=1 +alertPositions=1 +alertPositions,F=0 +alertPositions,1=0 +alertPositions,2=1 +alertPositions,3=1 +longPositionAlerts=1 +longPositionAlerts,F=0 +longPositionAlerts,1=0 +longPositionAlerts,2=1 +longPositionAlerts,3=1 +shortPositionAlerts=1 +shortPositionAlerts,F=0 +shortPositionAlerts,1=0 +shortPositionAlerts,2=1 +shortPositionAlerts,3=1 +terminalAlert=0 +terminalAlert,F=0 +terminalAlert,1=0 +terminalAlert,2=1 +terminalAlert,3=1 +pushAlert=0 +pushAlert,F=0 +pushAlert,1=0 +pushAlert,2=1 +pushAlert,3=1 +lotsPerTradePercent=0.00001000 +lotsPerTradePercent,F=0 +lotsPerTradePercent,1=0.00030000 +lotsPerTradePercent,2=0.00000000 +lotsPerTradePercent,3=0.00000000 +maxOpenTrades=4 +maxOpenTrades,F=0 +maxOpenTrades,1=4 +maxOpenTrades,2=0 +maxOpenTrades,3=0 +maxDrawdownPercentPerPTrade=0.01500000 +maxDrawdownPercentPerPTrade,F=0 +maxDrawdownPercentPerPTrade,1=0.30000000 +maxDrawdownPercentPerPTrade,2=0.00000000 +maxDrawdownPercentPerPTrade,3=0.00000000 +minBalancePercent=0.50000000 +minBalancePercent,F=0 +minBalancePercent,1=0.50000000 +minBalancePercent,2=0.00000000 +minBalancePercent,3=0.00000000 +maxEquityPercent=0.10000000 +maxEquityPercent,F=0 +maxEquityPercent,1=0.10000000 +maxEquityPercent,2=0.00000000 +maxEquityPercent,3=0.00000000 +xStarter=- X Signal Provider - +enableXSignalling=1 +enableXSignalling,F=0 +enableXSignalling,1=0 +enableXSignalling,2=1 +enableXSignalling,3=1 +xShortR2R=2.50000000 +xShortR2R,F=0 +xShortR2R,1=2.50000000 +xShortR2R,2=0.00000000 +xShortR2R,3=0.00000000 +xShortLotsPerTradePercent=0.00002000 +xShortLotsPerTradePercent,F=0 +xShortLotsPerTradePercent,1=0.00002000 +xShortLotsPerTradePercent,2=0.00000000 +xShortLotsPerTradePercent,3=0.00000000 +xShortMaxDrawdownPerTradePercent=0.04000000 +xShortMaxDrawdownPerTradePercent,F=0 +xShortMaxDrawdownPerTradePercent,1=0.02000000 +xShortMaxDrawdownPerTradePercent,2=0.00000000 +xShortMaxDrawdownPerTradePercent,3=0.00000000 +xLongR2R=2.50000000 +xLongR2R,F=0 +xLongR2R,1=2.50000000 +xLongR2R,2=0.00000000 +xLongR2R,3=0.00000000 +xLongLotsPerTradePercent=0.00002000 +xLongLotsPerTradePercent,F=0 +xLongLotsPerTradePercent,1=0.00002000 +xLongLotsPerTradePercent,2=0.00000000 +xLongLotsPerTradePercent,3=0.00000000 +xLongMaxDrawdownPerTradePercent=0.04000000 +xLongMaxDrawdownPerTradePercent,F=0 +xLongMaxDrawdownPerTradePercent,1=0.02000000 +xLongMaxDrawdownPerTradePercent,2=0.00000000 +xLongMaxDrawdownPerTradePercent,3=0.00000000 +xMaximumCandlesPerTrade=206 +xMaximumCandlesPerTrade,F=0 +xMaximumCandlesPerTrade,1=504 +xMaximumCandlesPerTrade,2=0 +xMaximumCandlesPerTrade,3=0 +xOscillatorLength=7 +xOscillatorLength,F=0 +xOscillatorLength,1=7 +xOscillatorLength,2=0 +xOscillatorLength,3=0 +xPSarStep=0.02000000 +xPSarStep,F=0 +xPSarStep,1=0.02000000 +xPSarStep,2=0.00000000 +xPSarStep,3=0.00000000 +xPSarMaximum=0.20000000 +xPSarMaximum,F=0 +xPSarMaximum,1=0.20000000 +xPSarMaximum,2=0.00000000 +xPSarMaximum,3=0.00000000 +xRangeMarketLength=5 +xRangeMarketLength,F=0 +xRangeMarketLength,1=35 +xRangeMarketLength,2=0 +xRangeMarketLength,3=0 +xSwingLength=7 +xSwingLength,F=0 +xSwingLength,1=7 +xSwingLength,2=0 +xSwingLength,3=0 +xRStarter=- XR Signal Provider - +enableXRSignalling=0 +enableXRSignalling,F=0 +enableXRSignalling,1=0 +enableXRSignalling,2=1 +enableXRSignalling,3=1 +xRShortR2R=2.00000000 +xRShortR2R,F=0 +xRShortR2R,1=2.00000000 +xRShortR2R,2=0.00000000 +xRShortR2R,3=0.00000000 +xRShortLotsPerTradePercent=0.00001000 +xRShortLotsPerTradePercent,F=0 +xRShortLotsPerTradePercent,1=0.00001000 +xRShortLotsPerTradePercent,2=0.00000000 +xRShortLotsPerTradePercent,3=0.00000000 +xRShortMaxDrawdownPerTradePercent=0.01000000 +xRShortMaxDrawdownPerTradePercent,F=0 +xRShortMaxDrawdownPerTradePercent,1=0.01000000 +xRShortMaxDrawdownPerTradePercent,2=0.00000000 +xRShortMaxDrawdownPerTradePercent,3=0.00000000 +xRLongR2R=2.00000000 +xRLongR2R,F=0 +xRLongR2R,1=2.00000000 +xRLongR2R,2=0.00000000 +xRLongR2R,3=0.00000000 +xRLongLotsPerTradePercent=0.00001000 +xRLongLotsPerTradePercent,F=0 +xRLongLotsPerTradePercent,1=0.00001000 +xRLongLotsPerTradePercent,2=0.00000000 +xRLongLotsPerTradePercent,3=0.00000000 +xRLongMaxDrawdownPerTradePercent=0.01000000 +xRLongMaxDrawdownPerTradePercent,F=0 +xRLongMaxDrawdownPerTradePercent,1=0.01000000 +xRLongMaxDrawdownPerTradePercent,2=0.00000000 +xRLongMaxDrawdownPerTradePercent,3=0.00000000 +xRMaximumCandlesPerTrade=252 +xRMaximumCandlesPerTrade,F=0 +xRMaximumCandlesPerTrade,1=252 +xRMaximumCandlesPerTrade,2=0 +xRMaximumCandlesPerTrade,3=0 +xROscillatorLength=7 +xROscillatorLength,F=0 +xROscillatorLength,1=7 +xROscillatorLength,2=0 +xROscillatorLength,3=0 +xRFastLength=20 +xRFastLength,F=0 +xRFastLength,1=20 +xRFastLength,2=0 +xRFastLength,3=0 +xRSlowLength=50 +xRSlowLength,F=0 +xRSlowLength,1=50 +xRSlowLength,2=0 +xRSlowLength,3=0 +xRRangeMarketLength=50 +xRRangeMarketLength,F=0 +xRRangeMarketLength,1=50 +xRRangeMarketLength,2=0 +xRRangeMarketLength,3=0 +xRSwingLength=7 +xRSwingLength,F=0 +xRSwingLength,1=7 +xRSwingLength,2=0 +xRSwingLength,3=0 +xTPWStarter=- XTPW Signal Provider - +enableXTPWSignalling=0 +enableXTPWSignalling,F=0 +enableXTPWSignalling,1=0 +enableXTPWSignalling,2=1 +enableXTPWSignalling,3=1 +xTPWShortR2R=1.50000000 +xTPWShortR2R,F=0 +xTPWShortR2R,1=1.50000000 +xTPWShortR2R,2=0.00000000 +xTPWShortR2R,3=0.00000000 +xTPWShortLotsPerTradePercent=0.00001000 +xTPWShortLotsPerTradePercent,F=0 +xTPWShortLotsPerTradePercent,1=0.00001000 +xTPWShortLotsPerTradePercent,2=0.00000000 +xTPWShortLotsPerTradePercent,3=0.00000000 +xTPWShortMaxDrawdownPerTradePercent=0.01000000 +xTPWShortMaxDrawdownPerTradePercent,F=0 +xTPWShortMaxDrawdownPerTradePercent,1=0.01000000 +xTPWShortMaxDrawdownPerTradePercent,2=0.00000000 +xTPWShortMaxDrawdownPerTradePercent,3=0.00000000 +xTPWLongR2R=1.50000000 +xTPWLongR2R,F=0 +xTPWLongR2R,1=1.50000000 +xTPWLongR2R,2=0.00000000 +xTPWLongR2R,3=0.00000000 +xTPWLongLotsPerTradePercent=0.00001000 +xTPWLongLotsPerTradePercent,F=0 +xTPWLongLotsPerTradePercent,1=0.00001000 +xTPWLongLotsPerTradePercent,2=0.00000000 +xTPWLongLotsPerTradePercent,3=0.00000000 +xTPWLongMaxDrawdownPerTradePercent=0.01000000 +xTPWLongMaxDrawdownPerTradePercent,F=0 +xTPWLongMaxDrawdownPerTradePercent,1=0.01000000 +xTPWLongMaxDrawdownPerTradePercent,2=0.00000000 +xTPWLongMaxDrawdownPerTradePercent,3=0.00000000 +xTPWMaximumCandlesPerTrade=206 +xTPWMaximumCandlesPerTrade,F=0 +xTPWMaximumCandlesPerTrade,1=206 +xTPWMaximumCandlesPerTrade,2=0 +xTPWMaximumCandlesPerTrade,3=0 +xTPWPSarStep=0.02000000 +xTPWPSarStep,F=0 +xTPWPSarStep,1=0.02000000 +xTPWPSarStep,2=0.00000000 +xTPWPSarStep,3=0.00000000 +xTPWPSarMaximum=0.20000000 +xTPWPSarMaximum,F=0 +xTPWPSarMaximum,1=0.20000000 +xTPWPSarMaximum,2=0.00000000 +xTPWPSarMaximum,3=0.00000000 +xTPWSwingLength=7 +xTPWSwingLength,F=0 +xTPWSwingLength,1=7 +xTPWSwingLength,2=0 +xTPWSwingLength,3=0 +xTPWSharpDetectionFactor=700.00000000 +xTPWSharpDetectionFactor,F=0 +xTPWSharpDetectionFactor,1=700.00000000 +xTPWSharpDetectionFactor,2=0.00000000 +xTPWSharpDetectionFactor,3=0.00000000 diff --git a/Experts/x-saherelm.ea.mq4 b/Experts/x-saherelm.ea.mq4 new file mode 100644 index 0000000..7af93af --- /dev/null +++ b/Experts/x-saherelm.ea.mq4 @@ -0,0 +1,1116 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XST Strategy Expert Advisor +// --------------------------------------------- +// saherelm implementation of strategy expert advisor ... +// in this EA, we try to combine multiple tools, to ashive best +// results ... +// +// ShortName: XST +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +989121694056 +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XST Strategy Expert Advisor" +#property strict + +// +// START Inputs ... +// +// +// Signal Prefixe ... +input string signalPrefix = "XST_EA"; // Signal Prefix + +// +// Signal Draw Specifications ... +input string bullishSignalLabel = "X_BUY"; // Bullish Signal Label +input color bullishSignalColor = clrAqua; // Bullish Signal Color + +// +input string bearishSignalLabel = "X_SELL"; // Bearish Signal Label +input color bearishSignalColor = clrFuchsia; // Bearish Signal Color + +// +input color signalEntryColor = clrAquamarine; // Signal Entry Ptice Color +input color signalSLColor = clrRed; // Signal SL Color +input color signalTPColor = clrGreen; // Signal TP Color + +// +input int candleGapBetweenSignals = 7; // How many Candle waits to new Signal from last one + +// +// Trade ... +input bool allowTrade = true; // Allow Trade Based on given Signals +input bool allowLongTrades = true; // Allow Long Trades +input bool allowShortTrades = true; // Allow Short Trades + +// +// Balance and Finanical Specifications ... +input double lotsPerTradePercent = 0.00001; // Lots Per Trade Percent +input int maxOpenTrades = 4; // Maximum Open Trade +input double maxDrawdownPercentPerPTrade = 0.1; // Maximum DrawDown Per Trade +input double minBalancePercent = 0.5; // Minimum Balance for Trading +input double maxEquityPercent = 0.1; // Maximum Trade Equity + +// +// START Global Definitions: Variables, Properties and etc ... +// +int lastSignalledBar = 0; + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// TODO: Complete this ... +// Include Dialog Handler ... +// #include "../Libraries/x-saherelm.dialog.mq4" + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.signal.lib.mq4" + +// +// Add Logging Inputs ... +// +input string xAlertingLabel = "- Alerts -"; // --> Alerts <-- + +// +// Alerts ... + +// +// Alert Bot Events ... +input bool logEvents = true; // Log Events +input bool alertEvents = true; // Alert Events + +// +// Alert Types ... +input bool terminalAlert = false; // Terminal Alert +input bool pushAlert = false; // Push Notification Alerts + +// +// Positions ... +input bool alertPositions = true; // Alert Positions +input bool longPositionAlerts = true; // Alert Long Positions +input bool shortPositionAlerts = true; // Alert Short Positions + +// +input bool enableNewDayAlert = true; // New Day Alert +input bool enableNewHourAlert = true; // New Hour Alert + +// +int maxMarketLength = 0; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Validate Inputs ... + bool inputsNotValiid = + // + // EA ... + maxOpenTrades <= 0 + || maxEquityPercent < 0 + || minBalancePercent < 0 + || lotsPerTradePercent < 0 + || maxDrawdownPercentPerPTrade < 0 + ; + + // + if (inputsNotValiid) { + return INIT_PARAMETERS_INCORRECT; + } + + // + totalSignals = 0; + totalLongSignals = 0; + totalShortSignals = 0; + + // + initialBalance = 0; + + // + // START Define Array Series ... + // + // + // END Define Array Series ... + // + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "XST"; + + // + ClearSignalConditions(); + + // + maxMarketLength = MathMax(0, GetDailyCandleCount()); + + // + // TODO: Complete this ... + // try to Create App Window ... + // CreateDialog(logTag); + + // + return INIT_SUCCEEDED; +} + +// +// DeInitialization ... +void OnDeinit(const int reason) { + // + // TODO: Complete this ... + // Destroy Dialog ... + // DestroyDialog(reason); +} + +// +// Handling Chart Events ... +void OnChartEvent( + const int id, // event ID + const long& lparam, // event parameter of the long type + const double& dparam, // event parameter of the double type + const string& sparam // event parameter of the string type +) { + // + // TODO: Complete this ... + // DialogChartEvent( + // id, + // lparam, + // dparam, + // sparam + // ); +} + +// +// Ticker Event Handler ... +void OnTick() { + // + isNewDay = IsNewDay(); + if ( + isNewDay + && enableNewDayAlert + ) { + // + SendAlert( + StringConcatenate( + "New Day ..." + ) + ); + } + + // + isNewHour = IsNewHour(); + if ( + isNewHour + && enableNewHourAlert + ) { + // + SendAlert( + StringConcatenate( + "New Hour ..." + ) + ); + } + + // + // Process Signals to Open Positions ... + ProcessSignals(); + + // + // Checking State for Signal Handling ... + CheckState(); + + // + // Process Open Positions for Trailing Stop Loss or Close ... + ProcessOpenPositions(); +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Check State for Signal Handling ... +void CheckState() { + // + // Here we Must to Check Market State for enable or disable + // Signal Handlers and also make dection to close all long/short + // trades ... +} + +// +// Calculate Signals and Process Based on Exists Signals ... +void ProcessSignals() { + // + XSignalRequest request = {}; + request.type = X_SIGNAL_NONE; + request.hasSignal = false; + + // + // Prevent Multiple Calculating on Same Bars ... + isNewBar = IsNewBar(); + if (isNewBar) { + countedBars++; + } + + // + if (countedBars < maxMarketLength) { + return; + } + + // + bool allowDoTrade = true; + + // + // Check Balance ... + if (initialBalance > 0) { + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double minimumBalanceForTrade = + balance > initialBalance + ? + minBalancePercent * balance + : + minBalancePercent * initialBalance; + + // + // Retrieve Account Equity ... + double equity = AccountInfoDouble(ACCOUNT_EQUITY); + double maxAllowedEquity = balance - (balance * maxEquityPercent); + + // + // Retrieve Free Marigin ... + double freeMargin = AccountFreeMargin(); + double maximumMariginRisk = balance - (balance * maxEquityPercent); + + // + if ( + // + // Do not Open Positions if equity not passed ... + equity < maxAllowedEquity || + // + // Do not Open Positions if free margin not passed ... + freeMargin <= maximumMariginRisk || + // + // Do not open positions if balance less than minimum ... + balance <= minimumBalanceForTrade + ) { + // + static bool tradingPauseAlerted; + + // + allowDoTrade = false; + + // + if (!tradingPauseAlerted) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Balance: ", balance, + ", Equity: ", equity, + ", FreeMargin: ", freeMargin + ); + + // + LogMessage(message); + SendAlert(message); + + // + tradingPauseAlerted = true; + } + } + } + + // + // Retrieve Signal Exists ... + request = GenerateSignal(0); + + // + // Prevent doing anything else, if there is no signals ... + if ( + !allowDoTrade || + !request.hasSignal || + request.type == X_SIGNAL_NONE + ) { + return; + } + + // + bool hasLongSignal = request.type == X_SIGNAL_LONG; + + // + // Check last Signalled Bar with Counted Bars ... + // Prevent Multiple Signalling on Same Bar ... + bool isInLastSignalledBars = false; + for (int i=0; i < candleGapBetweenSignals; i++) { + // + isInLastSignalledBars = + isInLastSignalledBars + || lastSignalledBar == countedBars - i + ; + } + if (isInLastSignalledBars) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + return; + } + + // + // increase last signalled bar ... + lastSignalledBar = countedBars; + + // + // Calculate Can Trade or not ... + allowDoTrade = allowTrade + && ( + hasLongSignal ? + allowLongTrades : + allowShortTrades + ); + + // + // Chack Maximum Open Positions ... + int openTrades = CountOpenTrades(); + if (maxOpenTrades > 0) { + // + if (openTrades >= maxOpenTrades) { + // + allowDoTrade = false; + + // + if (!allowDoTrade) { + // + string message = StringConcatenate( + "Trading Pause => ", + "Max Open Trades (", + maxOpenTrades, + ") reached ..." + ); + + // + LogMessage(message); + SendAlert(message); + } + } + } + + // + // Check Trading is Enable or not ... + // nothing to do if trading is disabled ... + if (!allowDoTrade) { + // + // Clear Signal Conditions ... + if (hasLongSignal) { + ClearLongSignalConditions(); + } else { + ClearShortSignalConditions(); + } + + // + string message = StringConcatenate( + "Trading Not Allowed ..." + ); + + // + LogMessage(message); + SendAlert(message); + return; + } + + // + // Retrieve Signal Lots Per Trade ... + double lPTradePercent = GetSignalLottage( + request.signal, + lotsPerTradePercent + ); + + // + bool isPositionOpened = TradeSignal( + request.signal, + lPTradePercent, + // + bullishSignalLabel, + bullishSignalColor, + bearishSignalLabel, + bearishSignalColor + ); + + // + totalSignals++; + if (hasLongSignal) { + // + totalLongSignals++; + ClearLongSignalConditions(); + } else { + // + totalShortSignals++; + ClearShortSignalConditions(); + } + + // + if (isPositionOpened) { + // + bool canAlert = + alertPositions + && ( + hasLongSignal ? + longPositionAlerts + : + shortPositionAlerts + ); + + // + if (canAlert) { + // + // Alert Message ... + string message = StringConcatenate( + "Trade on Signal ID: ", request.signal.id, + ", ProvidedBy: ", GetSignalProviderIdentifier(request.signal.provider), + ", Entry: ", request.signal.entry, + ", TP: ", request.signal.tp + ); + + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } + } +} + +// +// Process All Open Positions ... +void ProcessOpenPositions() { + // + // XSignalling ... + if (enableXSignalling) { + // + // Close All XXX Provided Signals on it's Specific Condition ... + if (xCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XXX_PROVIDER); + + // + xCloseLongTrades = false; + } + + // + if (xCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XXX_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XXX_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xMaximumCandlesPerTrade, + X_XXX_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xFailedSignals++; + } + } + + // + // XR Signalling ... + if (enableXRSignalling) { + // + if (xRCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XR_PROVIDER); + + // + xRCloseLongTrades = false; + } + + // + if (xRCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XR_PROVIDER); + + // + xRCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XR_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xRShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XR_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xRMaximumCandlesPerTrade, + X_XR_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xRFailedSignals++; + } + } + + // + // XTPW Signalling ... + if (enableXTPWSignalling) { + // + if (xTPWCloseLongTrades) { + // + CloseAllProviderLongTrades(X_XTPW_PROVIDER); + + // + xTPWCloseLongTrades = false; + } + + // + if (xTPWCloseShortTrades) { + // + CloseAllProviderShortTrades(X_XTPW_PROVIDER); + + // + xTPWCloseShortTrades = false; + } + + // + // Close Maximum DrawDown Passed Trades ... + + // + // Longs ... + bool hasClosedLongInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWLongMaxDrawdownPerTradePercent, + X_SIGNAL_LONG, + X_XTPW_PROVIDER + ); + + // + // Shorts ... + bool hasClosedShortInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + xTPWShortMaxDrawdownPerTradePercent, + X_SIGNAL_SHORT, + X_XTPW_PROVIDER + ); + + // + // Close All Long Time Trades based on Provider provided Length ... + bool hasClosedLongTimeTrade = CloseAllLongTimeTrades( + xTPWMaximumCandlesPerTrade, + X_XTPW_PROVIDER + ); + + // + if ( + hasClosedLongTimeTrade + || hasClosedLongInDrawDownLongTrade + || hasClosedShortInDrawDownLongTrade + ) { + xTPWFailedSignals++; + } + } + + // + // Close Maximum DrawDown Passed Trades ... + // this is the Maximum Controller ... + // + double maxOfXPercent = enableXSignalling ? + MathMax( + xLongMaxDrawdownPerTradePercent, + xShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXRPercent = enableXRSignalling ? + MathMax( + xRLongMaxDrawdownPerTradePercent, + xRShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxOfXTPWPercent = enableXTPWSignalling ? + MathMax( + xTPWLongMaxDrawdownPerTradePercent, + xTPWShortMaxDrawdownPerTradePercent + ) : 0 + ; + + // + double maxDrawDownPercent = MathMax( + maxOfXPercent, + maxOfXRPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxOfXTPWPercent + ); + maxDrawDownPercent = MathMax( + maxDrawDownPercent, + maxDrawdownPercentPerPTrade + ); + + // + // we Calculate Max DrawDown Percent Per Trade ... + // then try to Close based on them ... + bool hasClosedInDrawDownLongTrade = CloseAllMaximumDrawDownPassedTrades( + maxDrawDownPercent + ); +} + +// +// Send Special Type of Alerts ... +void SendAlert(string message) { + // + if ( + !logEvents + && !alertEvents + ) { + return; + } + + // + // Log Handling ... + if (logEvents) { + LogMessage(message); + } + + // + // Alert Handling ... + if (alertEvents) { + // + // Terminal Alert ... + if (terminalAlert) { + Alert(message); + } + + // + // Push Alert ... + if (pushAlert) { + SendNotification(message); + } + } +} +// +// END Functions ... +// + +// +// +// Calculate Signal ... +// in this function we calculate a signal exists in +// specific bar or not ... +XSignalRequest GenerateSignal( + const int bar_index // Bar Index ... +) { + // + // create temp result ... + XSignalRequest result = {}; + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + bool hasSignal = false; + bool hasLongSignal = false; + bool hasShortSignal = false; + + // + XSignal signal = {}; + + // + // Define Template Signal Requests for Managing Multiple Signals ... + // + // X ... + XSignalRequest xLongSignalRequest = {}; + XSignalRequest xShortSignalRequest = {}; + // + // XR ... + XSignalRequest xrLongSignalRequest = {}; + XSignalRequest xrShortSignalRequest = {}; + // + // XTPW ... + XSignalRequest xTPWLongSignalRequest = {}; + XSignalRequest xTPWShortSignalRequest = {}; + + // + // START XR Signal Handler ... + // + // + if (enableXRSignalling) { + // + CheckXRSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xRWaitForLongSignals) { + // + CheckXRLongSignalConditions( + bar_index + ); + + // + xrLongSignalRequest = GenerateXRSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xrLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrLongSignalRequest.signal + ); + + // + if (isReady && xRWaitForLongSignals) { + // + hasLongSignal = true; + signal = xrLongSignalRequest.signal; + } else { + ClearXRLongSignalConditions(); + } + } + } else { + ClearXRLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xRWaitForShortSignals) { + // + CheckXRShortSignalConditions( + bar_index + ); + + // + xrShortSignalRequest = GenerateXRSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xrShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXRSignals( + xrShortSignalRequest.signal + ); + + // + if (isReady && xRWaitForShortSignals) { + // + hasShortSignal = true; + signal = xrShortSignalRequest.signal; + } else { + ClearXRShortSignalConditions(); + } + } + } else { + ClearXRShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + // START XTPW Signal Handler ... + // + if (enableXTPWSignalling) { + // + CheckXTPWSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xTPWWaitForLongSignals) { + // + CheckXTPWLongSignalConditions( + bar_index + ); + + // + xTPWLongSignalRequest = GenerateXTPWSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xTPWLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWLongSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForLongSignals) { + // + hasLongSignal = true; + signal = xTPWLongSignalRequest.signal; + } else { + ClearXTPWLongSignalConditions(); + } + } + } else { + ClearXTPWLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xTPWWaitForShortSignals) { + // + CheckXTPWShortSignalConditions( + bar_index + ); + + // + xTPWShortSignalRequest = GenerateXTPWSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xTPWShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXTPWSignals( + xTPWShortSignalRequest.signal + ); + + // + if (isReady && xTPWWaitForShortSignals) { + // + hasShortSignal = true; + signal = xTPWShortSignalRequest.signal; + } else { + ClearXTPWShortSignalConditions(); + } + } + } else { + ClearXTPWShortSignalConditions(); + } + } + } + // + // END XTPW Signal Handler ... + // + + // + // START X Signal Handler ... + // + // + if (enableXSignalling) { + // + CheckXSignalHandler( + bar_index + ); + + // + // Long Trades ... + if (allowTrade && allowLongTrades) { + // + if (xWaitForLongSignals) { + // + CheckXLongSignalConditions( + bar_index + ); + + // + xLongSignalRequest = GenerateXSignal( + X_SIGNAL_LONG, + signalPrefix, + bar_index + ); + + // + if (xLongSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xLongSignalRequest.signal + ); + + // + if (isReady && xWaitForLongSignals) { + // + hasLongSignal = true; + signal = xLongSignalRequest.signal; + } else { + ClearXLongSignalConditions(); + } + } + } else { + ClearXLongSignalConditions(); + } + } + + // + // Short Trades ... + if (allowTrade && allowShortTrades) { + // + if (xWaitForShortSignals) { + // + CheckXShortSignalConditions( + bar_index + ); + + // + xShortSignalRequest = GenerateXSignal( + X_SIGNAL_SHORT, + signalPrefix, + bar_index + ); + + // + if (xShortSignalRequest.hasSignal) { + // + // Here we can Check and Filter Signals Based On State ... + bool isReady = IsReadyForXSignals( + xShortSignalRequest.signal + ); + + // + if (isReady && xWaitForShortSignals) { + // + hasShortSignal = true; + signal = xShortSignalRequest.signal; + } else { + ClearXShortSignalConditions(); + } + } + } else { + ClearXShortSignalConditions(); + } + } + } + // + // END XR Signal Handler ... + // + + // + hasSignal = hasLongSignal || hasShortSignal; + + // + if (!hasSignal) { + // + signal.type = X_SIGNAL_NONE; + result.type = X_SIGNAL_NONE; + } + + // + // Normalize TP, SL and Entry Price ... + signal.tp = NormalizeDouble(signal.tp, _Digits); + signal.sl = NormalizeDouble(signal.sl, _Digits); + signal.entry = NormalizeDouble(signal.entry, _Digits); + + // + result.signal = signal; + result.type = signal.type; + result.hasSignal = hasSignal; + result.provider = signal.provider; + + // + // Return Result ... + return result; +} diff --git a/Indicators/x-saherelm.ma.mq4 b/Indicators/x-saherelm.ma.mq4 new file mode 100644 index 0000000..e3a5737 --- /dev/null +++ b/Indicators/x-saherelm.ma.mq4 @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MA Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +// +// Fast MA ... +input int maLength = 20; // MA Length +input int maShift = 0; // MA Shift +input ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method +input ENUM_APPLIED_PRICE maAppliedPrice = PRICE_CLOSE; // MA Applied Price + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 1 + +// +#property indicator_plots 1 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Fast Ma Buffer ... +#property indicator_label1 "Ma" +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrYellow +#property indicator_style1 STYLE_DOT +#property indicator_width1 2 + +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define maBufferIndex 0 + +double maBuffer[]; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (maLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + // Start Set Index Buffers ... + // + // + // Ma ... + SetIndexBuffer(maBufferIndex, maBuffer); + SetIndexDrawBegin(maBufferIndex, maLength + 1); + // + // End Set Index Buffers ... + // + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, maLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Ma ... + CalculateMa(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateMa( + const int &bar_index +) { + // + // Calculating Fast Ma ... + double ma = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + maAppliedPrice, + bar_index + ); + + // + maBuffer[bar_index] = ma; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Indicators/x-saherelm.xrange.mq4 b/Indicators/x-saherelm.xrange.mq4 new file mode 100644 index 0000000..1359f57 --- /dev/null +++ b/Indicators/x-saherelm.xrange.mq4 @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center XRange Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm XRange Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 14; +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_chart_window + +// +#property indicator_buffers 3 + +// +#property indicator_plots 3 + +// +// Start Define Indicator Buffer Styles ... +// +// +// Highest High Buffer ... +#property indicator_type1 DRAW_LINE +#property indicator_color1 clrGreen +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +// Lowest Low Buffer ... +#property indicator_type2 DRAW_LINE +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +// Middle Buffer ... +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DASH +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +// +#define highestHighBufferIndex 0 +#define lowestLowBufferIndex 1 +#define middleBufferIndex 2 + +// +double highestHighBuffer[]; +double lowestLowBuffer[]; +double middleBuffer[]; + +// +datetime startTime; +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if ( + marketLength <= 0 + ) { + return INIT_PARAMETERS_INCORRECT; + } + + // + string hhLbl = StringConcatenate( + "XR HH(", marketLength, ")" + ); + SetIndexBuffer(highestHighBufferIndex, highestHighBuffer); + SetIndexLabel(highestHighBufferIndex, hhLbl); + + // + string llLbl = StringConcatenate( + "XR LL(", marketLength, ")" + ); + SetIndexBuffer(lowestLowBufferIndex, lowestLowBuffer); + SetIndexLabel(lowestLowBufferIndex, llLbl); + + // + string midLbl = StringConcatenate( + "XR Mid(", marketLength, ")" + ); + SetIndexBuffer(middleBufferIndex, middleBuffer); + SetIndexLabel(middleBufferIndex, midLbl); + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculations ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculations ... +void CalculateBuffers( + const int &bar_index +) { + // + // Retrieve Bar Time ... + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + if (startTime == 0) { + // + startTime = barTime; + SetIndicatorBuffersNone(bar_index); + return; + } + + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + startTime + ); + + // + int startDistance = startBarIndex - bar_index; + if (startDistance < marketLength) { + // + SetIndicatorBuffersNone(bar_index); + return; + } + + // + // Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLength, + bar_index + ); + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + highestHighBuffer[bar_index] = hh; + + // + // Lowest Low ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLength, + bar_index + ); + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + lowestLowBuffer[bar_index] = ll; + + // + // Middle Buffer ... + double mid = (hh + ll) / 2; + middleBuffer[bar_index] = mid; + + // + // Reset Start Time ... + startTime = 0; +} + +// +void SetIndicatorBuffersNone( + const int bar_index +) { + // + int lastBarIndex = bar_index + 1; + + // + double lastHighestHigh; + double lastLowestLow; + + // + // Highest High ... + if (ArraySize(highestHighBuffer) > lastBarIndex) { + lastHighestHigh = highestHighBuffer[lastBarIndex]; + } else { + lastHighestHigh = 0; + } + + // + // Lowest Low ... + if (ArraySize(lowestLowBuffer) > lastBarIndex) { + lastLowestLow = lowestLowBuffer[lastBarIndex]; + } else { + lastLowestLow = 0; + } + + // + highestHighBuffer[bar_index] = lastHighestHigh; + lowestLowBuffer[bar_index] = lastLowestLow; + + // + double mid = (lastHighestHigh + lastLowestLow) / 2; + middleBuffer[bar_index] = mid; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Indicators/x-saherelm.xtpow.mq4 b/Indicators/x-saherelm.xtpow.mq4 new file mode 100644 index 0000000..46ff59e --- /dev/null +++ b/Indicators/x-saherelm.xtpow.mq4 @@ -0,0 +1,275 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center Trend Power Indicator +// --------------------------------------------- +// saherelm implementation of above indicator ... +// this indicator uses two ma line: +// - fast ma; +// - slow ma; +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm MA Indicator" +#property strict + +// +// START Inputs ... +// +input int marketLength = 7; // Market Length +// +// END Inputs ... +// + +// +// START Global Definitions: Variables, Properties and etc ... +// +#property indicator_separate_window + +// +#property indicator_plots 3 +#property indicator_buffers 3 +#property indicator_minimum 0 +#property indicator_maximum 100 + +// +#property indicator_levelcolor clrGray +#property indicator_levelstyle STYLE_DOT + +// +// Start Define Indicator Buffer Styles ... +// +#property indicator_type1 DRAW_HISTOGRAM +#property indicator_color1 clrLime +#property indicator_style1 STYLE_DOT +#property indicator_width1 1 + +// +#property indicator_type2 DRAW_HISTOGRAM +#property indicator_color2 clrRed +#property indicator_style2 STYLE_DOT +#property indicator_width2 1 + +// +#property indicator_type3 DRAW_LINE +#property indicator_color3 clrYellow +#property indicator_style3 STYLE_DOT +#property indicator_width3 1 +// +// End Define Indicator Buffer Styles ... +// + +// +// Buffers ... +#define powerUpBufferIndex 0 +#define powerDownBufferIndex 1 +#define signalBufferIndex 2 + +double powerUpBuffer[]; +double powerDownBuffer[]; +double signalBuffer[]; + +// +#include "../Libraries/x-saherelm.lib.mq4" +// +// END Global Definitions: Variables, Properties and etc ... +// + +// +// Start Event Handlers ... +// +// +// Initialization ... +int OnInit() { + // + // Initialize what we want ... + if (marketLength <= 0) { + return INIT_PARAMETERS_INCORRECT; + } + + // + SetLevelValue(0, 0.0); + IndicatorSetString(INDICATOR_LEVELTEXT,0,""); + + // + SetLevelValue(1, 20.0); + IndicatorSetString(INDICATOR_LEVELTEXT,1,""); + + // + SetLevelValue(2, 50); + IndicatorSetString(INDICATOR_LEVELTEXT,2,""); + + // + SetLevelValue(3, 100); + IndicatorSetString(INDICATOR_LEVELTEXT,3,""); + + // + string pUpLbl = StringConcatenate( + "P Up (", marketLength, ")" + ); + SetIndexLabel(powerUpBufferIndex, pUpLbl); + SetIndexBuffer(powerUpBufferIndex, powerUpBuffer); + SetIndexDrawBegin(powerUpBufferIndex, marketLength + 1); + + // + string pDownLbl = StringConcatenate( + "P Down (", marketLength, ")" + ); + SetIndexLabel(powerDownBufferIndex, pDownLbl); + SetIndexBuffer(powerDownBufferIndex, powerDownBuffer); + SetIndexDrawBegin(powerDownBufferIndex, marketLength + 1); + + // + string pSignalLbl = StringConcatenate( + "P Signal (", marketLength, ")" + ); + SetIndexLabel(signalBufferIndex, pSignalLbl); + SetIndexBuffer(signalBufferIndex, signalBuffer); + SetIndexDrawBegin(signalBufferIndex, marketLength + 1); + + // + // here we specify logging enabled or not ... + enableLogging = true; + + // + // this is a Tag which attached to our Logger ... + logTag = "X_TPW_OSC"; + + // + return INIT_SUCCEEDED; +} + +// +// Calculating what we want ... +int OnCalculate(const int rates_total, + const int prev_calculated, + const datetime &time[], + const double &open[], + const double &high[], + const double &low[], + const double &close[], + const long &tick_volume[], + const long &volume[], + const int &spread[] +) { + // + // this counts Available Bars ... + int limit; + + // + // because in some cases we may have more than one input for + // calculation and we must prevent any calculation + // untill we pass the biggest input length, here we get max Input length + // and then wait until pass it ... + int maxLength = MathMax(0, marketLength); + + // + // input variable, we return 0 means nothing passed ... + if (rates_total < maxLength) { + return 0; + } + + // + // found which candles calculated before ... + limit = (prev_calculated == 0) ? rates_total - maxLength - 1 : rates_total - prev_calculated + 1; + + // + // this is the main loop of calculations, for each bar index ... + for (int i = limit - 1; i >= 0; i--) { + // + // Start Calculation here ... + // i is bar_index ... + + // + // Calculate Buffers ... + CalculateBuffers(i); + } + + // + return rates_total; +} +// +// END Event Handlers ... +// + +// +// START Functions ... +// +// +// Calculating Ma ... +void CalculateBuffers( + const int &bar_index +) { + // + double powerUp = 0; + double powerDown = 0; + + // + int dailyCount = GetDailyCandleCount(); + double dailyHH = GetMarketHighestHigh( + bar_index, + dailyCount + ); + double dailyLL = GetMarketLowestLow( + bar_index, + dailyCount + ); + double dailyDiff = dailyHH - dailyLL; + double rate = dailyDiff / 100; + + // + for (int i = bar_index; i < bar_index + marketLength; i++) { + // + XOHCL c = GetCandleModel(i); + + // + double cRange = + MathAbs(c.open - c.close) + // MathAbs(c.high - c.low) + ; + bool isBullish = c.open < c.close; + + // + if (isBullish) { + powerUp += cRange; + } else { + powerDown += cRange; + } + } + + // + powerUp = powerUp / rate; + powerDown = powerDown / rate; + + // + int doubleMarketLength = (marketLength * 2); + double ema = GetMA( + bar_index, + doubleMarketLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + double emaRate = GetMarketHighestHigh(bar_index, doubleMarketLength) - GetMarketLowestLow(bar_index, doubleMarketLength) / 100; + + // + double signal = (ema / 100) * rate; + double signalAddition = MathMin(powerUp, powerDown); + + // + powerUpBuffer[bar_index] = powerUp; + powerDownBuffer[bar_index] = powerDown; + signalBuffer[bar_index] = signal + signalAddition; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Libraries/x-saherelm.dialog.mq4 b/Libraries/x-saherelm.dialog.mq4 new file mode 100644 index 0000000..c00318e --- /dev/null +++ b/Libraries/x-saherelm.dialog.mq4 @@ -0,0 +1,110 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Dialog Library +// --------------------------------------------- +// saherelm useful tools and definitions +// for handling dialogs ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +// #include "../Libraries/x-saherelm.lib.mq4" +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +#include + +// +CAppDialog AppWindow; + +// +// Prefix for Created Dialogs ... +string windowPrefix = "XWinD"; + +// +// Generate a random number for dialogs ... +int GenerateWindowNumber() { + // + int result = MathRand() + 1; + + // + return result; +} + +// +// Generate a Window Prefix ID ... +string GenerateWindowID() { + // + string result = windowPrefix; + + // + // Generate INT ID ... + int idNum = GenerateWindowNumber(); + + // + result += "_" + StringConcatenate(idNum); + + // + return result; +} + +// +bool CreateDialog( + const string title = "" +) { + // + // string windowID = GenerateWindowID(); + + // + // Try to Create Window ... + bool result = AppWindow.Create( + 0, + title, + 0, + 20, + 20, + 360, + 324 + ); + + // + if (result) { + AppWindow.Run(); + } + + // + return result; +} + +// +void DestroyDialog(const int reason) { + AppWindow.Destroy(reason); +} + +// +// Apply Chart Event on Created Window ... +void DialogChartEvent( + const int id, // event ID + const long& lparam, // event parameter of the long type + const double& dparam, // event parameter of the double type + const string& sparam // event parameter of the string type +) { + // + AppWindow.ChartEvent( + id, + lparam, + dparam, + sparam + ); +} \ No newline at end of file diff --git a/Libraries/x-saherelm.draw.lib.mq4 b/Libraries/x-saherelm.draw.lib.mq4 new file mode 100644 index 0000000..776cde4 --- /dev/null +++ b/Libraries/x-saherelm.draw.lib.mq4 @@ -0,0 +1,2010 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes our shared library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Draw Highest High ... +bool DrawHighestHigh( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrAqua, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_HH(", marketLen ,")_", + hh, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + hhTime, + hh, + drawUntilTime, + hh, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Lowest Low ... +bool DrawLowestLow( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrFuchsia, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_LL(", marketLen ,")_", + ll, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + llTime, + ll, + drawUntilTime, + ll, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Draw Market Middle ... +bool DrawMarketMiddle( + const int bar_index, + const int marketLen, + const string tag, + const int drawUntilBarIndex = 0, + const long chartID = 0, + const int subWindow = 0, + const color clr = clrYellow, + const ENUM_LINE_STYLE style = STYLE_DOT, + const int width = 1, + const bool back = false, + const bool selection = false, + const bool hidden = false, + const long zOrder = 0 +) { + // + bool result = false; + + // + // Calculate Highest High ... + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + datetime llTime = iTime( + _Symbol, + _Period, + llIdx + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + // Calculate Highest High ... + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + datetime hhTime = iTime( + _Symbol, + _Period, + hhIdx + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + double middle = ll + ((hh - ll) / 2); + datetime middleTime = hhIdx < llIdx + ? hhTime + : llTime + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + datetime drawUntilTime = + drawUntilBarIndex != bar_index ? + iTime( + _Symbol, + _Period, + drawUntilBarIndex + ) : + barTime + ; + + // + int rnd = rand(); + + // + // Define Label ... + string lbl = StringConcatenate( + tag, + "_MID(", marketLen ,")_", + middle, + "_", rnd + ); + + // + result = ObjectDelete( + chartID, + lbl + ); + + // + // Draw a Trend Line ... + result = DrawTrendLine( + chartID, + lbl, + subWindow, + middleTime, + middle, + drawUntilTime, + middle, + clr, + style, + width, + back, + selection, + hidden, + zOrder + ); + + // + return result; +} + +// +// Start Arrow Functions ... +// +// +// Draw an Arrow Object on Chart ... +bool DrawArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // arrow name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const uchar arrowCode = OBJ_ARROW_UP, // arrow code + const ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM, // anchor point position + const color clr = clrAqua, // arrow color + const ENUM_LINE_STYLE style = STYLE_SOLID, // border line style + const int width = 3, // arrow size + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // Order Object ... +) { + // + // set anchor point coordinates if they are not set ... + ChangeArrowEmptyPoint(time, price); + + // + // reset the error value ... + ResetLastError(); + + // + // create an arrow ... + if(!ObjectCreate(chartID, name, OBJ_ARROW, subWindow, time, price)) { + // + string message = StringConcatenate(__FUNCTION__, + ": failed to create an arrow! Error code = ", + GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the arrow code ... + ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, arrowCode); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set the arrow color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set the border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set the arrow's size ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the arrow by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is false by default, if you want making it possible to highlight and move the object + // change it to true ... + ObjectSetInteger(chartID,name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point of Arrow ... +bool MoveArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if(!time) { + time = TimeCurrent(); + } + + // + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete an arrow ... +bool DeleteArrow( + const long chartID = 0, // chart's ID + const string name = "Arrow" // arrow name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete an arrow ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete an arrow! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the arrow code ... +bool ArrowCodeChange( + const long chartID = 0, // chart's ID + const string name = "Arrow", // object name + const uchar code = 252 // arrow code +) { + // + // reset the error value ... + ResetLastError(); + + // + // change the arrow code ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ARROWCODE, code)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the arrow code! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change anchor type ... +bool ArrowAnchorChange( + const long chartID = 0, // chart's ID + const string name="Arrow", // object name + const ENUM_ARROW_ANCHOR anchor = ANCHOR_TOP // anchor type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change anchor type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change anchor type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeArrowEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } +} +// +// End Arrow Functions ... +// + +// +// Start Horizontal Line Functions ... +// +// +// Create, Draw the horizontal line ... +bool DrawHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + const int subWindow = 0, // subwindow index + double price = 0, // line price + const color clr = clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the price is not set, set it at the current Bid price level ... + if(!price) { + price=SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // create a horizontal line ... + if(!ObjectCreate(chartID, name, OBJ_HLINE, subWindow, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move horizontal line ... +bool MoveHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine", // line name + double price = 0 // line price +) { + // + // if the line price is not set, move it to the current Bid price level ... + if(!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move a horizontal line ... + if(!ObjectMove(chartID, name, 0, 0, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete a horizontal line ... +bool DeleteHorizontalLine( + const long chartID = 0, // chart's ID + const string name = "HLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a horizontal line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a horizontal line! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End Horizontal Line Functions ... +// + +// +// Start Vertical Line Functions ... +// +// +// Create the vertical line ... +bool DrawVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + const int sub_window = 0, // subwindow index + datetime time = 0, // line time + const color clr=clrRed, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // if the line time is not set, draw it via the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value + ResetLastError(); + + // + // create a vertical line ... + if (!ObjectCreate(chartID, name, OBJ_VLINE, sub_window, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return true; +} + +// +// Move the vertical line ... +bool MoveVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine", // line name + datetime time = 0 // line time +) { + // + // if line time is not set, move the line to the last bar ... + if (!time) { + time = TimeCurrent(); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the vertical line ... + if(!ObjectMove(chartID, name, 0, time, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the vertical line ... +bool DeleteVerticalLine( + const long chartID = 0, // chart's ID + const string name = "VLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the vertical line ... + if (!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete the vertical line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return false; + } + + // + // successful execution ... + return true; +} +// +// End Vertical Line Functions ... +// + +// +// Start RectangleLabel Functions ... +// +// +// Create Rectangle Label Object ... +bool DrawRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int subWindow = 0, // subwindow index + const int x = 0, // X coordinate + const int y = 0, // Y coordinate + const int width = 50, // width + const int height = 18, // height + const color back_clr = C'236,233,216', // background color + const ENUM_BORDER_TYPE border = BORDER_SUNKEN, // border type + const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER, // chart corner for anchoring + const color clr = clrRed, // flat border color (Flat) + const ENUM_LINE_STYLE style = STYLE_SOLID, // flat border style + const int lineWidth = 1, // flat border width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // reset the error value ... + ResetLastError(); + + // + //--- create a rectangle label + if(!ObjectCreate(chartID, name, OBJ_RECTANGLE_LABEL, subWindow, 0, 0)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set label coordinates ... + ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x); + ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y); + + // + // set label size ... + ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width); + ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height); + + // + // set background color ... + ObjectSetInteger(chartID, name, OBJPROP_BGCOLOR, back_clr); + + // + // set border type ... + ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border); + + // + // set the chart's corner, relative to which point coordinates are defined ... + ObjectSetInteger(chartID, name, OBJPROP_CORNER, corner); + + // + // set flat border color (in Flat mode) ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set flat border line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set flat border width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, lineWidth); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the label by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, selection); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move Rectangle Label .. +bool MoveRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int x = 0, // X coordinate + const int y=0 // Y coordinate +) { + // + // reset the error value ... + ResetLastError(); + + // + // move the rectangle label ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XDISTANCE, x)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move X coordinate of the label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YDISTANCE, y)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move Y coordinate of the label! Error code = ",GetLastError() + ); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete the rectangle label ... +bool DeleteRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel" // label name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the label ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a rectangle label! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change Rectangle Label Size ... +bool ChangeSizeRectangleLabel( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const int width = 50, // label width + const int height = 18 // label height +) { + // + // reset the error value ... + ResetLastError(); + + // + // change label size ... + if(!ObjectSetInteger(chartID, name, OBJPROP_XSIZE, width)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's width! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + if(!ObjectSetInteger(chartID, name, OBJPROP_YSIZE, height)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the label's height! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change rectangle label border type ... +bool RectLabelChangeBorderType( + const long chartID = 0, // chart's ID + const string name = "RectLabel", // label name + const ENUM_BORDER_TYPE border = BORDER_SUNKEN // border type +) { + // + // reset the error value ... + ResetLastError(); + + // + // change border type ... + if(!ObjectSetInteger(chartID, name, OBJPROP_BORDER_TYPE, border)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the border type! Error code = ",GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} +// +// End RectangleLabel Functions ... +// + +// +// Start TrendLine Funcions ... +// +// Create a trend line by the given coordinates ... +bool DrawTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrYellow, // line color + const ENUM_LINE_STYLE style = STYLE_SOLID, // line style + const int width = 1, // line width + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool rayRight = false, // line's continuation to the right + const bool hidden = false, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeTrendLineEmptyPoints( + time1, + price1, + time2, + price2 + ); + + // + // reset the error value ... + ResetLastError(); + + // + // create a trend line by the given coordinates ... + if(!ObjectCreate(chartID, name, OBJ_TREND, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set line color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line display style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the line by mouse + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the line's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move trend line anchor point ... | +bool ChangeTrendLinePoint( + const long chartID = 0, // chart's ID + const string name = "TrendLine", // line name + const int pointindex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(Symbol(),SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move trend line's anchor point ... + if(!ObjectMove(chartID, name, pointindex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// The function deletes the trend line from the chart ... +bool DeleteTrendLine( + const long chartID = 0, // chart's ID + const string name = "TrendLine" // line name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete a trend line ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete a trend line! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of trend line's anchor points and set default ... +// values for empty ones ... +void ChangeTrendLineEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the first point's time is not set, it will be on the current bar ... + if (!time1) { + time1 = TimeCurrent(); + } + + // + // if the first point's price is not set, it will have Bid value ... + if (!price1) { + price1 = SymbolInfoDouble(Symbol(), SYMBOL_BID); + } + + // + // if the second point's time is not set, it is located 9 bars left from the second one ... + if (!time2) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(), Period(), time1, 10, temp); + + // + // set the second point 9 bars left from the first one ... + time2 = temp[0]; + } + + // + // if the second point's price is not set, it is equal to the first point's one ... + if (!price2) { + price2 = price1; + } +} +// +// End TrendLine Functions ... +// + +// +// Start Text Functions ... +// +// Create and Draw a Text Object ... +bool DrawText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const int subWindow = 0, // subwindow index + datetime time = 0, // anchor point time + double price = 0, // anchor point price + const string text = "Text", // the text itself + const string font = "Arial", // font + const int fontSize = 10, // font size + const color clr = clrRed, // color + const double angle = 0.0, // text slope + const ENUM_ANCHOR_POINT anchor = ANCHOR_CENTER, // anchor type + const bool back = false, // in the background + const bool selection = false, // highlight to move + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor point coordinates if they are not set ... + ChangeTextEmptyPoint(time,price); + + // + // reset the error value ... + ResetLastError(); + + // + //--- create Text object + if(!ObjectCreate(chartID, name, OBJ_TEXT, subWindow, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the text ... + ObjectSetString(chartID, name , OBJPROP_TEXT, text); + + // + // set text font ... + ObjectSetString(chartID, name, OBJPROP_FONT, font); + + // + // set font size ... + ObjectSetInteger(chartID, name, OBJPROP_FONTSIZE, fontSize); + + // + // set the slope angle of the text ... + ObjectSetDouble(chartID, name, OBJPROP_ANGLE, angle); + + // + // set anchor type ... + ObjectSetInteger(chartID, name, OBJPROP_ANCHOR, anchor); + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of moving the object by mouse ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID ,name, OBJPROP_SELECTED, selection); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Move the anchor point ... +bool MoveText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + //--- if point position is not set, move it to the current bar having Bid price + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point .. + if(!ObjectMove(chartID, name, 0, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Change the object text ... +bool ChangeText( + const long chartID = 0, // chart's ID + const string name = "Text", // object name + const string text = "Text" // text +) { + // + // reset the error value ... + ResetLastError(); + + // + // change object text ... + if(!ObjectSetString(chartID, name, OBJPROP_TEXT, text)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to change the text! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Text object ... +bool DeleteText( + const long chartID = 0, // chart's ID + const string name = "Text" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Text\" object! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution + return(true); +} + +// +// Check anchor point values and set default values +// for empty ones ... +void ChangeTextEmptyPoint( + datetime &time, + double &price +) { + // + // if the point's time is not set, it will be on the current bar ... + if(!time) { + time = TimeCurrent(); + } + + // + // if the point's price is not set, it will have Bid value ... + if(!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + } +// +// End Text Functions ... +// + +// +// Start Fibonacchi Functions ... +// +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawFibonacci( + const long chartID = 0, // chart's ID + const string name="Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrRed, // object color + const ENUM_LINE_STYLE style = STYLE_SOLID, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // successful execution ... + return(true); +} + +// +// Create Fibonacci Retracement by the given coordinates ... +bool DrawCustomFibonacci( + // + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + // + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int subWindow = 0, // subwindow index + datetime time1 = 0, // first point time + double price1 = 0, // first point price + datetime time2 = 0, // second point time + double price2 = 0, // second point price + const color clr = clrAqua, // object color + const ENUM_LINE_STYLE style = STYLE_DOT, // object line style + const int width = 1, // object line width + const bool back = false, // in the background + const bool selection = true, // highlight to move + const bool rayRight = false, // object's continuation to the right + const bool hidden = true, // hidden in the object list + const long zOrder = 0 // priority for mouse click +) { + // + // set anchor points' coordinates if they are not set ... + ChangeFibonacciEmptyPoints(time1, price1, time2, price2); + + // + // reset the error value ... + ResetLastError(); + + // + // Create Fibonacci Retracement by the given coordinates ... + if (!ObjectCreate(chartID, name, OBJ_FIBO, subWindow, time1, price1, time2, price2)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to create \"Fibonacci Retracement\"! Error code = " , GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set color ... + ObjectSetInteger(chartID, name, OBJPROP_COLOR, clr); + + // + // set line style ... + ObjectSetInteger(chartID, name, OBJPROP_STYLE, style); + + // + // set line width ... + ObjectSetInteger(chartID, name, OBJPROP_WIDTH, width); + + // + // display in the foreground (false) or background (true) ... + ObjectSetInteger(chartID, name, OBJPROP_BACK, back); + + // + // enable (true) or disable (false) the mode of highlighting the channel for moving + // when creating a graphical object using ObjectCreate function, the object cannot be + // highlighted and moved by default. Inside this method, selection parameter + // is true by default making it possible to highlight and move the object ... + ObjectSetInteger(chartID, name, OBJPROP_SELECTABLE, true); + ObjectSetInteger(chartID, name, OBJPROP_SELECTED, selection); + + // + // enable (true) or disable (false) the mode of continuation of the object's display to the right ... + ObjectSetInteger(chartID, name, OBJPROP_RAY_RIGHT, rayRight); + + // + // hide (true) or display (false) graphical object name in the object list ... + ObjectSetInteger(chartID, name, OBJPROP_HIDDEN, hidden); + + // + // set the priority for receiving the event of a mouse click in the chart ... + ObjectSetInteger(chartID, name, OBJPROP_ZORDER, zOrder); + + // + // Change Levels Of Fibonacci ... + bool result = FibonacciLevelsSet( + levels, + values, + colors, + styles, + widths, + descriptions, + chartID, + name + ); + + // + // successful execution ... + return result; +} + +// +// Set number of levels and their parameters ... +bool FibonacciLevelsSet( + int levels, // number of level lines + double &values[], // values of level lines + color &colors[], // color of level lines + ENUM_LINE_STYLE &styles[], // style of level lines + int &widths[], // width of level lines + string &descriptions[], // level Descriptions + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // check array sizes ... + if( + levels!=ArraySize(colors) || + levels!=ArraySize(styles) || + levels!=ArraySize(widths) || + levels!=ArraySize(widths) + ) { + // + string message = StringConcatenate( + __FUNCTION__, + ": array length does not correspond to the number of levels, error!" + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // set the number of levels ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELS, levels); + + // + // set the properties of levels in the loop ... + for(int i = 0; i < levels; i++) { + // + // level value ... + ObjectSetDouble(chartID, name, OBJPROP_LEVELVALUE, i, values[i]); + + // + // level color ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELCOLOR, i, colors[i]); + + // + // level style ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELSTYLE, i, styles[i]); + + // + // level width ... + ObjectSetInteger(chartID, name, OBJPROP_LEVELWIDTH, i, widths[i]); + + // + // level description ... + // ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, DoubleToString(100 * values[i], 1)); + ObjectSetString(chartID, name, OBJPROP_LEVELTEXT, i, descriptions[i]); + } + + // + // successful execution ... + return(true); +} + +// +// Move Fibonacci Retracement anchor point ... +bool FibonacciPointChange( + const long chartID = 0, // chart's ID + const string name = "Fibonacci", // object name + const int pointIndex = 0, // anchor point index + datetime time = 0, // anchor point time coordinate + double price = 0 // anchor point price coordinate +) { + // + // if point position is not set, move it to the current bar having Bid price ... + if (!time) { + time = TimeCurrent(); + } + + // + if (!price) { + price = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // reset the error value ... + ResetLastError(); + + // + // move the anchor point ... + if(!ObjectMove(chartID, name, pointIndex, time, price)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to move the anchor point! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Delete Fibonacci Retracement ... +bool DeleteFibonachi( + const long chartID = 0, // chart's ID + const string name = "Fibonacci" // object name +) { + // + // reset the error value ... + ResetLastError(); + + // + // delete the object ... + if(!ObjectDelete(chartID, name)) { + // + string message = StringConcatenate( + __FUNCTION__, + ": failed to delete \"Fibonacci Retracement\"! Error code = ", GetLastError() + ); + + // + LogMessage(message); + + // + return(false); + } + + // + // successful execution ... + return(true); +} + +// +// Check the values of Fibonacci Retracement anchor points and set +// default values for empty ones ... +void ChangeFibonacciEmptyPoints( + datetime &time1, + double &price1, + datetime &time2, + double &price2 +) { + // + // if the second point's time is not set, it will be on the current bar ... + if (!time2) { + time2 = TimeCurrent(); + } + + // + // if the second point's price is not set, it will have Bid value ... + if (!price2) { + price2 = SymbolInfoDouble(_Symbol, SYMBOL_BID); + } + + // + // if the first point's time is not set, it is located 9 bars left from the second one ... + if (!time1) { + // + // array for receiving the open time of the last 10 bars ... + datetime temp[10]; + CopyTime(Symbol(),Period(),time2,10,temp); + + // + // set the first point 9 bars left from the second one ... + time1 = temp[0]; + } + + // + // if the first point's price is not set, move it 200 points below the second one ... + if (!price1) { + price1 = price2 - 200 * SymbolInfoDouble(_Symbol, SYMBOL_POINT); + } +} +// +// End Fibonacci Functions ... +// + + +// +// Start General Functions ... +// +// +// Remove all Drawn Objects ... +void RemoveDraws(const string &tag) { + // + for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { + // + string on = ObjectName(iObj); + if (StringFind(on, tag) == 0) { + ObjectDelete(on); + } + } +} +// +// End General Functions ... +// \ No newline at end of file diff --git a/Libraries/x-saherelm.indicator.lib.mq4 b/Libraries/x-saherelm.indicator.lib.mq4 new file mode 100644 index 0000000..0e4b162 --- /dev/null +++ b/Libraries/x-saherelm.indicator.lib.mq4 @@ -0,0 +1,450 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Indicator Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// Reading specified Buffer From ADX Indicator ... +double ReadXMABuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const double stp, + const double mxm, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xmaIndicatorName = "x-saherelm.x.xma"; + + // + double result = iCustom( + _Symbol, + _Period, + xmaIndicatorName, + // + // Inputs ... + marketLen, + stp, + mxm, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading specified Buffer from XHL Indicator ... +double ReadXHLBuffer( + const int bar_index, + const int buffer_index, + // + const int marketLen, + // + const int shortCycleMult, + const int mediumCycleMult, + const int longCycleMult +) { + // + string xhlIndicatorName = "x-saherelm.x.hl"; + + // + double result = iCustom( + _Symbol, + _Period, + xhlIndicatorName, + // + // Inputs ... + marketLen, + shortCycleMult, + mediumCycleMult, + longCycleMult, + MODE_SMA, + // + buffer_index, + bar_index + ); + + // + return result; +} + +// +// Reading ADX Values ... +double ReadADX( + const int bar_index, + const int marketLen, + const int mult +) { + // + double result; + + // + int period = marketLen * mult; + + // + result = iADX( + _Symbol, + _Period, + period, + PRICE_CLOSE, + MODE_MAIN, + bar_index + ); + + // + return result; +} + +// +// Reading Pivot States ... +XPvtState GetPVTState( + const int bar_index, + const int marketLen +) { + // + XPvtState result = {}; + + // + double hh = GetMarketHighestHigh( + bar_index, + marketLen + ); + + // + double ho = GetMarketHighestOpen( + bar_index, + marketLen + ); + + // + double hc = GetMarketHighestClose( + bar_index, + marketLen + ); + + // + double hl = GetMarketHighestLow( + bar_index, + marketLen + ); + + // + double ll = GetMarketLowestLow( + bar_index, + marketLen + ); + + // + double lo = GetMarketLowestOpen( + bar_index, + marketLen + ); + + // + double lc = GetMarketLowestClose( + bar_index, + marketLen + ); + + // + double lh = GetMarketLowestHigh( + bar_index, + marketLen + ); + + // + // Filling Result ... + // + result.hh = hh; + result.ho = ho; + result.hc = hc; + result.hl = hl; + + // + result.ll = ll; + result.lo = lo; + result.lc = lc; + result.lh = lh; + + // + return result; +} + +// +// Calculate XRange from Market ... +static XRState lastXRState; +XRState GetXRange( + const int bar_index, + const int rangeMarketLength +) { + // + XRState result = {}; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + int marketBarIndex = bar_index + rangeMarketLength; + + // + // Highest High ... + // + int hhIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketBarIndex, + bar_index + ); + + // + double hh = iHigh( + _Symbol, + _Period, + hhIdx + ); + + // + // Lowest Low ... + // + int llIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketBarIndex, + bar_index + ); + + // + double ll = iLow( + _Symbol, + _Period, + llIdx + ); + + // + if (lastXRState.start == 0) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } else { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + lastXRState.start + ); + + // + if (startBarIndex - bar_index >= rangeMarketLength) { + // + lastXRState.start = barTime; + lastXRState.length = rangeMarketLength; + + // + lastXRState.hh = hh; + lastXRState.ll = ll; + + // + // Middle ... + double mid = (hh + ll) / 2; + lastXRState.mid = mid; + } + } + + // + result = lastXRState; + + // + return result; +} + +// +// Reading XTPowState from Indicatoe ... +XTPOWState GetXTPowState( + const int bar_index, + const int marketLen +) { + // + XTPOWState result = {}; + + // + // + double powerUp = 0; + double powerDown = 0; + double signal = 0; + + // + string indicatorName = "x-saherelm.xtpow"; + + // + int pUpIndex = 0; + int pDownIndex = 1; + int signalIndex = 2; + + // + powerUp = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pUpIndex, + bar_index + ); + + // + powerDown = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + pDownIndex, + bar_index + ); + + // + signal = iCustom( + _Symbol, + _Period, + indicatorName, + // + marketLen, + // + signalIndex, + bar_index + ); + + // + result.signal = signal; + result.powerUp = powerUp; + result.powerDown = powerDown; + + // + return result; +} + +// +// Reading XRState From Indicator ... +XRState ReadXRange( + const int bar_index, + const int marketLen +) { + // + XRState result = {}; + + // + // Define Buffer Indexes ... + int hhBufferIndex = 0; + int llBufferIndex = 1; + int midBufferIndex = 2; + + // + string indicatorName = "x-saherelm.xrange"; + + // + // Read Values From XRange Indicator ... + + // + double hh = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + hhBufferIndex, // Buffer Index ... + bar_index + ); + + // + double ll = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + llBufferIndex, // Buffer Index ... + bar_index + ); + + // + double mid = iCustom( + _Symbol, + _Period, + indicatorName, + // + // Inputs ... + marketLen, + // + midBufferIndex, // Buffer Index ... + bar_index + ); + + // + // Filling Result ... + result.hh = hh; + result.ll = ll; + result.mid = mid; + + // + return result; +} +// +// END Indicator Reading Data ... +// diff --git a/Libraries/x-saherelm.lib.mq4 b/Libraries/x-saherelm.lib.mq4 new file mode 100644 index 0000000..9cbc3d6 --- /dev/null +++ b/Libraries/x-saherelm.lib.mq4 @@ -0,0 +1,1695 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes Logger library ... +#include "../Libraries/x-saherelm.log.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +static datetime lastBarTime; + +// +struct XOHCL { + double high; + double open; + double close; + double low; +}; + +// +struct XRange { + // + datetime time; + + // + double highestHigh; + double lowestLow; + + // + int levels; + int marketLength; + + // + double rate; +}; + +// +struct XPrice { + // + double askPrice; + double bidPrice; + double priceGap; + + // + double longEntry; + double longExit; + + // + double shortEntry; + double shortExit; +}; + +// +// START Functions ... +// + +// +// Determines current working is New Bar or not ... +bool IsNewBar() { + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if(lastBarTime != curbar) { + // + lastBarTime = curbar; + return true; + } + + // + return false; +} + +// +// Determines we are in new Day or not ... +bool IsNewDay() { + // + bool result = false; + + // + // Reading Last Bar Date ... + datetime curbar = (datetime)SeriesInfoInteger( + _Symbol, + _Period, + SERIES_LASTBAR_DATE + ); + + // + if (lastBarTime == 0) { + lastBarTime = curbar; + } + + // + if (curbar == lastBarTime) { + return result; + } + + // + // Retrieve Day and Month and Year for Last Bar Time ... + int lastBarDay = TimeDay(lastBarTime); + int lastBarMonth = TimeMonth(lastBarTime); + int lastBarYear = TimeYear(lastBarTime); + + // + // Retrieve Day and Month and Year for Current Bar Time ... + int curBarDay = TimeDay(curbar); + int curBarMonth = TimeMonth(curbar); + int curBarYear = TimeYear(curbar); + + // + result = curBarDay > lastBarDay + || curBarMonth > lastBarMonth + || curBarYear > lastBarYear; + + // + return result; +} + +// +// Determines we are in new Hour or not ... +bool IsNewHour() { + // + // Save Last Hour value ... + static int lastHour = 0; + + // + bool isInNewDay = IsNewDay(); + if (isInNewDay) { + // + // Reset Last Hour if it's in New Day ... + lastHour = 0; + } + + // + // Retrieve Current Hour value ... + int currentHour = Hour(); + + // + // Check values ... + bool result = currentHour > lastHour; + if (result) { + // + // Update Last Hour value ... + lastHour = currentHour; + } + + // + // returns result ... + return result; +} + +// +// Retrieve Number of Candles in a Day ... +int GetDailyCandleCount() { + // + int seconds = PeriodSeconds(_Period); + + // + int daySeconds = 24 * 60 * 60; + + // + int result = daySeconds / seconds; + + // + return result; +} + +// +// XRange Detector ... +XRange GetMarketRange( + const int bar_index, + const int marketLen, + const int levels +) { + // + XRange result = {}; + + // + result.levels = levels; + result.marketLength = marketLen; + + // + datetime time = iTime( + _Symbol, + _Period, + bar_index + ); + result.time = time; + + // + double highestHigh = GetMarketHighestHigh( + bar_index, + marketLen + ); + result.highestHigh = highestHigh; + + // + double lowestLow = GetMarketLowestLow( + bar_index, + marketLen + ); + result.lowestLow = lowestLow; + + // + double diff = highestHigh - lowestLow; + double rate = diff / levels; + + // + result.rate = rate; + + // + return result; +} + +// +// Retrieve RMA on Specific Candle ... +double GetRMA( + int bar_index, + int length +) { + // + double shortSMA = iMA(_Symbol, _Period, length, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double mediumSMA = iMA(_Symbol, _Period, length * 2, 0, MODE_SMA, PRICE_CLOSE, bar_index); + double longSMA = iMA(_Symbol, _Period, length * 3, 0, MODE_SMA, PRICE_CLOSE, bar_index); + + // + double result = longSMA - mediumSMA + shortSMA; + + // + return result; +} + +// +// Retrieve Moving Average ... +double GetMA( + const int bar_index, + const int maLength, + const int maShift, + const ENUM_MA_METHOD maMethod, + const ENUM_APPLIED_PRICE appliedPrice +) { + // + double result = iMA( + _Symbol, + _Period, + maLength, + maShift, + maMethod, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// Calculate Fib Level ... +double GetFibonacciLevel( + double upPrice, + double downPrice, + double level, + int direction +) { + // + double ling = upPrice - downPrice; + double pLevel = (ling / 100) * (level * 100); + + // + double result = direction > 0 ? + upPrice - pLevel : + downPrice + pLevel; + result = NormalizeDouble(result, _Digits); + + // + return result; +} + +// +// Retrieve True Range ... +double GetTR( + const int bar_index +) { + // + double result = 0; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double prevClose = iClose( + _Symbol, + _Period, + bar_index + 1 + ); + + // + double highLowDif = high - low; + double hpCDif = MathAbs(high - prevClose); + double lpCDiff = MathAbs(low - prevClose); + + // + result = MathMax(highLowDif, hpCDif); + result = MathMax(result, lpCDiff); + + // + return result; +} + +// +// Calculate True Range Simple Moving Average ... +double GetMarketTRSMA( + const int bar_index, + const int marketLen +) { + // + double result = 0; + + // + // Create Barket Length Trs ... + double trs[]; + ArrayResize( + trs, + marketLen + ); + int index = 0; + double trSum = 0; + for (int i = bar_index; i < bar_index + marketLen; i++) { + // + double tr = GetTR(i); + trs[index] = tr; + + // + trSum += tr; + + // + index++; + } + + // + result = trSum / marketLen; + + // + return result; +} + +// +// Retrieve Commodity Channel ... +double GetMarketCCI( + const int bar_index, + const int marketLen, + const ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE +) { + // + double result = 0; + + // + result = iCCI( + _Symbol, + _Period, + marketLen, + appliedPrice, + bar_index + ); + + // + return result; +} + +// +// this function check crossing up two Buffers ... +bool IsCrossedOver( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] > arr2[index1]) && !(arr1[index2] > arr2[index2]); + + // + return result; +} + +// +// this function check crossing down two Buffers ... +bool IsCrossedUnder( + double &arr1[], + double &arr2[], + int index1, + int index2 = -1 +) { + // + // Normalize Index 2 Value ... + if (index2 < 0) { + index2 = index1 + 1; + } + + // + bool result = (arr1[index1] < arr2[index1]) && !(arr1[index2] < arr2[index2]); + + // + return result; +} + +// +// Convert points to Actual Point ... +double PointsToDouble(int points) { + // + double result = points * _Point; + return result; +} + +// +// Converts Pips to Points ... +int PipsToPoints(int pips) { + // + int result = pips * ((_Digits == 3 || _Digits == 5) ? 10 : 1); + return result; +} + +// +// Converts Pips to Double ... +double PipsToDouble(int pips) { + // + double result = PointsToDouble(PipsToPoints(pips)); + return result; +} + +// +// Converts Double Value to Pips ... +int PriceToPips(double value) { + // + if (value <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + int result = (int)(value / pipValue); + + // + return result; +} + +// +// Converts Pips to Double ... +double PipsToPrice(int pips) { + // + if (pips <= 0) { + return 0; + } + + // + double pipValue = _Point * MathPow(10, _Digits); + double result = pipValue * pips; + + // + return result; +} + +// +// Generate ATR StopLoss Value ... +double CalculateATRSL( + int period, + double multiplier +) { + // + if (period <= 0 || multiplier <= 0) { + return 0; + } + + // + double atrValue = iATR( + _Symbol, + _Period, + period, + 0 + ); + + // + double result = atrValue * multiplier; + + // + return result; +} + +// +// Detect Candle Type ... +// Bullish => means close > open ... +bool IsBullishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBullishCandle( + open, + close + ); + + // + return result; +} + +bool IsBullishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open < close; + + // + return result; +} + +// +// Detect Candle Type ... +// Bearish => means close < open ... +bool IsBearishCandle( + const int bar_index +) { + // + // Temp Result ... + bool result = false; + + // + if (bar_index < 0) { + return result; + } + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + result = IsBearishCandle( + open, + close + ); + + // + return result; +} + +bool IsBearishCandle( + const double open, + const double close +) { + // + // Temp Result ... + bool result = false; + + // + result = open > close; + + // + return result; +} + +// +// Retrieve a Candle Info ... +XOHCL GetCandleModel( + const int bar_index +) { + // + XOHCL result = {}; + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + result.high = high; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + result.open = open; + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + result.close = close; + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + result.low = low; + + // + return result; +} + +// +// Retrieve Market Current Prices for Signals ... +XPrice GetPrice() { + // + XPrice result = {}; + + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double priceGap = MathAbs(bidPrice - askPrice); + + // + result.askPrice = askPrice; + result.bidPrice = bidPrice; + result.priceGap = priceGap; + + // + result.longEntry = askPrice; + result.longExit = bidPrice; + + // + result.shortEntry = bidPrice; + result.shortExit = askPrice; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBullishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (low - minAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + low = iLow( + _Symbol, + _Period, + index + ); + + // + result = result + || (low - minAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Detect Market Has Sharp Bullish or not ... +bool IsSharpBearishDetected( + const int bar_index, // Bar Index ... + const int marketLen, // Market Length ... + // + const double shpDetectMultipliers // Sharp Detect Multiplier +) { + // + bool result = false; + + // + double open = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double close = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double high = iHigh( + _Symbol, + _Period, + bar_index + ); + + // + double low = iLow( + _Symbol, + _Period, + bar_index + ); + + // + double minValue = 0; + double maxValue = 0; + int positionedLength = bar_index + marketLen; + + // + for (int i = bar_index; i < positionedLength; i++) { + // + double cHigh = iHigh( + _Symbol, + _Period, + i + ); + + // + double cLow = iLow( + _Symbol, + _Period, + i + ); + + // + minValue += MathMin(cLow, cHigh); + maxValue += MathMax(cLow, cHigh); + } + + // + double minAvg = minValue / positionedLength; + double maxAvg = maxValue / positionedLength; + + // + double shpValue = shpDetectMultipliers * _Point; + + // + result = (high - maxAvg) > shpValue; + + // + int index = bar_index; + while ( + index < positionedLength + || !result + ) { + // + high = iHigh( + _Symbol, + _Period, + index + ); + + // + result = result + || (high - maxAvg) > shpValue; + + // + index++; + }; + + // + return result; +} + +// +// Retrieve Highest High Value based on Given Market ... +double GetMarketHighestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Low Value based on Given Market ... +double GetMarketHighestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Open Value based on Given Market ... +double GetMarketHighestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Highest Close Value based on Given Market ... +double GetMarketHighestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iHighest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Low Value based on Given Market ... +double GetMarketLowestLow( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_LOW, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iLow( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest High Value based on Given Market ... +double GetMarketLowestHigh( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_HIGH, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iHigh( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Open Value based on Given Market ... +double GetMarketLowestOpen( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_OPEN, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iOpen( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Retrieve Lowest Close Value based on Given Market ... +double GetMarketLowestClose( + // + const int bar_index, // Bar Index ... + const int marketLen // Market Length ... +) { + // + // Empty Result ... + double result = 0.0; + + // + // Retrieve Desired Bar Index ... + int foundedBarIndex = iLowest( + _Symbol, + _Period, + MODE_CLOSE, + marketLen, + bar_index + ); + + // + // Retrieve Price ... + result = iClose( + _Symbol, + _Period, + foundedBarIndex + ); + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// less than given price ... +double GetLowLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Low Price is +// great than given price ... +double GetLowGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iLow( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetLowGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iLow( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// less than given price ... +double GetHighLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's High Price is +// great than given price ... +double GetHighGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iHigh( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetHighGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iHigh( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Open Price is +// less than given price ... +double GetOpenGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iOpen( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetOpenGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iOpen( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// less than given price ... +double GetCloseLessCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result >= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseLessCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP >= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Find last Candle which it's Close Price is +// great than given price ... +double GetCloseGreatCandlePrice( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int index = bar_index + 1; + double result = iClose( + _Symbol, + _Period, + index + ); + + // + while (result <= price) { + // + index++; + + // + result = iLow( + _Symbol, + _Period, + index + ); + } + + // + return result; +} +int GetCloseGreatCandleIndex( + // + const int bar_index, // Bar Index ... + const double price // Position Open Price ... +) { + // + int result = bar_index + 1; + double cP = iClose( + _Symbol, + _Period, + result + ); + + // + while (cP <= price) { + // + result++; + + // + cP = iLow( + _Symbol, + _Period, + result + ); + } + + // + return result; +} + +// +// Get Slope of a Line by it's two Point ... +double GetSlope( + double x1, + double y1, + double x2, + double y2 +) { + // + double result = (y2 - y1)/MathAbs(x2 - x1); + return result; +} +// +// END Functions ... +// \ No newline at end of file diff --git a/Libraries/x-saherelm.log.lib.mq4 b/Libraries/x-saherelm.log.lib.mq4 new file mode 100644 index 0000000..066b3f7 --- /dev/null +++ b/Libraries/x-saherelm.log.lib.mq4 @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Draw Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Log Tag ... +static string logTag = ""; + +// +// Enable or Disable Logging ... +static bool enableLogging = false; + +// +// Start Log Messages ... +// + +// +// Logging a Message, specified for this EA ... +// using provided LogTag ... +void LogMessage(string message) { + // + if (!enableLogging) { + return; + } + + // + Print(logTag, " > ", message); +} + +// +// this used for logging series ... +void LogSeries( + double &series[], // which series to Log ... + int length = 0, // number of items to Log, 0 means all ... + int skip = 0 // number of items which skip before logging ... +) { + // + string msg = ""; + + // + int seriesSize = ArraySize(series); + if ( + skip < 0 + || length < 0 + || seriesSize == 0 + || skip > seriesSize + || skip + length > seriesSize + ) { + return; + } + + // + length = length == 0 ? + seriesSize : + length; + int start = skip > 1 ? + skip - 1 : + skip == 1 ? + 1 : + 0; + + // + // Loop through series items ... + for (int i = start; i < start + length; i++) { + // + msg += StringConcatenate( + "i[", i, "]: ", series[i], ", " + ); + } + + // + LogMessage(msg); +} +// +// End Log Messages ... +// + diff --git a/Libraries/x-saherelm.models.lib.mq4 b/Libraries/x-saherelm.models.lib.mq4 new file mode 100644 index 0000000..6899040 --- /dev/null +++ b/Libraries/x-saherelm.models.lib.mq4 @@ -0,0 +1,155 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Models Global Library +// --------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// START STATIC Variables ... +// +// +static int totalSignals = 0; +static int totalLongSignals = 0; +static int totalShortSignals = 0; + +// +static double initialBalance = 0; + +// +static int countedBars = 0; +static bool isNewBar = false; +static bool isNewDay = false; +static bool isNewHour = false; +// +// END STATIC Variables ... +// + +// +// Start Models ... +// +// +// Signal Providers ... +enum ENUM_X_SIGNAL_PROVIDER { + X_UNKNOWN_PROVIDER, + X_XXX_PROVIDER, + X_XR_PROVIDER, + X_XTPW_PROVIDER +}; + +// +// these are different signal types ... +enum ENUM_X_SIGNAL_TYPE { + X_SIGNAL_NONE, + X_SIGNAL_LONG, + X_SIGNAL_SHORT, +}; + +// +// Model Market Highs and Lows ... +struct XPvtState { + // + double hh; + double ho; + double hc; + double hl; + + // + double ll; + double lo; + double lc; + double lh; +}; + +// +// we Model each signals as this type ... +struct XSignal { + // + // Signal Symbol ... + string symbol; + + // + // Signal Type ... + ENUM_X_SIGNAL_TYPE type; + + // + // Signal ID ... + int id; + + // + // Signal Ticket Number, when Opening Trade ... + int ticket; + + // + // Signal Provider ... + ENUM_X_SIGNAL_PROVIDER provider; + + // + // Target Point ... + double tp; + + // + // Stop Loss ... + double sl; + + // + // Signal Entry Price ... + double entry; + + // + // Signalling Time ... + datetime time; + + // + // Signal Comments ... + string comment; + + // + // Signal TAG ... + string tag; +}; + +// +// this is Signal Request Response model ... +struct XSignalRequest { + bool hasSignal; + XSignal signal; + ENUM_X_SIGNAL_TYPE type; + ENUM_X_SIGNAL_PROVIDER provider; +}; + +// +struct XRState { + // + datetime start; + int length; + + // + double hh; + double ll; + double mid; +}; + +// +struct XTPOWState { + // + double powerUp; + double powerDown; + + // + double signal; +}; +// +// End Models ... +// diff --git a/Libraries/x-saherelm.signal.lib.mq4 b/Libraries/x-saherelm.signal.lib.mq4 new file mode 100644 index 0000000..097ce74 --- /dev/null +++ b/Libraries/x-saherelm.signal.lib.mq4 @@ -0,0 +1,1756 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 Signal Draw Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// Includes Drawing library ... +#include "../Libraries/x-saherelm.draw.lib.mq4" + +// +#include "../Libraries/x-saherelm.x.signal.lib.mq4" +#include "../Libraries/x-saherelm.xr.signal.lib.mq4" +#include "../Libraries/x-saherelm.xtpw.signal.lib.mq4" + +// +// START Global Requirement Functions ... +// +// +// END Global Requirement Functions ... +// + +// +// START Signal Related Functions ... +// +// +// Retrieve Signal Bar Index ... +int GetSignalBarIndex(XSignal &signal) { + // + // Temp Result ... + int result = -1; + + // + // Retriev Signal Bar Index ... + result = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + return result; +} + +// +string GetSignalProviderIdentifier( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + string result = ""; + + // + switch (provider) { + // + case X_XXX_PROVIDER: + result = "XXX"; + break; + + // + case X_XR_PROVIDER: + result = "XR"; + break; + + // + case X_XTPW_PROVIDER: + result = "XTPW"; + break; + + // + default: + result = ""; + break; + } + + // + return result; +} + +// +ENUM_X_SIGNAL_PROVIDER GetSignalProvider(string identifier) { + // + ENUM_X_SIGNAL_PROVIDER result = X_UNKNOWN_PROVIDER; + + // + if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XXX_PROVIDER) + ) > -1 + ) { + result = X_XXX_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XR_PROVIDER) + ) > -1 + ) { + result = X_XR_PROVIDER; + } else if ( + StringFind( + identifier, + GetSignalProviderIdentifier(X_XTPW_PROVIDER) + ) > -1 + ) { + result = X_XTPW_PROVIDER; + } + + // + return result; +} + +// +// Retrieve Signal Lots Per Trade ... +double GetSignalLottage( + const XSignal &signal, + const double defLotsPerTrade +) { + // + double result = defLotsPerTrade; + + // + bool isLong = signal.type == X_SIGNAL_LONG; + + // + switch (signal.provider) { + // + case X_XR_PROVIDER: + // + result = isLong ? + xRLongLotsPerTradePercent : + xRShortLotsPerTradePercent + ; + break; + + // + case X_XXX_PROVIDER: + // + result = isLong ? + xLongLotsPerTradePercent : + xShortLotsPerTradePercent + ; + break; + + // + case X_XTPW_PROVIDER: + // + result = isLong ? + xTPWLongLotsPerTradePercent : + xTPWShortLotsPerTradePercent + ; + break; + } + + // + return result; +} + +// +// Draw Specific Range On Chart ... +void DrawRange( + const XRange &range, + const long chartID = 0, + const int subWindowID = 0, + const string tag = "", + const color clr = clrYellow +) { + // + // Loop through Levels Count ... + for (int i = 0; i <= range.levels; i++) { + // + datetime time1 = iTime( + _Symbol, + _Period, + 1 + ); + + // + datetime time2 = iTime( + _Symbol, + _Period, + 0 + ); + + // + double price = range.lowestLow + (i * range.rate); + + // + string lbl = StringConcatenate( + tag, + "_XRL_", + price + ); + + // + DrawTrendLine( + chartID, + lbl, + subWindowID, + time1, + price, + time2, + price, + clr, + STYLE_DOT + ); + } +} + +// +// Draw Signal Shapes on Chart ... +bool DrawSignal( + const XSignal &signal, + long chartID = 0, + int subWindowID = 0, + const double positionThresholdFactor = 10, + string longSignalLabel = "X-Long", + color longSignalColor = clrAqua, + string shortSignalLabel = "X-Short", + color shortSignalColor = clrFuchsia +) { + // + // Generate isLongSignal Var ... + bool isLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Signal Bar Index ... + int bar_index = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // START Draw Signal Arrow ... + // + // + // Arrow Shape Name ... + string arrowName = StringConcatenate(signal.tag, "_Arrow_", signal.id); + + // + // Arrow Price ... + double arrowPrice = 0; + if (isLongSignal) { + // + arrowPrice = iLow( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice - (positionThresholdFactor * _Point); + } else { + // + arrowPrice = iHigh( + _Symbol, + _Period, + bar_index + 1 + ); + + // + arrowPrice = arrowPrice + (positionThresholdFactor * _Point); + } + + // + // Arrow Code ... + uchar arrowCode = isLongSignal ? SYMBOL_ARROWUP : SYMBOL_ARROWDOWN; + + // + // Arrow Anchor Point ... + ENUM_ARROW_ANCHOR arrowAnchorPoint = isLongSignal ? ANCHOR_BOTTOM : ANCHOR_TOP; + + // + // Arrow Color ... + color arrowColor = isLongSignal ? longSignalColor : shortSignalColor; + + // + // Draw Signal Arrow Shape ... + bool result = DrawArrow( + chartID, + arrowName, + subWindowID, + signal.time, + arrowPrice, + arrowCode, + arrowAnchorPoint, + arrowColor + ); + // + // END Draw Signal Arrow ... + // + + // + // START Draw Signal SL/TP ... + // + string slLineName = StringConcatenate(signal.tag, "_SL_", signal.id); + string tpLineName = StringConcatenate(signal.tag, "_TP_", signal.id); + string entryLineName = StringConcatenate(signal.tag, "_ENTRY_", signal.id); + + // + color slColor = shortSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color tpColor = longSignalColor; // isLongSignal ? shortSignalColor : longSignalColor; + color entryColor = clrGreen; + + // + datetime time1 = iTime( + _Symbol, + _Period, + bar_index + 1 + ); + + // + // Draw Enrty Price ... + result = DrawTrendLine( + chartID, + entryLineName, + subWindowID, + time1, + signal.entry, + signal.time, + signal.entry, + entryColor, + STYLE_SOLID, + 2 + ); + + // + // Draw Signal SL ... + if (signal.sl > 0) { + // + result = DrawTrendLine( + chartID, + slLineName, + subWindowID, + time1, + signal.sl, + signal.time, + signal.sl, + slColor, + STYLE_SOLID, + 2 + ); + } + + // + // Draw Signal TP ... + if (signal.tp > 0) { + // + result = DrawTrendLine( + chartID, + tpLineName, + subWindowID, + time1, + signal.tp, + signal.time, + signal.tp, + tpColor, + STYLE_SOLID, + 2 + ); + } + // + // END Draw Signal SL/TP ... + // + + // + // Start Draw Signal Label ... + // + // + string labelName = StringConcatenate(signal.tag, "_Label_", signal.id); + + // + double labelPrice = isLongSignal ? arrowPrice - (positionThresholdFactor * _Point) : arrowPrice + (positionThresholdFactor * _Point); + + // + string labelText = isLongSignal ? longSignalLabel : shortSignalLabel; + labelText = StringConcatenate( + labelText, + "_", + GetSignalProviderIdentifier(signal.provider) + ); + + // + result = DrawText( + chartID, + labelName, + subWindowID, + signal.time, + labelPrice, + labelText, + "Arial", + 8, + arrowColor, + 0, + ANCHOR_CENTER + ); + // + // End Draw Signal Label ... + // + + // + return result; +} + +// +// Trade on Specific Signal ... +bool TradeSignal( + XSignal &signal, + // + double volumePercent, + // + // Long ... + const string longSignalLabel, + const color longSignalColor, + // + // Short ... + const string shortSignalLabel, + const color shortSignalColor +) { + // + // Temp Result ... + bool result = false; + + // + if (initialBalance == 0) { + initialBalance = AccountInfoDouble(ACCOUNT_BALANCE); + } + + // + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + int openPositions = CountOpenTrades(); + double volume = (volumePercent * initialBalance); + + // + if ( + signal.type != X_SIGNAL_LONG && + signal.type != X_SIGNAL_SHORT + ) { + return result; + } + + // + bool hasLongSignal = signal.type == X_SIGNAL_LONG; + + // + // Check TP and Entry Price ... + if ( + ( + hasLongSignal + && signal.entry > signal.tp + ) || + ( + !hasLongSignal + && signal.entry < signal.tp + ) + ) { + return result; + } + + // + // Order Operation ... + int operation = hasLongSignal ? + OP_BUY : + OP_SELL; + + // + // Detect Trade Color ... + color clr = hasLongSignal ? + longSignalColor : + shortSignalColor; + + // + // Generate Signal Comment ... + string label = hasLongSignal ? + longSignalLabel : + shortSignalLabel; + + // + // Generate Signal Comment ... + string comment = StringConcatenate( + signal.tag, + "_", signal.id, + "_", GetSignalProviderIdentifier(signal.provider), + "_", label + ); + + // + // Placing Order ... + int orderTicket = OrderSend( + _Symbol, + operation, + volume, + signal.entry, + 3, + signal.sl, + signal.tp, + comment, + signal.id, + 0, + clr + ); + + // + // Draw Signal Shape if Order Opened Successfully ... + if (orderTicket >= 0) { + // + signal.ticket = orderTicket; + + // + // Here i must to Draw Signal Shapes ... + bool isDrawn = DrawSignal( + signal, + 0, + 0, + 50, + longSignalLabel, // Long Signal Label ... + longSignalColor, + shortSignalLabel, // Short Signal Label ... + shortSignalColor + ); + + // + LogMessage( + StringConcatenate( + "Order [", orderTicket ,"]: Provided by: ", GetSignalProviderIdentifier(signal.provider) + ) + ); + + // + // TODO: here we have to check if there are another + // open positions which their entry price is bigger + // than current signal entry price, for long trades and + // their tp is high than current tp, ... + // close in profit trades or modify orders tp to current ... + // // + // if (CountOpenTrades() > 0) { + // // + // // Here we have to + // ModifyOpenTradesBasedOnCurrentTrade(signal); + // } + + // + result = true; + } + + // + return result; +} +// +// END Signal Related Functions ... +// + +// +// START Orders Functions ... +// +// +// Convert To XSignal Model ... +XSignal OrderToSignal() { + // + // Temp Result ... + XSignal result = {}; + result.type = X_SIGNAL_NONE; + + // + // Here we can get some usefull info based on selected order ... + double swap = OrderSwap(); + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + int magicNumber = OrderMagicNumber(); + double takeProfit = OrderTakeProfit(); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER provider = GetSignalProvider(comment); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // Conver Position to Signal ... + result.sl = stopLoss; + result.tp = takeProfit; + result.time = openTime; + result.symbol = _Symbol; + result.id = magicNumber; + result.comment = comment; + result.entry = openPrice; + result.provider = provider; + result.type = isLongOrder ? X_SIGNAL_LONG : X_SIGNAL_SHORT; + + // + return result; +} + +// +// START Count Orders ... +// +// +// Count Open Positions ... +int CountOpenTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if (OrderSymbol() == _Symbol) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Long Positions ... +int CountOpenLongTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_BUY + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} + +// +// Count Open Short Positions ... +int CountOpenShortTrades() { + // + int result = 0; + + // + // Loop through Orders ... + for (int i = 0; i < OrdersTotal(); i++) { + // + // Select indexed Order ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order ... + if ( + OrderSymbol() == _Symbol + && OrderType() == OP_SELL + ) { + result++; + } + } + } + + // + // Return Result ... + return result; +} +// +// END Count Orders ... +// + +// +// START Close Orders ... +// +// +// Close All Open Trades ... +bool CloseAllTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + + // + return result; +} + +// +bool CloseAllProviderTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if (signal.provider == provider) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderLongTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_LONG + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +bool CloseAllProviderShortTrades( + ENUM_X_SIGNAL_PROVIDER provider +) { + // + bool result = false; + + // + // Loop through Signals ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + XSignal signal = OrderToSignal(); + + // + if ( + signal.provider == provider + && signal.type == X_SIGNAL_SHORT + ) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Provider Long Trades Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Long Trades ... +bool CloseAllLongTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Long Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Open Short Trades ... +bool CloseAllShortTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + if (!isLongOrder) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of All Short Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In Profit Trades ... +bool CloseAllInProfitTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit > 0 + && profit > 50 * _Point + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InProfit Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All In DrawDown Trades ... +bool CloseAllInDrawDownTrades() { + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if (profit < 0) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close Biggest In DrawDown Trades ... +bool CloseBiggestDrawDownTrade() { + // + // Loop through all Positions ... + bool result = false; + double drawDown = 0; + + // + // Find Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) > drawDown + ) { + drawDown = profit; + } + } + } + } + + // + // Close Biggest In DrawDown ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + if ( + profit < 0 + && MathAbs(profit) >= drawDown + ) { + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Max InDrawDown Trade Closing issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Long Time Trades ... +bool CloseAllLongTimeTrades( + const int passedCandles, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + bool result = false; + + // + if (passedCandles <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + string comment = OrderComment(); + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isProviderVerified + && openBarIndex - currentBarIndex >= passedCandles + // || ( + // profit > 0.5 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 3) + // ) + ) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Long Time issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + // else if ( + // openTrades > 0 + // && openBarIndex - currentBarIndex >= passedCandles - (passedCandles / 2) + // ) { + // result = CloseAllInProfitTrades() + // && CloseBiggestDrawDownTrade(); + // } + } + } + } + + // + return result; +} + +// +// Close all trades which passed Maximum Drawdown ... +bool CloseAllMaximumDrawDownPassedTrades( + const double maxDrDownPercentPerPTrade, + const ENUM_X_SIGNAL_TYPE type = X_SIGNAL_NONE, + const ENUM_X_SIGNAL_PROVIDER provider = X_UNKNOWN_PROVIDER +) { + // + if ( + initialBalance <= 0 + || maxDrDownPercentPerPTrade <= 0 + ) { + return false; + } + + // + // Retrieve Account Balance ... + double balance = AccountInfoDouble(ACCOUNT_BALANCE); + double maxAllowedDrawDown = -1 * (initialBalance * maxDrDownPercentPerPTrade); + + // + // Loop through all Positions ... + bool result = false; + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + string comment = OrderComment(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + bool isTypeVerified = + type == X_SIGNAL_NONE ? + true : + ( isLongOrder + && type == X_SIGNAL_LONG + ) || ( + !isLongOrder + && type == X_SIGNAL_SHORT + ) + ; + + // + ENUM_X_SIGNAL_PROVIDER orderProvider = GetSignalProvider(comment); + bool isProviderVerified = + provider == X_UNKNOWN_PROVIDER ? + true : + orderProvider != X_UNKNOWN_PROVIDER + && orderProvider == provider + ; + + // + if ( + profit < 0 + && isTypeVerified + && isProviderVerified + && MathAbs(profit) >= MathAbs(maxAllowedDrawDown) + ) { + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Maximum DarwDown issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } + } + } + } + + // + return result; +} + +// +// Close All Trades Which Opens before Specified Length ... +bool CloseAllTradesWhichOpenInPastMarketLength( + const int marketLen +) { + // + bool result = false; + + // + if (marketLen <= 0) { + return result; + } + + // + int currentBarIndex = iBarShift( + _Symbol, + _Period, + TimeCurrent() + ); + + // + int openTrades = CountOpenTrades(); + + // + // Loop through all Positions ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + datetime openTime = OrderOpenTime(); + int openBarIndex = iBarShift( + _Symbol, + _Period, + openTime + ); + + // + if (openBarIndex <= currentBarIndex + marketLen) { + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // Since because of equity ... + // we have to ckose allpositions ... + bool isOrderClosed = OrderClose( + ticket, + lots, + closePrice, + clrYellow + ); + + // + if (isOrderClosed) { + // + LogMessage( + StringConcatenate( + "Order [", ticket, "] Closed because of Market Reverse issue ..." + ) + ); + } + + // + result = + result + || isOrderClosed; + } else if (openTrades > 0) { + // + // Close all InProfit Trdes and Biggest InDrawDown Trades ... + // result = CloseAllInProfitTrades(); + // && CloseBiggestDrawDownTrade(); + } + } + } + } + + // + return result; +} +// +// END Close Orders ... +// + +// +// START Modify Orders ... +// +// +void ModifyAllPriceLesserOpenTrades( + const XSignal &signal +) { + // + // Loop through all Open Trades ... + for (int i = OrdersTotal(); i >= 0; i--) { + // + // Check Order Selected or not ... + if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { + // + // Check Order Symbol is same as Current Symbol ... + if (OrderSymbol() == _Symbol) { + // + double lots = OrderLots(); + int ticket = OrderTicket(); + double profit = OrderProfit(); + double stopLoss = OrderStopLoss(); + double openPrice = OrderOpenPrice(); + datetime openTime = OrderOpenTime(); + double takeProfit = OrderTakeProfit(); + + // + // find order type ... + bool isLongOrder = OrderType() == OP_BUY; + + // + // find close price ... + double closePrice = isLongOrder ? + SymbolInfoDouble(_Symbol, SYMBOL_BID) : + SymbolInfoDouble(_Symbol, SYMBOL_ASK); + + // + // When new Signal Comming with price less than + // currently open trade and tp less than currently + // open trade, this means a market change happens ... + // here we can Close InProfit Trades or Modify Trades TP ... + if ( + ( + openPrice < signal.entry + || MathAbs(openPrice - signal.entry) < 300 * _Point + ) + && takeProfit > signal.tp + ) { + bool result = OrderModify( + ticket, + openPrice, + signal.sl, + signal.tp, + clrYellow + ); + } + } + } + } +} + +// +void ModifyOpenTradesBasedOnCurrentTrade( + const XSignal &signal +) { + // + ModifyAllPriceLesserOpenTrades(signal); +} +// +// END Modify Orders ... +// +// +// END Orders Functions ... +// + +// +// START Signal Conditions ... +// +// +// Clear Signal Conditions ... +void ClearSignalConditions() { + // + ClearLongSignalConditions(); + ClearShortSignalConditions(); +} + +// +// Clear all Conditions Waiter for Long Signals ... +void ClearLongSignalConditions() { + // + ClearXLongSignalConditions(); + ClearXRLongSignalConditions(); + ClearXTPWLongSignalConditions(); +} + +// +// Clear all Conditions Waiter for Short Signals ... +void ClearShortSignalConditions() { + // + ClearXShortSignalConditions(); + ClearXRShortSignalConditions(); + ClearXTPWShortSignalConditions(); +} +// +// END Signal Conditions ... +// diff --git a/Libraries/x-saherelm.x.signal.lib.mq4 b/Libraries/x-saherelm.x.signal.lib.mq4 new file mode 100644 index 0000000..834ddb1 --- /dev/null +++ b/Libraries/x-saherelm.x.signal.lib.mq4 @@ -0,0 +1,1063 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xStarter = "- X Signal Provider -"; // ---> X Signal Provider <--- + +// +input bool enableXSignalling = true; // X Signalling Enable + +// +input bool enableXLong = true; // X Signalling Enable Long +input bool enableXShort = true; // X Signalling Enable Short + +// +input double xShortR2R = 3; // X Short Risk To Reward Ratio +input double xShortLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xShortMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Short Trade + +// +input double xLongR2R = 3; // X Long Risk To Reward Ratio +input double xLongLotsPerTradePercent = 0.0002; // X Lots Percent per Short Trades +input double xLongMaxDrawdownPerTradePercent = 0.4; // X Max Allowed DrawDown Percent per Long Trade + +// +input double xSharpDetectorFactor = 700; // X Sharp Detection Factor + +// +input int xMaximumCandlesPerTrade = 206; // X Maximum Candles which a Trade can open + +// +input int xOscillatorLength = 7; // X Oscillator Length + +// +input double xPSarStep = 0.02; // X Parabolic Sar Step +input double xPSarMaximum = 0.2; // X Parabolic Sar Maximum + +// +input int xRangeMarketLength = 5; // X Range Detector Length + +// +input int xSwingLength = 7; // X Signal Swing Length +// +// END Inputs ... +// + +// +// START Global Requirement Functions ... +// +// +// X Based Signal Conditions ... +struct XSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XMarketState { + double psar; + double fast; + double slow; + double open; + double verifier; + double oscillator; + double oscillatorVerifier; +}; + +// +static XSignalConditions xLongConds; +static bool xCloseLongTrades = false; +static bool xWaitForLongSignals = true; + +// +static XSignalConditions xShortConds; +static bool xCloseShortTrades = false; +static bool xWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xFailedSignals = 0; + +// +datetime lastVerifierTouched; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle = GetCandleModel(bar_index); + XOHCL pCandle = GetCandleModel(bar_index + 1); + XTPOWState tPowState = GetXTPowState( + bar_index + 1, + xSwingLength + ); + + // + XMarketState state = GetXMarketState( + bar_index + 1 + ); + + // + // Check Verifier Last Touched ... + bool isVerifierTouched = pCandle.high > state.verifier + && pCandle.low < state.verifier; + + // + // Disable Signals if a signal Failed ... + if (xFailedSignals) { + // + // TODO: Complete this ... + } + + // + // Enable Or Disable Signalling ... + if (isVerifierTouched) { + // + lastVerifierTouched = barTime; + + // + if (xWaitForLongSignals) { + xWaitForLongSignals = false; + } + + // + if (xWaitForShortSignals) { + xWaitForShortSignals = false; + } + } else { + // + int lastVerifierTouchedBarIndex = iBarShift( + _Symbol, + _Period, + lastVerifierTouched + ); + + // + int distance = MathAbs(lastVerifierTouchedBarIndex - bar_index); + + // + if ( + !xWaitForLongSignals + && distance > (xSwingLength * 2) + ) { + xWaitForLongSignals = true; + } + + // + if ( + !xWaitForShortSignals + && ( + distance > (xSwingLength * 2) + || ( + tPowState.powerDown > tPowState.powerUp + && tPowState.powerDown < 49 + ) + ) + ) { + xWaitForShortSignals = true; + } + } + + // + // Close All Long Open Trades ... + if ( + tPowState.powerDown > 55 + && tPowState.powerDown > tPowState.powerUp + ) { + // xCloseLongTrades = true; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXLong + || !enableXSignalling + || !xWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossUnder + && xLongConds.startTime == 0 + ) { + // + xLongConds.startTime = barTime; + return; + } + + // + if ( + isCrossOver + && xLongConds.startTime > 0 + && xLongConds.signalTime == 0 + ) { + // + xLongConds.signalTime = barTime; + xLongConds.entryTime = barTime; + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXShort + || !enableXSignalling + || !xWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + bool isCrossOver = false; + bool isCrossUnder = false; + + // + XMarketState cState = GetXMarketState(1); + XMarketState pState = GetXMarketState(2); + + // + isCrossUnder = + cState.fast < cState.slow + && !(pState.fast < pState.slow) + ; + + // + isCrossOver = + cState.fast > cState.slow + && !(pState.fast > pState.slow) + ; + + // + if ( + isCrossOver + && xShortConds.startTime == 0 + ) { + // + xShortConds.startTime = barTime; + return; + } + + // + if ( + isCrossUnder + && xShortConds.startTime > 0 + && xShortConds.signalTime == 0 + ) { + // + xShortConds.signalTime = barTime; + xShortConds.entryTime = barTime; + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + // + RefreshRates(); + + // + double askPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_ASK + ); + + // + double bidPrice = SymbolInfoDouble( + _Symbol, + SYMBOL_BID + ); + + // + double entryPrice = requestLong ? + askPrice : + bidPrice; + + // + double exitPrice = requestLong ? + bidPrice : + askPrice; + + // + double priceGap = MathAbs(entryPrice - exitPrice); + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double reward = + requestLong ? + risk * xLongR2R : + risk * xShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + XRState range = GetXRange( + bar_index, + xRangeMarketLength + ); + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XXX_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XXX_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXLongConditions() { + // + if ( + !enableXLong + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xLongConds.startTime > 0 + && xLongConds.signalTime > 0 + && xLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xLongConds.entryTime + ); + + // + isBLFilled = + // + xLongConds.signalTime > xLongConds.startTime + && xLongConds.entryTime >= xLongConds.signalTime + // && MathAbs(signalBarIndex - startBarIndex) >= 1 + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXShortConditions() { + // + if ( + !enableXShort + || !enableXSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xShortConds.startTime > 0 + && xShortConds.signalTime > 0 + && xShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + int startBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.startTime + ); + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.signalTime + ); + + // + int entryBarIndex = iBarShift( + _Symbol, + _Period, + xShortConds.entryTime + ); + + // + isBLFilled = + // + xShortConds.signalTime > xShortConds.startTime + && xShortConds.entryTime >= xShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXLongSignalConditions() { + // + xLongConds.startTime = 0; + xLongConds.entryTime = 0; + xLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXShortSignalConditions() { + // + xShortConds.startTime = 0; + xShortConds.entryTime = 0; + xShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXSignalling + || !(enableXLong || enableXShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle = GetCandleModel(signalBarIndex); + XOHCL pCandle = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve Range ... + XRState range = GetXRange( + signalBarIndex, + xRangeMarketLength + ); + + // + // Retrive XMarket States ... + XMarketState xState0 = GetXMarketState(signalBarIndex); + XMarketState xState1 = GetXMarketState(signalBarIndex + 1); + XMarketState xState2 = GetXMarketState(signalBarIndex + 2); + XMarketState xStateLast = GetXMarketState(signalBarIndex + xSwingLength); + + // + // Retrieve Trend Powers ... + XTPOWState xTPow0 = GetXTPowState( + signalBarIndex, + xSwingLength + ); + XTPOWState xTPow1 = GetXTPowState( + signalBarIndex + 1, + xSwingLength + ); + + // + double hh = GetMarketHighestHigh( + signalBarIndex, + xSwingLength + ); + double ll = GetMarketLowestLow( + signalBarIndex, + xSwingLength + ); + double diffChange = (hh - ll); + bool isBigSharpOccured = + diffChange > (xSharpDetectorFactor * _Point) + ; + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry < hh + // + // && signal.entry < range.hh + // && signal.entry > range.mid + // // + // && candle.high > xState0.verifier + // && signal.entry > xState0.verifier + // + // && pCandle.low != ll + && pCandle.high != hh + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp < iTPowState.powerDown + || iTPowState.signal > MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers > 1 + && tPowUnverifyConditions == 0 + ; + + // + isPSarVerified = + xState0.psar < signal.entry + && xState0.psar < candle.low; + + // + isStateVerified = + // + // Start ... + true + // + // && xState0.open < xState0.slow + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + xState0.psar > signal.entry + && xState0.psar > candle.high + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + // + && !isBigSharpOccured + // + && signal.entry > ll + && pCandle.low != ll + ; + + // + int above20TPowers = 0; + double signalSlope = 0; + int tPowUnverifyConditions = 0; + int tPowUnverifyConditionsIdx = 0; + for (int i = signalBarIndex; i < signalBarIndex + xSwingLength; i++) { + // + XTPOWState iTPowState = GetXTPowState( + i, + xSwingLength + ); + + // + // Calculate Signal Slope ... + if (i == signalBarIndex) { + // + signalSlope = iTPowState.signal; + } else if (i == signalBarIndex + 1) { + // + signalSlope = GetSlope( + 1, + iTPowState.signal, + 2, + signalSlope + ); + } + + // + if ( + iTPowState.powerUp > iTPowState.powerDown + && MathMax(iTPowState.powerUp, iTPowState.powerDown) > 20 + ) { + above20TPowers++; + } + + // + if (tPowUnverifyConditionsIdx < 3) { + // + if ( + iTPowState.powerUp > iTPowState.powerDown + || iTPowState.signal < MathMax(iTPowState.powerUp, iTPowState.powerDown) + ) { + tPowUnverifyConditions++; + } + + // + tPowUnverifyConditionsIdx++; + } + } + + // + isTPowVerified = + above20TPowers < 1 + && tPowUnverifyConditions == 0 + && MathAbs(xTPow0.powerUp - xTPow0.powerDown) > 50 * _Point + ; + + // + isStateVerified = + // + // Start ... + true + // + // && (xStateLast.verifier - xState0.verifier) >= 0 + // + && xState0.verifier > signal.entry + // + && MathAbs(signal.entry - xState0.verifier) < (xSharpDetectorFactor * _Point) + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +XMarketState GetXMarketState( + const int bar_index +) { + // + XMarketState result = {}; + + // + double fast = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + xSwingLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double slow = GetMA( + bar_index, + xSwingLength * 2, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double oscillator = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_CLOSE + ); + + // + double oscillatorVerifier = GetMA( + bar_index, + xSwingLength, + 0, + MODE_EMA, + PRICE_WEIGHTED + ); + + // + int dailyCount = GetDailyCandleCount(); + double verifier = GetMA( + bar_index, + dailyCount, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xPSarStep, + xPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.fast = fast; + result.open = open; + result.slow = slow; + result.verifier = verifier; + result.oscillator = oscillator; + result.oscillatorVerifier = oscillatorVerifier; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/Libraries/x-saherelm.xr.signal.lib.mq4 b/Libraries/x-saherelm.xr.signal.lib.mq4 new file mode 100644 index 0000000..53785cf --- /dev/null +++ b/Libraries/x-saherelm.xr.signal.lib.mq4 @@ -0,0 +1,1142 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 X Signal Global Library +// --------------------------------------------------- +// saherelm useful tools and definitions ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xRStarter = "- XR Signal Provider -"; // --> XR Signal Provider <-- + +// +input bool enableXRSignalling = false; // XR Signalling Enable + +// +input bool enableXRLong = true; // XR Signalling Enable Long +input bool enableXRShort = true; // XR Signalling Enable Short + +// +input double xRShortR2R = 1.5; // XR Short Risk To Reward Ratio +input double xRShortLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRShortMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Short Trade + +// +input double xRLongR2R = 1.5; // XR Long Risk To Reward Ratio +input double xRLongLotsPerTradePercent = 0.0002; // XR Lots Percent per Short Trades +input double xRLongMaxDrawdownPerTradePercent = 0.15; // XR Max Allowed DrawDown Percent per Long Trade + +// +input int xRMaximumCandlesPerTrade = 96; // XR Maximum Candles which a Trade can open + +// +input int xRSwingLength = 48; // XR Swing Length +// +// END Inputs ... +// + +// +input double xRSharpDetectionFactor = 1350; // XR Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XR Market State ... +struct XRMarketState { + // + double fast; + double slow; + double open; + + // + double range; + double rangeFast; + double rangeSlow; + double rangeOpen; + + // + double verifier; +}; + +// +// XR Based Signal Conditions ... +struct XRSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +static XRSignalConditions xRLongConds; +static bool xRCloseLongTrades = false; +static bool xRWaitForLongSignals = true; + +// +static XRSignalConditions xRShortConds; +static bool xRCloseShortTrades = false; +static bool xRWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xRFailedSignals = 0; + +// +double xRMaximumDrawDown = 0; + +// +int fastLength = 0; +int slowLength = 0; + +// +int verifierLength = 0; + +// +int rangeFastLength = 0; +int rangeSlowLength = 0; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXRSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return; + } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXRLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool longCondition1 = + // + // Starter ... + true + // + && isMarketBullish + // + && + ( + candle2.high < range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.low > range1.mid + ; + + // + if ( + // + ( + longCondition1 + ) + // + && xRLongConds.startTime == 0 + && xRLongConds.entryTime == 0 + && xRLongConds.signalTime == 0 + ) { + // + xRLongConds.startTime = barTime; + xRLongConds.entryTime = barTime; + xRLongConds.signalTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXRShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + bar_index, + xRSwingLength + ); + + // + // Double Length Pivots ... + XPvtState dblPvt0 = GetPVTState( + bar_index, + (xRSwingLength * 2) + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(bar_index); + XRMarketState state1 = GetXRMarketState(bar_index + 1); + XRMarketState state2 = GetXRMarketState(bar_index + 2); + XRMarketState state3 = GetXRMarketState(bar_index + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + bar_index + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + bar_index + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + bar_index + xRSwingLength + 2, + xRSwingLength + ); + + // + XRState cRange0 = ReadXRange( + bar_index, + xRSwingLength + ); + + // + // Validate Farest Range Values ... + if ( + range2.hh == 0 + || + range2.ll == 0 + || + range2.mid == 0 + ) { + return; + } + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xRSwingLength + ); + + // + // if state verifier below range middle + // this means market is bullish ... + // + // if state verifier above range middle + // this means market is bearish ... + // + + // + bool isMarketBullish = + state0.verifier < range0.mid + && state1.verifier < range1.mid; + bool isMarketBearish = + state0.verifier > range0.mid + && state1.verifier > range1.mid; + bool isMarketGoingBullish = + state0.verifier > range0.mid + && !(state1.verifier > range1.mid); + bool isMarketGoingBearish = + state0.verifier < range0.mid + && !(state1.verifier < range1.mid); + + // + // Check Highest High Conditions ... + bool isHHVerified = + !( + pvt0.hh == dblPvt0.hh + ) + ; + + // + int sharpDetectionLength = 7; + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + + // + int sharpHHIdx = iHighest( + _Symbol, + _Period, + MODE_HIGH, + sharpDetectionLength, + bar_index + ); + double sharpHH = iHigh( + _Symbol, + _Period, + sharpHHIdx + ); + + // + int sharpLLIdx = iLowest( + _Symbol, + _Period, + MODE_LOW, + sharpDetectionLength, + bar_index + ); + double sharpLL = iLow( + _Symbol, + _Period, + sharpLLIdx + ); + + // + double sharpDiff = sharpHH - sharpLL; + bool isSharpOccered = + sharpDiff > sharpDetectionValue; + + // + XRMarketState lastState = GetXRMarketState( + bar_index + sharpDetectionLength + ); + + // + double stateFSDiff = (state0.fast - state0.slow) - (lastState.fast - lastState.slow); + + // + // Start Calculating Long Conditions ... + bool shortCondition1 = + // + // Starter ... + true + // + && isMarketBearish + // + && + ( + candle2.low > range2.mid + || ( + candle2.high > range2.mid + && candle2.low < range2.mid + ) + ) + && candle1.high < range1.mid + ; + + // + if ( + // + ( + shortCondition1 + ) + // + && xRShortConds.startTime == 0 + && xRShortConds.entryTime == 0 + && xRShortConds.signalTime == 0 + ) { + // + xRShortConds.startTime = barTime; + xRShortConds.entryTime = barTime; + xRShortConds.signalTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXRSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + if (requestLong) { + // + if ( + !ValidateXRLongConditions() + ) { + return result; + } + } else { + // + if ( + !ValidateXRShortConditions() + ) { + return result; + } + } + + // + // Price Calculations ... + XPvtState pvts = GetPVTState( + bar_index, + xRSwingLength + ); + XPrice prices = GetPrice(); + + // + double entryPrice = requestLong ? + prices.longEntry : + prices.shortEntry + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + double risk = requestLong ? + MathMin(openPrice, closePrice) - pvts.ll : + pvts.hh - MathMax(openPrice, closePrice); + if (risk <= 0) { + // + risk = requestLong ? + MathAbs(pvts.hh - entryPrice) : + MathAbs(pvts.ll - entryPrice) + ; + } + + // + double reward = + requestLong ? + risk * xRLongR2R : + risk * xRShortR2R + ; + + // + double sl = requestLong ? + 0 : + 0; + + // + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XR_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XR_PROVIDER; + + // + return result; +} + +// +// Validate Long Signal Conditions ... +bool ValidateXRLongConditions() { + // + if ( + !enableXRLong + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRLongConds.startTime > 0 + && xRLongConds.signalTime > 0 + && xRLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRLongConds.signalTime >= xRLongConds.startTime + && xRLongConds.entryTime >= xRLongConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Short Signal Conditions ... +bool ValidateXRShortConditions() { + // + if ( + !enableXRShort + || !enableXRSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xRShortConds.startTime > 0 + && xRShortConds.signalTime > 0 + && xRShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // + isBLFilled = + // + xRShortConds.signalTime >= xRShortConds.startTime + && xRShortConds.entryTime >= xRShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xRWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXRShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXRLongSignalConditions() { + // + xRLongConds.startTime = 0; + xRLongConds.signalTime = 0; + xRLongConds.entryTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXRShortSignalConditions() { + // + xRShortConds.startTime = 0; + xRShortConds.signalTime = 0; + xRShortConds.entryTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXRSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXRSignalling + || !(enableXRLong || enableXRShort) + ) { + return result; + } + + // + // Find Signal Bar Index ... + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // Read Prices ... + XPrice prices = GetPrice(); + + // + // Read XPVTState ... + XPvtState pvt0 = GetPVTState( + signalBarIndex, + xRSwingLength + ); + + // + // Reading Required Candles ... + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + XOHCL candle2 = GetCandleModel(signalBarIndex + 2); + XOHCL candle3 = GetCandleModel(signalBarIndex + 3); + + // + // Reding Required XRMarketStates ... + XRMarketState state0 = GetXRMarketState(signalBarIndex); + XRMarketState state1 = GetXRMarketState(signalBarIndex + 1); + XRMarketState state2 = GetXRMarketState(signalBarIndex + 2); + XRMarketState state3 = GetXRMarketState(signalBarIndex + 3); + + // + // Reading required XRangeStates ... + XRState range0 = ReadXRange( + signalBarIndex + xRSwingLength, + xRSwingLength + ); + XRState range1 = ReadXRange( + signalBarIndex + xRSwingLength + 1, + xRSwingLength + ); + XRState range2 = ReadXRange( + signalBarIndex + xRSwingLength + 2, + xRSwingLength + ); + + // + // Reading Required XTPowStates ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xRSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xRSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + signalBarIndex + 2, + xRSwingLength + ); + + // + double hhllDiff = MathAbs(pvt0.hh - pvt0.ll); + double sharpDetectionValue = xRSharpDetectionFactor * _Point; + bool isSharpOccured = hhllDiff > sharpDetectionValue; + + // + // Calculate State Min Max Diff ... + // + double state0Min = MathMin(state0.fast, state0.slow); + state0Min = MathMin(state0Min, state0.open); + state0Min = MathMin(state0Min, state0.rangeFast); + state0Min = MathMin(state0Min, state0.rangeSlow); + state0Min = MathMin(state0Min, state0.rangeOpen); + state0Min = MathMin(state0Min, state0.verifier); + + // + double state0Max = MathMax(state0.fast, state0.slow); + state0Max = MathMax(state0Max, state0.open); + state0Max = MathMax(state0Max, state0.rangeFast); + state0Max = MathMax(state0Max, state0.rangeSlow); + state0Max = MathMax(state0Max, state0.rangeOpen); + state0Max = MathMax(state0Max, state0.verifier); + + // + double state0MinMaxDiff = (state0Max - state0Min); + + // + bool isTPowValid = false; + bool isStateValid = false; + bool isRangeValid = false; + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + // + // && !(state0MinMaxDiff > sharpDetectionValue) + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + // Retrieve TPow Verifications ... + isTPowValid = + // + // Starter ... + true + ; + + // + // Retrieve XMarket Verifications ... + isStateValid = + // + // Starter ... + true + ; + + // + // Retrieve XRange Verifications ... + isRangeValid = + // + // Starter ... + true + ; + + // + result = + // + // Starter ... + true + // + && isTPowValid + && isStateValid + && isRangeValid + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Providers ... +// +// +XRMarketState GetXRMarketState( + const int bar_index +) { + // + XRMarketState result = {}; + + // + // Calculate Market Lengths ... + + // + if (fastLength == 0) { + fastLength = xRSwingLength; + } + + // + if (slowLength == 0) { + slowLength = xRSwingLength * 2; + } + + // + if (verifierLength == 0) { + verifierLength = (GetDailyCandleCount() * 2); + } + + // + if (rangeFastLength == 0) { + rangeFastLength = (int)(verifierLength / 2); + } + + // + if (rangeSlowLength == 0) { + rangeSlowLength = verifierLength; + } + + // + // Reading Values ... + + // + double fast = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double slow = GetMA( + bar_index, + slowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double open = GetMA( + bar_index, + fastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double rangeFast = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeSlow = GetMA( + bar_index, + rangeSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double rangeOpen = GetMA( + bar_index, + rangeFastLength, + 0, + MODE_SMA, + PRICE_OPEN + ); + + // + double verifier = GetMA( + bar_index, + verifierLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + // Filling Result ... + result.fast = fast; + result.slow = slow; + result.open = open; + result.verifier = verifier; + result.rangeFast = rangeFast; + result.rangeSlow = rangeSlow; + result.rangeOpen = rangeOpen; + + // + return result; +} +// +// END Data Providers ... +// \ No newline at end of file diff --git a/Libraries/x-saherelm.xtpw.signal.lib.mq4 b/Libraries/x-saherelm.xtpw.signal.lib.mq4 new file mode 100644 index 0000000..4bf02ce --- /dev/null +++ b/Libraries/x-saherelm.xtpw.signal.lib.mq4 @@ -0,0 +1,1332 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL4 XTPW Signal Global Library +// --------------------------------------------------- +// XSaherElm EA Signal Provider based on +// XTPow Indicator... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Includes library ... +#include "../Libraries/x-saherelm.lib.mq4" + +// +// Includes Indicator library ... +#include "../Libraries/x-saherelm.indicator.lib.mq4" + +// +// Includes Models library ... +#include "../Libraries/x-saherelm.models.lib.mq4" + +// +// START Inputs ... +// +// +input string xTPWStarter = "- XTPW Signal Provider -"; // ---> XTPW Signal Provider <--- + +// +input bool enableXTPWSignalling = true; // XTPW Signalling Enable + +// +input bool enableXTPWLong = true; // XTPW Signalling Enable Long +input bool enableXTPWShort = true; // XTPW Signalling Enable Short + +// +input double xTPWShortR2R = 2; // XTPW Short Risk To Reward Ratio +input double xTPWShortLotsPerTradePercent = 0.0002; // XTPW Lots Percent per Short Trades +input double xTPWShortMaxDrawdownPerTradePercent = 0.3; // XTPW Max Allowed DrawDown Percent per Short Trade + +// +input double xTPWLongR2R = 2; // XTPW Long Risk To Reward Ratio +input double xTPWLongLotsPerTradePercent = 0.0002; // XTPW Lots Percent per Short Trades +input double xTPWLongMaxDrawdownPerTradePercent = 0.3; // XTPW Max Allowed DrawDown Percent per Long Trade + +// +input int xTPWMaximumCandlesPerTrade = 206; // XTPW Maximum Candles which a Trade can open + +// +input double xTPWPSarStep = 0.02; // XTPW Parabolic Sar Step +input double xTPWPSarMaximum = 0.2; // XTPW Parabolic Sar Maximum + +// +input int xTPWSwingLength = 7; // XTPW Signal Swing Length +// +// END Inputs ... +// + +// +input double xTPWSharpDetectionFactor = 650; // XTPW Sharp Detection Factor + +// +// START Global Requirement Functions ... +// +// +// XTPW Based Signal Conditions ... +struct XTPWSignalConditions { + datetime startTime; + datetime signalTime; + datetime entryTime; +}; + +// +struct XTPWMarketState { + // + double psar; + + // + double scFast; + double scSlow; + double scWeight; + + // + double mcFast; + double mcSlow; + double mcWeight; + + // + double lcFast; + double lcSlow; + double lcWeight; +}; + +// +struct XLHS { + // + double scHH; + double scLL; + + // + double mcHH; + double mcLL; + + // + double lcHH; + double lcLL; +}; + +// +static XTPWSignalConditions xTPWLongConds; +static bool xTPWCloseLongTrades = false; +static bool xTPWWaitForLongSignals = true; + +// +static XTPWSignalConditions xTPWShortConds; +static bool xTPWCloseShortTrades = false; +static bool xTPWWaitForShortSignals = true; + +// +// Count Number of Closed Maximum DrawDown Trades ... +static int xTPWFailedSignals = 0; + +// +double tPowerVerifier = 20; +double tPowerMaxVerifier = 55; + +// +int scFastLength = 0; +int scSlowLength = 0; + +// +int mcFastLength = 0; +int mcSlowLength = 0; + +// +int lcFastLength = 0; +int lcSlowLength = 0; + +// +datetime lastTurnOffLongTradesTime; +datetime lastTurnOffShortTradesTime; +// +// END Global Requirement Functions ... +// + +// +// START Functions ... +// +// +// Check and Fill Long and Short Signal Handlers ... +void CheckXTPWSignalHandler( + const int bar_index +) { + // + // Check Market For Enable/Disable Signal Handlers ... + // Checking Market for Long Signals ... + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 1); + + // + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // // + // // Disable Long Conditions ... + // if ( + // xTPWWaitForLongSignals + // && + // ( + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperAboveMaxVerifier + // ) + // ) { + // // + // xTPWWaitForLongSignals = false; + // lastTurnOffLongTradesTime = barTime; + // } + + // // + // // Enable Long Conditions ... + // if ( + // !xTPWWaitForLongSignals + // && lastTurnOffLongTradesTime > 0 + // && ( + // // isFastCrossOverSlow + // // || + // // isFastCrossUnderSlow + // isRangeCrossOverRangeWeight + // || + // isRangeCrossUnderRangeWeight + // || + // isTPowUpperBelowMaxVerifier + // ) + // ) { + // // + // // Find Last Turn Off Bar Index ... + // int lastTurnOffLongTradesBarIndex = iBarShift( + // _Symbol, + // _Period, + // lastTurnOffLongTradesTime + // ); + + // // + // // the Distance must be bigger than market length ... + // if (MathAbs(lastTurnOffLongTradesBarIndex - bar_index) > xTPWSwingLength) { + // // + // xTPWWaitForLongSignals = true; + // lastTurnOffLongTradesTime = 0; + // } + // } +} + +// +// Check and Fill Long Signal Conditions ... +void CheckXTPWLongSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + || !xTPWWaitForLongSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPow States ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPowMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve XPrice Model ... + XPrice prices = GetPrice(); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XLHS lhs = GetXTPWLHS(bar_index); + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool longCondition1 = + // + true + // + && !isHHSame + // + && !( + lhs.scLL == lhs.mcLL + ) + // + && !( + lhs.scHH == lhs.mcHH + ) + // + && !( + prices.longEntry + && candle0.high < state0.scFast + && candle0.high < state0.scSlow + && candle0.high < state0.mcFast + && candle0.high < state0.mcSlow + && candle0.high < state0.lcFast + && candle0.high < state0.lcSlow + ) + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + // Start Conditions ... + startCondition = ( + longCondition1 + ) + ; + + // + if ( + startCondition + && xTPWLongConds.startTime == 0 + && xTPWLongConds.signalTime == 0 + && xTPWLongConds.entryTime == 0 + ) { + // + xTPWLongConds.startTime = barTime; + xTPWLongConds.signalTime = barTime; + xTPWLongConds.entryTime = barTime; + + // + return; + } +} + +// +// Check and Fill Short Signal Conditions ... +void CheckXTPWShortSignalConditions( + const int bar_index +) { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + || !xTPWWaitForShortSignals + ) { + return; + } + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + // Retrieve TPower State ... + XTPOWState tPow0 = GetXTPowState( + bar_index, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + bar_index + 1, + xTPWSwingLength + ); + XTPOWState tPow2 = GetXTPowState( + bar_index + 2, + xTPWSwingLength + ); + + // + // Retrieve TPWMarket State ... + XTPWMarketState state0 = GetXTPWMarketState( + bar_index + ); + XTPWMarketState state1 = GetXTPWMarketState( + bar_index + 1 + ); + XTPWMarketState state2 = GetXTPWMarketState( + bar_index + 2 + ); + + // + // Retrieve Candles ... + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + + // + XPrice prices = GetPrice(); + XLHS lhs = GetXTPWLHS(bar_index); + + // + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + bool isHHSame = + lhs.scHH == lhs.mcHH + && lhs.mcHH == lhs.lcHH + ; + + // + bool isLLSame = + lhs.scLL == lhs.mcLL + && lhs.mcLL == lhs.lcLL + ; + + // + bool startCondition = false; + bool signalCondition = false; + bool entryCondition = false; + + // + bool shortCondition1 = + // + true + // + && tPow1.powerDown > tPowerMaxVerifier + && tPow2.powerDown < tPowerMaxVerifier + ; + + // + startCondition = ( + shortCondition1 + ) + ; + + // + if ( + startCondition + && xTPWShortConds.startTime == 0 + && xTPWShortConds.signalTime == 0 + && xTPWShortConds.entryTime == 0 + ) { + // + xTPWShortConds.startTime = barTime; + xTPWShortConds.signalTime = barTime; + xTPWShortConds.entryTime = barTime; + + // + return; + } +} + +// +// Convert Long Signal Conditions to XSignal ... +XSignalRequest GenerateXTPWSignal( + const ENUM_X_SIGNAL_TYPE type, // Signal Type ... + const string signalTag , // Signal Tag ... + const int bar_index +) { + // + XSignalRequest result = {}; + + // + result.hasSignal = false; + result.type = X_SIGNAL_NONE; + result.provider = X_UNKNOWN_PROVIDER; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + bool requestLong = type == X_SIGNAL_LONG; + + // + // Check Condition Validations ... + if (requestLong) { + // + // Check Long Condtion is Valid, if Long Requested ... + if ( + !ValidateXTPWLongConditions() + ) { + return result; + } + } else { + // + // Check Short Condtion is Valid, if Short Requested ... + if ( + !ValidateXTPWShortConditions() + ) { + return result; + } + } + + // + double ll = + // + GetMarketLowestLow( + bar_index, + xTPWSwingLength + ) + ; + + // + double hh = + // + GetMarketHighestHigh( + bar_index, + xTPWSwingLength + ) + ; + + // + double openPrice = iOpen( + _Symbol, + _Period, + bar_index + ); + + // + double closePrice = iClose( + _Symbol, + _Period, + bar_index + ); + + // + // Price Calculations ... + XPrice prices = GetPrice(); + + // + // Read State ... + XTPWMarketState state0 = GetXTPWMarketState(bar_index); + + // + XOHCL candle0 = GetCandleModel(bar_index); + XOHCL candle1 = GetCandleModel(bar_index + 1); + XOHCL candle2 = GetCandleModel(bar_index + 2); + XOHCL candle3 = GetCandleModel(bar_index + 2); + + // + double risk = requestLong ? + // + MathMin(openPrice, closePrice) - ll : + hh - MathMax(openPrice, closePrice) + ; + + // + double longR2R = xTPWLongR2R; + double shortR2R = xTPWShortR2R; + + // + double sharpDetectorValue = xTPWSharpDetectionFactor * _Point; + + // + if ( + risk > 0 + && requestLong + ) { + return result; + } + + // + // Define Entry Price ... + double entryPrice = requestLong + ? + prices.longEntry + : + prices.shortEntry + ; + + // + // Fix TP Detects for Short Signals ... + if (!requestLong) { + risk = 0; + } + + // + double reward = requestLong ? + risk * longR2R : + risk * shortR2R + ; + + // + if (risk == 0) { + // + // Calculate Reward ... + reward = requestLong + ? + MathAbs(hh - entryPrice) + : + MathAbs(hh - entryPrice) + ; + + // + // Detect Sharp Change Occured or not ... + bool isSharpOccured = reward > sharpDetectorValue + || MathAbs(reward - sharpDetectorValue) < (50 * _Point); + + // + // Change Rewards on Special Conditions ... + if ( + ( + requestLong + && isSharpOccured + && ( + state0.lcFast < state0.lcSlow + || ( + state0.mcFast > state0.mcSlow + && state0.mcWeight < state0.mcSlow + ) + ) + ) + ) { + reward = reward / 2; + } + + // + if (reward < 50 * _Point) { + reward = (50 * _Point) + prices.priceGap; + } + + // // + // if (!requestLong) { + // reward = reward * shortR2R; + // } + } + + // + double sl = requestLong ? + 0 : + 0; + double tp = requestLong ? + entryPrice + reward : + entryPrice - reward + ; + + // + datetime barTime = iTime( + _Symbol, + _Period, + bar_index + ); + + // + result.signal.tp = tp; + result.signal.sl = sl; + result.signal.type = type; + result.signal.time = barTime; + result.signal.tag = signalTag; + result.signal.symbol = _Symbol; + result.signal.entry = entryPrice; + result.signal.id = totalSignals + 1; + result.signal.provider = X_XTPW_PROVIDER; + + // + result.hasSignal = true; + result.type = type; + result.provider = X_XTPW_PROVIDER; + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWLongConditions() { + // + if ( + !enableXTPWLong + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWLongConds.startTime > 0 + && xTPWLongConds.signalTime > 0 + && xTPWLongConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWLongConds.entryTime + // ); + + // // + // int startSignalDiff = (signalBarIndex - startBarIndex); + // int entrySignalDiff = (entryBarIndex - signalBarIndex); + // int maxDiff = MathMax(startSignalDiff, entrySignalDiff); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWLongConds.signalTime >= xTPWLongConds.startTime + && xTPWLongConds.entryTime >= xTPWLongConds.signalTime + // + // && maxDiff < (xTPWSwingLength * 2) + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForLongSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWLongSignalConditions(); + } + + // + return result; +} + +// +// Validate Signal Conditions ... +bool ValidateXTPWShortConditions() { + // + if ( + !enableXTPWShort + || !enableXTPWSignalling + ) { + return false; + } + + // + bool isConditionsFilled = + xTPWShortConds.startTime > 0 + && xTPWShortConds.signalTime > 0 + && xTPWShortConds.entryTime > 0 + ; + + // + bool isBLFilled = false; + if (isConditionsFilled) { + // // + // int startBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.startTime + // ); + + // // + // int signalBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.signalTime + // ); + + // // + // int entryBarIndex = iBarShift( + // _Symbol, + // _Period, + // xTPWShortConds.entryTime + // ); + + // + isBLFilled = + // + // Starter ... + true + // + && xTPWShortConds.signalTime >= xTPWShortConds.startTime + && xTPWShortConds.entryTime >= xTPWShortConds.signalTime + ; + } + + // + bool result = + isBLFilled + && isConditionsFilled + && xTPWWaitForShortSignals + ; + + // + // Since maybe Conditions Filled but + // Slope is Negative, for Handling Next Signals and + // Prevent from infinity loop, here we Clear Signal Conditions ... + if ( + !result + && isConditionsFilled + ) { + ClearXTPWShortSignalConditions(); + } + + // + return result; +} + +// +// Clear Long Signal Conditions for New One ... +void ClearXTPWLongSignalConditions() { + // + xTPWLongConds.startTime = 0; + xTPWLongConds.entryTime = 0; + xTPWLongConds.signalTime = 0; +} + +// +// Clear Short Signal Conditions for New One ... +void ClearXTPWShortSignalConditions() { + // + xTPWShortConds.startTime = 0; + xTPWShortConds.entryTime = 0; + xTPWShortConds.signalTime = 0; +} + +// +// Check State for Long Signals ... +bool IsReadyForXTPWSignals( + const XSignal &signal +) { + // + bool result = false; + + // + if ( + !enableXTPWSignalling + || !(enableXTPWLong || enableXTPWShort) + ) { + return result; + } + + // + int signalBarIndex = iBarShift( + _Symbol, + _Period, + signal.time + ); + + // + // XOHCL candle = GetCandleModel(0); + XOHCL candle0 = GetCandleModel(signalBarIndex); + XOHCL candle1 = GetCandleModel(signalBarIndex + 1); + + // + // Retrieve TPow State ... + XTPOWState tPow0 = GetXTPowState( + signalBarIndex, + xTPWSwingLength + ); + XTPOWState tPow1 = GetXTPowState( + signalBarIndex + 1, + xTPWSwingLength + ); + + // + // Retrive XMarket States ... + XTPWMarketState state0 = GetXTPWMarketState(signalBarIndex); + XTPWMarketState state1 = GetXTPWMarketState(signalBarIndex + 1); + XTPWMarketState state2 = GetXTPWMarketState(signalBarIndex + 2); + + // + bool isPSarVerified = false; + bool isTPowVerified = false; + bool isStateVerified = false; + bool isPriceVerified = false; + + // + // Calculate Sharp Detection Value ... + double sharpDetectionValue = + xTPWSharpDetectionFactor * _Point; + + // + // Find State0 Min ... + double state0Min = MathMin(state0.scFast, state0.scSlow); + state0Min = MathMin(state0Min, state0.mcFast); + state0Min = MathMin(state0Min, state0.mcSlow); + state0Min = MathMin(state0Min, state0.lcFast); + state0Min = MathMin(state0Min, state0.lcSlow); + + // + // Find State0 Min ... + double state0Max = MathMax(state0.scFast, state0.scSlow); + state0Max = MathMax(state0Max, state0.mcFast); + state0Max = MathMax(state0Max, state0.mcSlow); + state0Max = MathMax(state0Max, state0.lcFast); + state0Max = MathMax(state0Max, state0.lcSlow); + + // + // Find Distance Between State0 Min and Max ... + double state0MinMaxDistance = MathAbs(state0Max - state0Min); + + // + // Verify Long Signals ... + if (signal.type == X_SIGNAL_LONG) { + // + // Get Price Verification for Long ... + isPriceVerified = + // + // Starter ... + true + // + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.powerDown > tPowerMaxVerifier + && tPow1.powerDown > tPowerMaxVerifier + && tPow0.powerDown < MathMax(tPow1.powerUp, tPow1.powerDown) + && MathMax(tPow1.powerUp, tPow1.powerDown) > tPowerMaxVerifier + ; + + // + isPSarVerified = + // + // Starter ... + true + // + ; + + // + isStateVerified = + // + // Start ... + true + // + && state0.mcFast > state0.mcSlow + && state1.mcFast > state1.mcSlow + // + && !( + state0.lcFast > state0.mcSlow + && state0.lcFast < state0.mcFast + ) + // + && MathAbs(state1.mcFast - state1.mcSlow) > (50 * _Point) + ; + + // + result = + // + // Starter ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } else + // + // Verify Short Signals ... + if (signal.type == X_SIGNAL_SHORT) { + // + isPSarVerified = + // + // Starter ... + true + ; + + // + // Get Price Verification for Short ... + isPriceVerified = + // + // Starter ... + true + ; + + // + isTPowVerified = + // + // Starter ... + true + // + && tPow0.signal > MathMax(tPow0.powerUp, tPow0.powerDown) + ; + + // + isStateVerified = + // + // Start ... + true + // + && ( + // + state0.scFast < state0.scSlow + && state0.mcFast < state0.mcSlow + && state0.lcFast < state0.lcSlow + ? + signal.entry > state0.scFast + : + // + // Find Minimum and Maximum Distance of State ... + state0MinMaxDistance > sharpDetectionValue + ? + signal.entry > state0Min + : + true + ) + // + && MathAbs(state0.mcFast - state0.mcSlow) > 50 * _Point + ; + + // + result = + // + // Starter Condition ... + true + // + && isPSarVerified + // + && isTPowVerified + // + && isStateVerified + // + && isPriceVerified + ; + } + + // + return result; +} +// +// END Functions ... +// + +// +// START Data Provider ... +// +// +// Retrieve Market State ... +XTPWMarketState GetXTPWMarketState( + const int bar_index +) { + // + XTPWMarketState result = {}; + + // + int dayCount = GetDailyCandleCount(); + int halfDayCount = (int)(dayCount / 2); + + // + if (scFastLength == 0) { + scFastLength = xTPWSwingLength; + } + + // + if (scSlowLength == 0) { + scSlowLength = xTPWSwingLength * 2; + } + + // + if (mcFastLength == 0) { + mcFastLength = halfDayCount; + } + + // + if (mcSlowLength == 0) { + mcSlowLength = dayCount; + } + + // + if (lcFastLength == 0) { + lcFastLength = halfDayCount * 3; + } + + // + if (lcSlowLength == 0) { + lcSlowLength = dayCount * 3; + } + + // + double scFast = GetMA( + bar_index, + scFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scSlow = GetMA( + bar_index, + scSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double scWeight = GetMA( + bar_index, + scSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double mcFast = GetMA( + bar_index, + mcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcSlow = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double mcWeight = GetMA( + bar_index, + mcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double lcFast = GetMA( + bar_index, + lcFastLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcSlow = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_SMA, + PRICE_CLOSE + ); + + // + double lcWeight = GetMA( + bar_index, + lcSlowLength, + 0, + MODE_EMA, + PRICE_MEDIAN + ); + + // + double psar = iSAR( + _Symbol, + _Period, + xTPWPSarStep, + xTPWPSarMaximum, + bar_index + ); + + // + result.psar = psar; + result.scFast = scFast; + result.scSlow = scSlow; + result.mcFast = mcFast; + result.mcSlow = mcSlow; + result.lcFast = lcFast; + result.lcSlow = lcSlow; + result.scWeight = scWeight; + result.mcWeight = mcWeight; + result.lcWeight = lcWeight; + + // + return result; +} + +// +// Retrieve Highest Highs and Lowest Lows in Cycles ... +XLHS GetXTPWLHS( + const int bar_index +) { + // + XLHS result = {}; + + // + // Retrieve LL and HH (s) ... + + // + // SC HH ... + double scHH = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // SC LL ... + double scLL = GetMarketHighestHigh( + bar_index, + scFastLength + ); + + // + // MC HH ... + double mcHH = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // MC LL ... + double mcLL = GetMarketHighestHigh( + bar_index, + mcFastLength + ); + + // + // LC HH ... + double lcHH = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + // LC LL ... + double lcLL = GetMarketHighestHigh( + bar_index, + lcFastLength + ); + + // + result.scHH = scHH; + result.scLL = scLL; + result.mcHH = mcHH; + result.mcLL = mcLL; + result.lcHH = lcHH; + result.lcLL = lcLL; + + // + return result; +} +// +// END Data Provider ... +// diff --git a/MQL4.code-workspace b/MQL4.code-workspace new file mode 100644 index 0000000..11a5ef6 --- /dev/null +++ b/MQL4.code-workspace @@ -0,0 +1,12 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + "C_Cpp.default.includePath": [ + "c:\\Users\\hadi_\\AppData\\Roaming\\MetaQuotes\\Terminal\\50CA3DFB510CC5A8F28B48D1BF2A5702\\MQL4\\Include\\Include" + ] + } +} \ No newline at end of file diff --git a/Node/x-arg.parser.js b/Node/x-arg.parser.js new file mode 100644 index 0000000..bbac10c --- /dev/null +++ b/Node/x-arg.parser.js @@ -0,0 +1,91 @@ +/** + * XArgs Parser Module ... + * a module for parsing args in node js cli apps ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Variable/Constants ... +const ARGUMENT_SEPARATION_REGEX = /([^=\s]+)[=\ ]?\s*(.*)/; +//#endregion + +// +//#region Actions ... +function parseArgs(argv) { + // + // Removing node/bin and called script name + argv = argv.slice(2); + + // + const result = {}; + let argName; + let argValue; + + // + if ( + argv === null + || argv === undefined + || argv.length === 0 + ) { + return result; + } + + // + const argString = argv.join(" "); + let matches = argString + .match(ARGUMENT_SEPARATION_REGEX); + matches.splice(0, 1); + matches = matches + .filter(m => m !== undefined && m !== ""); + + // + matches.forEach(arg => { + // + // Separate argument for a key/value return + arg = arg.match(ARGUMENT_SEPARATION_REGEX); + arg.splice(0, 1); + + // + // Retrieve the argument name + argName = arg[0]; + + // + // Remove "--" or "-" + if (argName.indexOf('-') === 0) { + // + argName = argName + .slice( + argName + .slice(0, 2) + .lastIndexOf('-') + 1 + ); + } + + // + // Parse argument value or set it to `true` if empty + argValue = + arg[1] !== '' + ? parseFloat(arg[1]) + .toString() === arg[1] + ? +arg[1] + : arg[1] + : true; + + // + result[argName] = argValue; + }); + + // + return result; +} +//#endregion + +// +//#region Exports ... +module.exports = { + parseArgs +}; +//#endregion \ No newline at end of file diff --git a/Node/x-color.tools.js b/Node/x-color.tools.js new file mode 100644 index 0000000..c3ac5f9 --- /dev/null +++ b/Node/x-color.tools.js @@ -0,0 +1,506 @@ +/** + * XColor Tools Module ... + * a module for handle colorify text contents in node js ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Module Imports ... +const XValueTools = require("./x-value.tools"); +//#endregion + +// +//#region Constants ... +/** + * these are available style which can applied to an string ... + */ +const AVAILABLE_STYLES = { + // + Bold: "\x1b[1m", + Dim: "\x1b[2m", + Underlined: "\x1b[4m", + Blink: "\x1b[5m", + ReverseFandB: "\x1b[7m", + Hidden: "\x1b[8m", + // + // Commonly used for reset all Styles ... + Reset: "\x1b[0m" +}; + +/** + * these are available foreground colors which can applied to an string ... + */ +const AVAILABLE_FOREGROUND_COLORS = { + Default: "\x1b[39m", + Black: "\x1b[30m", + Red: "\x1b[31m", + Green: "\x1b[32m", + Yellow: "\x1b[33m", + Blue: "\x1b[34m", + Magenta: "\x1b[35m", + Cyan: "\x1b[36m", + LightGray: "\x1b[37m", + DarkGray: "\x1b[90m", + LightRed: "\x1b[91m", + LightGreen: "\x1b[92m", + LightYellow: "\x1b[93m", + LightBlue: "\x1b[94m", + LightMagenta: "\x1b[95m", + LightCyan: "\x1b[96m", + White: "\x1b[97m", +}; + +/** + * these are available background colors which can applied to an string ... + */ +const AVAILABLE_BACKGROUND_COLORS = { + Default: "\x1b[49m", + Black: "\x1b[40m", + Red: "\x1b[41m", + Green: "\x1b[42m", + Yellow: "\x1b[43m", + Blue: "\x1b[44m", + Magenta: "\x1b[45m", + Cyan: "\x1b[46m", + LightGray: "\x1b[47m", + DarkGray: "\x1b[100m", + LightRed: "\x1b[101m", + LightGreen: "\x1b[102m", + LightYellow: "\x1b[103m", + LightBlue: "\x1b[104m", + LightMagenta: "\x1b[105m", + LightCyan: "\x1b[106m", + White: "\x1b[107m", +}; + +/** + * these are available style names, which exports from module and + * users can use them ... + */ +const STYLE_NAMES = { + Bold: "Bold", + Dim: "Dim", + Underlined: "Underlined", + Blink: "Blink", + ReverseFandB: "ReverseFandB", + Hidden: "Hidden", + Reset: "Reset", +}; + +/** + * these are available color names, which exports from module and + * users can use them ... + */ +const COLOR_NAMES = { + Default: "Default", + Black: "Black", + Red: "Red", + Green: "Green", + Yellow: "Yellow", + Blue: "Blue", + Magenta: "Magenta", + Cyan: "Cyan", + LightGray: "LightGray", + DarkGray: "DarkGray", + LightRed: "LightRed", + LightGreen: "LightGreen", + LightYellow: "LightYellow", + LightBlue: "LightBlue", + LightMagenta: "LightMagenta", + LightCyan: "LightCyan", + White: "White", +}; +//#endregion + +// +//#region Actions ... +/** + * apply specified style and color on a content ... + * + * @param {string} content specified content for styling ... + * @param {string} color specific color name for using to styling ... + * @param {string} style soecufic style name to use ... + * @param {boolean} toForeground apply specified color as foreground ... + * @param {boolean} toBackground apply specified color as background ... + * @returns {string} styled content ... + */ +function apply( + content, + color, + style, + toForeground = true, + toBackground = false +) { + // + let result = content; + + // + // Validate Arg ... + if (!XValueTools.isValidArg(content)) { + return result; + } + + // + // Detect and Validate Style and Apply it ... + let eStyle = AVAILABLE_STYLES[style]; + if (XValueTools.isValidArg(eStyle)) { + result = `${eStyle}${result}${AVAILABLE_STYLES.Reset}`; + } + + // + // Detect and Validate Foreground Color and Apply it ... + let eFColor = AVAILABLE_FOREGROUND_COLORS[color]; + if ( + !!toForeground + && XValueTools.isValidArg(eFColor) + ) { + result = `${eFColor}${result}${AVAILABLE_STYLES.Reset}`; + } + + // + // Detect and Validate Background Color and Apply it ... + let eBColor = AVAILABLE_BACKGROUND_COLORS[color]; + if ( + !!toBackground + && XValueTools.isValidArg(eBColor) + ) { + result = `${eBColor}${result}${AVAILABLE_STYLES.Reset}`; + } + +} + +/** + * apply specific style on a content ... + * + * @param {string} content specific content which going to styled ... + * @param {string} style a member of STYLE_NAMES which specified that which style going to applied to content ... + * @returns {string} styled content ... + */ +function applyStyle(content, style) { + // + // Validate Arg ... + if (!XValueTools.isValidArg(content)) { + return content; + } + + // + let eStyle = AVAILABLE_STYLES[style]; + if (eStyle === undefined) { + return content; + } + + // + return `${eStyle}${content}${AVAILABLE_STYLES.Reset}`; +} + +/** + * apply specific foreground color on a content ... + * + * @param {string} content specific content which going to colorified ... + * @param {string} color a member of COLOR_NAMES which specified that which color going to applied to content ... + * @returns {string} colorified content ... + */ +function applyForegroundColor(content, color) { + // + // Validate Arg ... + if (!XValueTools.isValidArg(content)) { + return content; + } + + // + let eColor = AVAILABLE_FOREGROUND_COLORS[color]; + if (eColor === undefined) { + return content; + } + + // + return `${eColor}${content}${AVAILABLE_STYLES.Reset}`; +} + +/** + * apply specific background color on a content ... + * + * @param {string} content specific content which going to colorified ... + * @param {string} color a member of COLOR_NAMES which specified that which color going to applied to content ... + * @returns {string} colorified content ... + */ +function applyBackgroundColor(content, color) { + // + // Validate Arg ... + if (!XValueTools.isValidArg(content)) { + return content; + } + + // + let eColor = AVAILABLE_BACKGROUND_COLORS[color]; + if (eColor === undefined) { + return content; + } + + // + return `${eColor}${content}${AVAILABLE_STYLES.Reset}`; +} + +/** + * generate style and color applier expression ... + * + * @param {string} color specific color name for using to styling ... + * @param {string} style soecufic style name to use ... + * @param {boolean} reset close applier string by reset styles ... + * @param {boolean} toForeground apply specified color as foreground ... + * @param {boolean} toBackground apply specified color as background ... + * @returns {string} style and color applier string ... + */ +function getApplier( + style = "", + color = "", + reset = false, + toForeground = true, + toBackground = false +) { + // + let result = ""; + + // + // Detect and Validate Style and Apply it ... + let eStyle = AVAILABLE_STYLES[style]; + if (XValueTools.isValidArg(eStyle)) { + result = `${eStyle}`; + } + + // + // Detect and Validate Foreground Color and Apply it ... + let eFColor = AVAILABLE_FOREGROUND_COLORS[color]; + if ( + !!toForeground + && XValueTools.isValidArg(eFColor) + ) { + result = `${eFColor}`; + } + + // + // Detect and Validate Background Color and Apply it ... + let eBColor = AVAILABLE_BACKGROUND_COLORS[color]; + if ( + !!toBackground + && XValueTools.isValidArg(eBColor) + ) { + result = `${eBColor}`; + } + + // + if ( + !!reset && + result.length > 0 + ) { + result = `${result}${AVAILABLE_STYLES.Reset}`; + } + + // + return result; +} + +/** + * generate style applier expression ... + * + * @param {string} style soecufic style name to use ... + * @param {boolean} reset close applier string by reset styles ... + * @returns {string} style applier string ... + */ +function getStyleApplier( + style = "", + reset = false +) { + // + let result = ""; + + // + // Detect and Validate Style and Apply it ... + let eStyle = AVAILABLE_STYLES[style]; + if (XValueTools.isValidArg(eStyle)) { + result = `${eStyle}`; + } + + // + if ( + !!reset && + result.length > 0 + ) { + result = `${result}${AVAILABLE_STYLES.Reset}`; + } + + // + return result; +} + +/** + * generate color applier expression ... + * + * @param {string} color specific color name for using to styling ... + * @param {boolean} reset close applier string by reset styles ... + * @param {boolean} toForeground apply specified color as foreground ... + * @param {boolean} toBackground apply specified color as background ... + * @returns {string} color applier string ... + */ +function getColorApplier( + color = "", + reset = false, + toForeground = true, + toBackground = false +) { + // + let result = ""; + + // + // Detect and Validate Foreground Color and Apply it ... + let eFColor = AVAILABLE_FOREGROUND_COLORS[color]; + if ( + !!toForeground + && XValueTools.isValidArg(eFColor) + ) { + result = `${eFColor}`; + } + + // + // Detect and Validate Background Color and Apply it ... + let eBColor = AVAILABLE_BACKGROUND_COLORS[color]; + if ( + !!toBackground + && XValueTools.isValidArg(eBColor) + ) { + result = `${eBColor}`; + } + + // + if ( + !!reset && + result.length > 0 + ) { + result = `${result}${AVAILABLE_STYLES.Reset}`; + } + + // + return result; +} + +/** + * colorified specific content ... + * + * @param {string} content specified content for styling ... + * @param {string} color specific color name for using to styling ... + * @param {boolean} toForeground apply specified color as foreground ... + * @param {boolean} toBackground apply specified color as background ... + * @returns {string} + */ +function colorifyContent( + content = "", + color = "", + toForeground = true, + toBackground = false +) { + // + let result = content; + + // + if (!XValueTools.isValidArg(content)) { + return result; + } + + // + // Finde Colors ... + + // + // Detect and Validate Foreground Color and Apply it ... + let eFColor = AVAILABLE_FOREGROUND_COLORS[color]; + if ( + !!toForeground + && XValueTools.isValidArg(eFColor) + ) { + result = `${eFColor}${result}`; + } + + // + // Detect and Validate Background Color and Apply it ... + let eBColor = AVAILABLE_BACKGROUND_COLORS[color]; + if ( + !!toBackground + && XValueTools.isValidArg(eBColor) + ) { + result = `${eBColor}${result}`; + } + + // + if ( + result.length > 0 + && ( + XValueTools.isValidArg(eFColor) || + XValueTools.isValidArg(eBColor) + ) + ) { + result = `${result}${AVAILABLE_STYLES.Reset}`; + } + + // + return result; +} + +/** + * apply style on specific content ... + * + * @param {string} content specified content for styling ... + * @param {string} style soecufic style name to use ... + * @returns {string} + */ +function stylifiyContent( + content = "", + style = "", +) { + // + let result = content; + + // + if (!XValueTools.isValidArg(content)) { + return result; + } + + // + // Detect and Validate Style and Apply it ... + let eStyle = AVAILABLE_STYLES[style]; + if (XValueTools.isValidArg(eStyle)) { + result = `${eStyle}${result}`; + } + + // + if ( + result.length > 0 + && XValueTools.isValidArg(eStyle) + ) { + result = `${result}${AVAILABLE_STYLES.Reset}`; + } + + // + return result; +} +//#endregion + +// +//#region Module Exports ... +module.exports = { + // + STYLE_NAMES, + COLOR_NAMES, + // + apply, + applyStyle, + getApplier, + getColorApplier, + getStyleApplier, + colorifyContent, + stylifiyContent, + applyForegroundColor, + applyBackgroundColor, +} +//#endregion \ No newline at end of file diff --git a/Node/x-file.tools.js b/Node/x-file.tools.js new file mode 100644 index 0000000..505849e --- /dev/null +++ b/Node/x-file.tools.js @@ -0,0 +1,909 @@ +/** + * XFile Tools Module ... + * a module for handle all file/folder manipulating task in node js ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Module Imports ... +const fs = require('fs'); +const os = require('os'); +const Path = require('path'); +const http = require('http'); +const https = require('https'); +const XValueTools = require('./x-value.tools'); +//#endregion + +// +//#region Constants ... +/** + * current os path separators ... + */ +const PathSeparator = Path.sep; + +/** + * current directory ... + */ +const CurrentDir = __dirname; + + +/** + * Commonly used Names ... + */ +const NAMES = { + Documents: "Documents", +}; +//#endregion + +// +//#region Actions ... +// +//#region Global ... +/** + * retrieve a path status ... + * + * @param {string} path a path value to check ... + * @returns an stat object ... + */ +function getStatus(path = '') { + // + if (!XValueTools.isValidArg(path)) { + return undefined; + } + + // + return fs.statSync(path); +} +//#endregion + +// +//#region Path Providers +/** + * retrieve user's Home path ... + * + * @returns {string} a path ... + */ +function getOSHomePath() { + return os.homedir(); +} + +/** + * retrieve os Documents path ... + * + * @returns {string} a path ... + */ +function getOSDocumentsPath() { + // + const homePath = getOSHomePath(); + const result = joinPath(homePath, NAMES.Documents); + + // + return result; +} +//#endregion + +// +//#region Path ... +/** + * retrieve the base name of specific address path ... + * + * @param {string} path address of file or folder ... + * @returns string ... + */ +function basename(path = '') { + // + if (!XValueTools.isValidArg(path)) { + return ''; + } + + // + const result = Path.basename(path); + return result; +} + +/** + * join several path segments together ... + * + * @param {...string} path path params ... + * @returns a joined paths ... + */ +function joinPath(...path) { + return Path.join(...path); +} + +/** + * resolve a relative path to absolute ... + * + * @param {string[]} path a path value to check ... + * @returns {string} + */ +function resolvePath(...path) { + return Path.resolve(...path); +} +//#endregion + +// +//#region File ... +/** + * determines a path destination is a file or not ... + * + * @param {string} path a path value to check ... + * @returns a boolean value ... + */ +function isFileExists(path = '') { + // + if (!XValueTools.isValidArg(path)) { + return false; + } + + // + try { + const stat = getStatus(path); + if (!stat) { + return false; + } + + // + return stat.isFile(); + } catch { + return false; + } +} + +/** + * remove a file ... + * + * @param {string} path a file path ... + * @returns {Promise} action done or not ... + */ +function removeFile(path = '') { + return new Promise((resolve) => { + // + if (!isFileExists(path)) { + resolve(false); + } + + // + fs.unlink(path, (err) => { + // + if (err) { + resolve(false); + return; + } + + // + resolve(true); + }); + }); +} + +/** + * copy a file to destination path ... + * + * @param {string} source source file path ... + * @param {string} dest dest folder path ... + * @returns {Promise} action done or not ... + */ +function copyFile( + source = '', + dest = '' +) { + return new Promise((resolve) => { + // + if ( + !isFileExists(source) || + !isDirectoryExists(dest) + ) { + resolve(false); + return; + } + + // + const destFilePath = Path.join(dest, Path.basename(source)); + fs.copyFile(source, destFilePath, (err) => { + // + if (err) { + resolve(false); + return; + } + + // + resolve(true); + }); + }); +} + +/** + * reading specified file content ... + * + * @param {string} path a file path ... + * @returns {Promise} file content ... + */ +function readFile(path = '') { + return new Promise((resolve) => { + // + if (!isFileExists(path)) { + resolve(''); + return; + } + + // + fs.readFile(path, 'utf8', (err, content) => { + // + if (err) { + resolve(undefined); + return; + } + + // + resolve(content); + }); + }); +} + +/** + * write content to a file ... + * + * @param {string} path a file path ... + * @param {string} content the content which going to write to the file ... + * @param {bool} overwrite determines file overwrite if exists ... + * @returns {Promise} action done or not ... + */ +function writeFile( + path = '', + content = '', + overwrite = true +) { + return new Promise((resolve) => { + // + if (isFileExists(path) && !overwrite) { + // + resolve(false); + return; + } + + // + // Normalize Content ... + content = XValueTools.isValidArg(content) ? + content : + ''; + + // + fs.writeFile(path, content, (err) => { + // + if (err) { + // + resolve(false); + return; + } + + // + resolve(true); + }); + }); +} + +/** + * create a file ... + * + * @param {string} path file path ... + * @param {string} fileName file name ... + * @returns {Promise} action done or not ... + */ +function createFile( + path = '', + fileName = '' +) { + return new Promise((resolve) => { + // + const filePath = Path.join(path, fileName); + if ( + isFileExists(filePath) || + !XValueTools.isValidArg(path) || + !XValueTools.isValidArg(fileName) + ) { + // + resolve(false); + return; + } + + // + fs.writeFile(filePath, '', (err) => { + // + if (err) { + // + resolve(false); + return; + } + + // + resolve(true); + }); + }); +} + +/** + * remove a file name extension ... + * + * @param {string} name + * @returns {string} name without extension ... + */ +function removeFileExtension(name = '') { + return name.substring(0, name.lastIndexOf('.')) || name; +} + +/** + * retrieve a file extension ... + * + * @param {string} path a path which locate a file ... + * @returns {string} + */ +function getFileExtension(path = '') { + // + let result = ""; + + // + // Validate Arg ... + if ( + !XValueTools.isValidArg(path) + || !isFileExists(path) + ) { + return result; + } + + // + // Retrieve just file name ... + const fileName = basename(path); + result = fileName.replace( + removeFileExtension(fileName), + "" + ); + + // + return result; +} + +/** + * retrieve all files list recursively from specific path ... + * + * @param {string} path a source folder path ... + * @param {string[]} extensions which file extensions need to be listed, live empty for all files ... + * @returns {Promise} + */ +async function getRecursiveFilesList( + path = "", + extensions = [] +) { + // + let result = []; + + // + // Validate Args ... + if ( + !XValueTools.isValidArg(path) + || !isDirectoryExists(path) + ) { + return result; + } + + // + const contents = await getDirectoryContents(path); + for (const item of contents) { + // + const itemPath = joinPath( + path, + item + ); + + // + const isItemFile = isFileExists(itemPath); + if (isItemFile) { + // + const itemFileExtension = getFileExtension(itemPath); + const isFileInSupportedExtensions = + extensions === undefined || extensions.length === 0 + ? true + : extensions.includes(itemFileExtension) + ; + if (isFileInSupportedExtensions) { + result.push(itemPath); + } + } else if (isDirectoryExists(itemPath)) { + // + const itemPathFiles = await getRecursiveFilesList(itemPath, extensions); + result.push(...itemPathFiles); + } + } + + // + return result; +} +//#endregion + +// +//#region Directory ... +/** + * create a directory ... + * + * @param {string} path destination path including dir name ... + * @param {boolean} recursive create directories recursively ... + * @returns action done or not ... + */ +function createDirectory( + path = '', + recursive = true +) { + // + let result = false; + + // + if ( + isDirectoryExists(path) || + !XValueTools.isValidArg(path) + ) { + return false; + } + + // + try { + // + fs.mkdirSync(path, { recursive: recursive }); + result = true; + return result; + } catch { + return false; + } +} + +/** + * remove a directory ... + * + * @param {string} path destination path including dir name ... + * @param {boolean} recursive removes directories recursively ... + * @returns {Promise} action done or not ... + */ +function removeDirectory( + path = '', + recursive = false +) { + return new Promise((resolve) => { + // + if (!isDirectoryExists(path)) { + resolve(false); + return; + } + + // + fs.rm(path, { + recursive + }, (err) => { + // + if (err) { + resolve(false); + return; + } + + // + resolve(true); + }); + }); +} + +/** + * determines a path destination is a directory or not ... + * + * @param {string} path a folder path ... + * @returns represent destnation path is Directory or not ... + */ +function isDirectoryExists(path = '') { + // + if (!XValueTools.isValidArg(path)) { + return false; + } + + // + try { + // + const isExists = fs.existsSync(path); + if (!isExists) { + return false; + } + + // + const stat = getStatus(path); + if (!stat) { + return false; + } + + // + const result = stat.isDirectory(); + return result; + } catch { + return false; + } +} + +/** + * retrieve a directory content ... + * + * @param {string} path a folder path ... + * @returns {Promise} a collection of folder files ... + */ +function getDirectoryContents(path = '') { + return new Promise((resolve) => { + // + if (!isDirectoryExists(path)) { + resolve([]); + return; + } + + // + fs.readdir(path, (err, content) => { + // + if (err) { + resolve([]); + return; + } + + // + resolve(content); + }); + }); +} + +/** + * retrieve a directory files ... + * + * @param {string} path a folder path ... + * @returns {Promise} a collection of folder files ... + */ +function getDirectoryFiles( + path = '', + containsHiddenFiles = false +) { + return new Promise((resolve) => { + // + if (!isDirectoryExists(path)) { + resolve([]); + return; + } + + // + fs.readdir(path, (err, content) => { + // + if (err) { + resolve([]); + return; + } + + // + if (!containsHiddenFiles) { + content = content.filter(c => !c.startsWith('.')); + } + + // + const result = []; + content + .forEach(c => { + // + const cPath = Path.join(path, c); + if (isFileExists(cPath)) { + result.push(c); + } + }); + + // + resolve(result); + }); + }); +} + +/** + * retrieve a directory folders ... + * + * @param {string} path a folder path ... + * @returns {Promise} a collection of folder names ... + */ +function getDirectoryFolders(path = '') { + return new Promise((resolve) => { + // + if (!isDirectoryExists(path)) { + resolve([]); + return; + } + + // + fs.readdir(path, (err, content) => { + // + if (err) { + resolve([]); + return; + } + + // + const result = []; + content.forEach(c => { + // + const cPath = Path.join(path, c); + if (isDirectoryExists(cPath)) { + result.push(c); + } + }); + + // + resolve(result); + }); + }); +} + +/** + * copy a folder with all of it's content to dest ... + * + * @param {string} source source folder path ... + * @param {string} dest dest folder path ... + * @returns {Promise} action done or not ... + */ +async function copyFolder( + source = '', + dest = '' +) { + // + if ( + !isDirectoryExists(source) || + !XValueTools.isValidArg(dest) || + !XValueTools.isValidArg(source) + ) { + return false; + } + + // + const folderName = Path.basename(source); + const destPath = Path.join(dest, folderName); + + // + // Create Dest Path folder if not exists ... + if (!isDirectoryExists(destPath)) { + // + let result = createDirectory(destPath, true); + if (!result) { + return false; + } + } + + // + // Files ... + const files = await getDirectoryFiles(source); + if (files && files.constructor === Array && files.length > 0) { + // + const filesPromises = files.map(file => copyFile(Path.join(source, file), destPath)); + const filesResult = (await Promise.all(filesPromises)).every(r => !!r); + if (!filesResult) { + return false; + } + } + + // + // Folders ... + const folders = await getDirectoryFolders(source); + if (folders && folders.constructor === Array && folders.length > 0) { + // + const folderPromises = folders.map(folder => copyFolder(Path.join(source, folder), destPath)); + const filesResult = (await Promise.all(folderPromises)).every(r => !!r); + if (!filesResult) { + return false; + } + } + + // + return true; +} + +/** + * copy a folder's content recursively to dest path ... + * + * @param {string} source source folder path ... + * @param {string} dest dest folder path ... + * @returns {Promise} action done or not ... + */ +async function copyFolderContent( + source = '', + dest = '' +) { + // + if ( + !isDirectoryExists(source) || + !isDirectoryExists(dest) || + !XValueTools.isValidArg(dest) || + !XValueTools.isValidArg(source) + ) { + return false; + } + + // + // + // Files ... + const files = await getDirectoryFiles(source); + if (files && files.constructor === Array && files.length > 0) { + // + const filesPromises = files.map(file => copyFile(joinPath(source, file), dest)); + const filesResult = (await Promise.all(filesPromises)).every(r => !!r); + if (!filesResult) { + return false; + } + } + + // + // Folders ... + const folders = await getDirectoryFolders(source); + if (folders && folders.constructor === Array && folders.length > 0) { + // + const folderPromises = folders.map(folder => copyFolder(joinPath(source, folder), dest)); + const filesResult = (await Promise.all(folderPromises)).every(r => !!r); + if (!filesResult) { + return false; + } + } + + // + return true; +} +//#endregion + +// +//#region Downloader ... +/** + * download a file from specific url and store it ... + * + * @param {string} filepath the file name and path which required to put download file on it ... + * @param {string} url the web url for downloading ... + */ +function download(filepath, url) { + // + // Validate Args ... + if ( + !XValueTools.isValidArg(url) + || !XValueTools.isValidURL(url) + || !XValueTools.isValidArg(filepath) + ) { + return; + } + + // + var file = fs.createWriteStream(filepath); + + // + if (url.startsWith('https:')) { + https.get(url, function (response) { + response.pipe(file); + }); + } else if (url.startsWith('http:')) { + http.get(url, function (response) { + response.pipe(file); + }); + } +} +//#endregion + +// +//#region JSON ... +/** + * read and parse a JSON content from a file ... + * + * @param {string} path source file path ... + * @returns {any} + */ +function readJSON(path = "") { + // + // Validate Args ... + if (!isFileExists(path)) { + return undefined; + } + + // + let result = undefined; + try { + result = require(path); + } catch { + result = undefined; + } + + // + return result; +} + +/** + * write a JSON Object content into a file ... + * + * @param {string} path dest file path ... + * @param {any} content an object which required to write to file ... + * @returns {Promise} + */ +async function writeJSON( + path = "", + content = undefined +) { + // + let result = false; + + // + // Validate Args ... + if (!XValueTools.isValidArg(path)) { + return result; + } + + // + // Normallize Content ... + if (content === undefined) { + content = {}; + } + + // + const contentString = XValueTools.beautifyJSON(content); + + // + result = await writeFile( + path, + contentString, + true + ); + + // + return result; +} +//#endregion +//#endregion + +// +//#region Module Exports ... +module.exports = { + // + CurrentDir, + PathSeparator, + + // + getStatus, + + // + getOSHomePath, + getOSDocumentsPath, + + // + basename, + joinPath, + resolvePath, + + // + download, + + // + readJSON, + writeJSON, + + // + copyFile, + readFile, + writeFile, + createFile, + removeFile, + isFileExists, + getFileExtension, + removeFileExtension, + getRecursiveFilesList, + + // + copyFolder, + createDirectory, + removeDirectory, + createDirectory, + removeDirectory, + isDirectoryExists, + isDirectoryExists, + copyFolderContent, + getDirectoryFiles, + getDirectoryFolders, + getDirectoryContents, +}; +//#endregion \ No newline at end of file diff --git a/Node/x-logger.tools.js b/Node/x-logger.tools.js new file mode 100644 index 0000000..ed6ccf8 --- /dev/null +++ b/Node/x-logger.tools.js @@ -0,0 +1,362 @@ + +/** + * XLogger Tools Module ... + * a module which used to handle all Loggings related actions in node js ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Imports ... +const XColorTools = require("./x-color.tools"); +const XValueTools = require("./x-value.tools"); +//#endregion + +// +//#region Variables/Constants ... +let baseLogTag = 'xFrameworkCLI'; +let enableLogging = true; + +/** + * Log Tags ... + */ +const XLogTag = { + Debug: 'debug', + Info: 'info', + Warn: 'warn', + Error: 'error' +}; +//#endregion + +// +//#region Actions ... +/** + * retrieve an instance of XLogMessage ... + * + * @param {string} tag tag of logging ... + * @param {string} message content of log message ... + * @param {array of any} args args of content which required to logging ... + * @param {number} timestamp logging time ... + * + * @returns an instance of log message object ... + */ +function XLogMessage( + tag, + message, + args, + timestamp +) { + // + if (!tag) { + throw 'Tag not provided ...'; + } + + // + if (!message) { + throw 'Message not provided ...'; + } + + // + if (!args) { + args = []; + } + + // + if (!timestamp) { + timestamp = new Date().getTime(); + } + + // + return { + tag, + message, + args, + timestamp, + }; +} + +/** + * log data ... + * + * @param {XLogMessage} message + */ +function log(message) { + // + if (!message || !message.tag || !message.message || !enableLogging) { + return; + } + + // + message.timestamp = new Date().getTime(); + + // + switch (message.tag) { + // + case XLogTag.Debug: + logDebug(message); + break; + // + case XLogTag.Info: + logInfo(message); + break; + // + case XLogTag.Warn: + logWarn(message); + break; + // + case XLogTag.Error: + logError(message); + break; + + // + default: + break; + } +} + +/** + * Log Debug ... + * + * @param {XLogMessage} message + */ +function logDebug(message) { + // + if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Debug) { + return; + } + + // + message.timestamp = new Date().getTime(); + + // + const cBaseLogTag = XColorTools.colorifyContent( + baseLogTag, + XColorTools.COLOR_NAMES.LightGray + ); + + // + const cTag = XColorTools.colorifyContent( + message.tag, + XColorTools.COLOR_NAMES.Default + ); + + // + const cMessage = XColorTools.colorifyContent( + message.message, + XColorTools.COLOR_NAMES.LightGray + ); + + // + console.debug(`${cBaseLogTag}:${cTag} => ${cMessage}`, ...message.args); +} + +/** + * Log Info ... + * + * @param {XLogMessage} message + */ +function logInfo(message) { + // + if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Info) { + return; + } + + // + message.timestamp = new Date().getTime(); + + // + const cBaseLogTag = XColorTools.colorifyContent( + baseLogTag, + XColorTools.COLOR_NAMES.LightGray + ); + + // + const cTag = XColorTools.colorifyContent( + message.tag, + XColorTools.COLOR_NAMES.Default + ); + + // + const cMessage = XColorTools.colorifyContent( + message.message, + XColorTools.COLOR_NAMES.Blue + ); + + // + console.info(`${cBaseLogTag}:${cTag} => ${cMessage}`, ...message.args); +} + +/** + * Log Warn ... + * + * @param {XLogMessage} message + */ +function logWarn(message) { + // + if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Warn) { + return; + } + + // + message.timestamp = new Date().getTime(); + + // + const cBaseLogTag = XColorTools.colorifyContent( + baseLogTag, + XColorTools.COLOR_NAMES.LightGray + ); + + // + const cTag = XColorTools.colorifyContent( + message.tag, + XColorTools.COLOR_NAMES.Default + ); + + // + const cMessage = XColorTools.colorifyContent( + message.message, + XColorTools.COLOR_NAMES.Yellow + ); + + // + console.warn(`${cBaseLogTag}:${cTag} => ${cMessage}`, ...message.args); +} + +/** + * Log Error ... + * + * @param {XLogMessage} message + */ +function logError(message) { + // + if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Error) { + return; + } + + // + message.timestamp = new Date().getTime(); + + // + const cBaseLogTag = XColorTools.colorifyContent( + baseLogTag, + XColorTools.COLOR_NAMES.LightGray + ); + + // + const cTag = XColorTools.colorifyContent( + message.tag, + XColorTools.COLOR_NAMES.Default + ); + + // + const cMessage = XColorTools.colorifyContent( + message.message, + XColorTools.COLOR_NAMES.Red + ); + + // + console.error(`${cBaseLogTag}:${cTag} => ${cMessage}`, ...message.args); +} + +/** + * issue simple debug log ... + * + * @param {string} message log message ... + */ +function simpleDebugLog(message = "") { + // + const msgObject = XLogMessage( + XLogTag.Debug, + message + ); + + // + logDebug(msgObject); +} + +/** + * issue simple info log ... + * + * @param {string} message log message ... + */ +function simpleInfoLog(message = "") { + // + const msgObject = XLogMessage( + XLogTag.Info, + message + ); + + // + logInfo(msgObject); +} + +/** + * issue simple warn log ... + * + * @param {string} message log message ... + */ +function simpleWarnLog(message = "") { + // + const msgObject = XLogMessage( + XLogTag.Warn, + message + ); + + // + logWarn(msgObject); +} + +/** + * issue simple error log ... + * + * @param {string} message log message ... + */ +function simpleErrorLog(message = "") { + // + const msgObject = XLogMessage( + XLogTag.Error, + message + ); + + // + logError(msgObject); +} +//#endregion + +// +//#region Module Eports ... +module.exports = { + // + enableLogging: () => { + enableLogging = true; + }, + disableLogging: () => { + enableLogging = false; + }, + isLoggingEnable: () => { + return enableLogging; + }, + changeBaseLogTag: (value => { + // + if (XValueTools.isValidArg(value)) { + baseLogTag = value; + } + }), + // + XLogTag: XLogTag, + // + XLogMessage: XLogMessage, + log: log, + logDebug: logDebug, + logInfo: logInfo, + logWarn: logWarn, + logError: logError, + // + simpleDebugLog, + simpleInfoLog, + simpleWarnLog, + simpleErrorLog, +} +//#endregion \ No newline at end of file diff --git a/Node/x-type-detector.tools.js b/Node/x-type-detector.tools.js new file mode 100644 index 0000000..86ed3d8 --- /dev/null +++ b/Node/x-type-detector.tools.js @@ -0,0 +1,268 @@ +/** + * DataType Tools Module ... + * a module for manipulate and detect supported data types in node js ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Constants ... +/** + * all supported data types ... + */ +const DataTypes = { + Null: 'null', + Date: 'date', + Array: 'array', + Object: 'object', + String: 'string', + Number: 'number', + Unknown: 'unknown', + Boolean: 'boolean', + Function: 'function', + Undefined: 'undefined', +}; +//#endregion + +// +//#region Actions ... +/** + * detect type of a content ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function getType(value) { + // + const type = typeof value; + + // + let result = DataTypes.Unknown; + let dateIdentifier = '[object Date]'; + let constructor = value && value.constructor ? + value.constructor.toString() : + ''; + + // + switch (type) { + // + case 'undefined': + result = DataTypes.Undefined; + break; + + // + case 'boolean': + result = DataTypes.Boolean; + break; + + // + case 'string': + result = DataTypes.String; + break; + + // + case 'number': + result = DataTypes.Number; + break; + + // + case 'function': + result = DataTypes.Function; + break; + + // + case 'object': + // + // Null ... + if (value === null) { + result = DataTypes.Null; + } else + // + // Array ... + if (Array.isArray(value)) { + result = DataTypes.Array; + } else + // + // Data ... + if ( + value instanceof Date || + isFunction(value.getMonth) || + constructor.includes(dateIdentifier) || + Object.prototype.toString.call(value) === dateIdentifier + ) { + result = DataTypes.Date; + } else + // + // Object ... + { + result = DataTypes.Object; + } + break; + + // + default: + result = DataTypes.Unknown; + break; + } + + // + return result; +} + +/** + * retrieve an object constructor ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function getConstructor(value) { + // + const result = value && value.constructor ? + value.constructor.toString() : + ''; + + // + return result; +} + +/** + * retrieve an object prototype ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function getPrototype(value) { + // + const result = value ? + Object.prototype.toString.call(value) : + ''; + + // + return result; +} + +/** + * check an object is null or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isNull(value) { + return getType(value) === DataTypes.Null; +} + +/** + * check an object is undefined or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isUndefined(value) { + return getType(value) === DataTypes.Undefined; +} + +/** + * check an object is null or undefined or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isNullOrUndefined(value) { + return isNull(value) || isUndefined(value); +} + +/** + * check an object is a date or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isDate(value) { + return getType(value) === DataTypes.Date; +} + +/** + * check an object is number or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isNumber(value) { + return getType(value) === DataTypes.Number; +} + +/** + * check an object is string or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isString(value) { + return getType(value) === DataTypes.String; +} + +/** + * check an object is boolean or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isBoolean(value) { + return getType(value) === DataTypes.Boolean; +} + +/** + * check an object is an Array or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isArray(value) { + return getType(value) === DataTypes.Array; +} + +/** + * check an object is and Object or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isObject(value) { + return getType(value) === DataTypes.Object; +} + +/** + * check an object is a Function or not ... + * + * @param {any} value the content which going to check ... + * @returns + */ +function isFunction(value) { + return getType(value) === DataTypes.Function; +} +//#endregion + +// +//#region Module Exports ... +module.exports = { + // + DataTypes, + + // + getType, + getConstructor, + getPrototype, + isNull, + isUndefined, + isNullOrUndefined, + isDate, + isNumber, + isString, + isBoolean, + isArray, + isObject, + isFunction, +} +//#endregion \ No newline at end of file diff --git a/Node/x-value.tools.js b/Node/x-value.tools.js new file mode 100644 index 0000000..81cfcc4 --- /dev/null +++ b/Node/x-value.tools.js @@ -0,0 +1,1528 @@ +/** + * Value Tools Module ... + * a module for Validate args and values ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Imports ... +const XTypeTools = require('./x-type-detector.tools'); +//#endregion + +// +//#region Actions ... +/** +* validate a value as an argument ... +* +* @param {string} value the value which going to validate ... +* @returns +*/ +function isValidArg(value) { + // + let result = false; + + // + result = value && + value.length > 0; + + // + return result; +} + +/** + * validate a collection of valuea as an arguments ... + * + * @param {string|string[]} values the value collection which going to checked ... + * @returns + */ +function isValidArgs(values) { + // + // Normalize Values ... + const normalValues = toNormalArray(values); + if (!hasChildArray(normalValues)) { + return false; + } + + // + let result = normalValues.every(nv => isValidArg(nv)); + return result; +} + +/** + * converts content to an array object ... + * + * @param {string|string[]} content the content which required to normalized ... + * @returns {string[]} array object ... + */ +function toNormalArray(content = '') { + // + // Validate Args ... + if (!isValidArg(content)) { + return []; + } + + // + const result = Array.isArray(content) ? + [...content] : + content.includes(',') && + content !== ',' ? + [...content.split(',')] : + [content]; + + // + return result; +} + +/** + * determines value is array and has atleast one child ... + * + * @param {any} value the value which going to checked ... + * @returns {boolean} result of checking ... + */ +function hasChildArray(value) { + // + let result = false; + result = value && + Array.isArray(value) && + value.length > 0; + + // + return result; +} + +/** + * check an string is ends with specified symbol ... + * + * @param {string} symbol specified search symbol ... + * @param {string} value specified search content ... + * @param {boolean} ignoreCase specified search case sensitive or not ... + * @returns + */ +function endsWidth( + symbol = '', + value = '', + ignoreCase = true +) { + // + if (!isValidArg(value)) { + return false; + } + + // + if (!isValidArg(symbol)) { + return true; + } + + // + // TODO: uncomment it if necessary ... + // symbol = symbol.trim(); + + // + let result = false; + const subtractedContent = value.substring(value.length - symbol.length); + result = !!ignoreCase ? + subtractedContent + .toLowerCase() === symbol + .toLowerCase() : + subtractedContent === symbol; + + // + return result; +} + +/** + * surround specified content by provided symbol ... + * + * @param {string} symbol surround string ... + * @param {string} content used content to surrounded by symbol ... + * @returns surrounded content ... + */ +function surroundBy( + symbol = '', + content = '' +) { + // + // Validate Args ... + if (!isValidArg(content)) { + content = ''; + } + + // + if (!isValidArg(symbol)) { + symbol = ''; + } + + // + if (isSurrounded(symbol, content)) { + return content; + } + + // + const result = `${symbol}${content}${symbol}`; + return result; +} + +/** + * convert a parsed sign to clear string ... + * + * @param {string} value a parsed content ... + * @returns clear parsed signs ... + */ +function toStringExpression(value) { + // + let result = ''; + result = value; + + // + if ( + !value || + !isValidArg(value) || + !isSurroundedString(value) + ) { + return result; + } + + // + const startSymbol = value.charAt(0); + const endSymbol = value.charAt(value.length - 1); + + // + if (startSymbol !== endSymbol) { + return result; + } + + // + if ( + startSymbol === "\"" || + startSymbol === "\'" + ) { + result = clearSurround(startSymbol, value); + } + + // + return result; +} + + + +/** + * find and cleare proposed candidates from specified content ... + * + * @param {string|string[]} candidates the proposed string(s) whic going to cleared from content ... + * @param {string} content the destination content which used to find and replace candidates on it ... + * @returns cleared content ... + */ +function clearContent( + candidates, + content +) { + // + // Validate Args ... + if ( + !candidates || + !isValidArg(content) + ) { + return ''; + } + + // + // Normalize candidates ... + const normalCandidates = toNormalArray(candidates) + .filter(c => isValidArg(c)); + if (!hasChildArray(normalCandidates)) { + return content; + } + + // + // define regexp for content ... + const regExpExpression = normalCandidates.join('|'); + const regExp = new RegExp( + regExpExpression, + 'gi' + ); + + // + let result = ''; + result = content.replace(regExp, ''); + + // + return result; +} + +/** + * clear surrounded symbol from content ... + * + * @param {string} symbol specified search symbol ... + * @param {string} content specified content to clear ... + * @returns + */ +function clearSurround( + symbol = '', + content = '' +) { + // + // Validate Args ... + if ( + !isValidArg(content) || + (isValidArg(symbol) && + symbol.length >= content.length - 1) + ) { + return ''; + } + + // + // Validate Surround ... + if (!isSurrounded(symbol, content)) { + return content; + } + + // + if (!isValidArg(symbol)) { + return content; + } + + // + let result = content.substring(symbol.length, content.length - symbol.length); + return result; +} + +/** + * clear object sign ... + * + * @param {string} content + * @returns cleared content ... + */ +function clearObjectSurround(content = '') { + // + // Validate Args ... + if ( + !isValidArg(content) || + !isSurroundedObject(content) + ) { + return content; + } + + // + const endIndex = content.length - ( + endsWidth('}', content) ? + 1 : + endsWidth('},', content) || + endsWidth('};', content) || + endsWidth('}\n', content) ? + 2 : + 0 + ); + + // + const result = content.substring(1, endIndex); + return result; +} + +/** + * clear array sign ... + * + * @param {string} content + * @returns cleared content ... + */ +function clearArraySurround(content = '') { + // + // Validate Args ... + if ( + !isValidArg(content) || + !isSurroundedArray(content) + ) { + return content; + } + + // + const endIndex = content.length - ( + endsWidth(']', content) ? + 1 : + endsWidth('],', content) || + endsWidth('];', content) || + endsWidth(']\n', content) ? + 2 : + 0 + ); + + // + const result = content.substring(1, endIndex); + return result; +} + +/** + * slice a content to individual parts ... + * + * @param {number|number[]} indexes which indexes used to slice ... + * @param {strng} content the content which going to sliced ... + * @returns sliced parts of content ... + */ +function sliceContent(indexes, content) { + // + // Validate Args ... + if ( + !isValidArg(indexes) || + !isValidArg(content) + ) { + return []; + } + + // + // Normalize indexes ... + const normalIndexes = toNormalArray(indexes) + .filter(index => index > -1 && index < content.length); + if (!hasChildArray(normalIndexes)) { + return []; + } + + // + let result = ['']; + result.pop(); + + // + let lastIndex = 0; + for (const index of normalIndexes) { + // + const part = content.substring(lastIndex, index); + if (isValidArg(part)) { + result.push(part.trim()); + } + + // + lastIndex = index + 1; + } + + // + // check remained parts ... + if (lastIndex < content.length) { + // + const part = content.substring(lastIndex); + if (isValidArg(part)) { + result.push(part.trim()); + } + } + + // + return result; +} + + + +/** + * check an string is starts and ends with specified symbol ... + * + * @param {string} symbol specified search symbol ... + * @param {string} content specified search content ... + * @param {boolean} ignoreCase specified search case sensitive or not ... + * @returns + */ +function isSurrounded( + symbol = '', + content = '', + ignoreCase = true +) { + // + // Validate Args ... + if (!isValidArg(content)) { + return false; + } + + // + if (!isValidArg(symbol)) { + return true; + } + + // + symbol = symbol.trim(); + + // + let result = false; + result = (!!ignoreCase ? + content + .toLowerCase() + .startsWith(symbol.toLowerCase()) : + content.startsWith(symbol) + ) && + endsWidth(symbol, content, ignoreCase); + + // + return result; +} + +/** + * determines a content is an string surrounded value or not ... + * + * @param {string} content a content which going to check ... + * @returns + */ +function isSurroundedString(content = '') { + // + // Validate Args ... + if (!isValidArg(content)) { + return false; + } + + // + let result = false; + result = ( + content.startsWith('\'') && + ( + endsWidth('\'', content) || + endsWidth('\',', content) || + endsWidth('\';', content) || + endsWidth('\'\n', content) + ) || + content.startsWith('\"') && + ( + endsWidth('\"', content) || + endsWidth('\",', content) || + endsWidth('\";', content) || + endsWidth('\"\n', content) + ) || + content.startsWith('`') && + ( + endsWidth('\`', content) || + endsWidth('\`,', content) || + endsWidth('\`;', content) || + endsWidth('\`\n', content) + ) + ); + return result; +} + +/** + * check a content is an array content or not ... + * + * @param {string} content + * @returns + */ +function isSurroundedArray(content = '') { + // + // Validate Args ... + if (!isValidArg(content)) { + return false; + } + + // + let result = false; + result = content.startsWith('[') && + ( + endsWidth(']', content) || + endsWidth('],', content) || + endsWidth('];', content) || + endsWidth(']\n', content) + ); + return result; +} + +/** + * check a content is an object content or not ... + * + * @param {string} content + * @returns + */ +function isSurroundedObject(content = '') { + // + // Validate Args ... + if (!isValidArg(content)) { + return false; + } + + // + let result = false; + result = content.startsWith('{') && + ( + endsWidth('}', content) || + endsWidth('},', content) || + endsWidth('};', content) || + endsWidth('}\n', content) + ); + return result; +} + +/** + * check an index model is contains inside anothers or not ... + * + * @param {{ start: number, end: number}} source the source index model to check ... + * @param {...{ start: number, end: number}} dest the collection of index models which going to check ... + * @returns + */ +function isIndexInside(source, ...dest) { + // + let result = false; + + // + // Validate Args ... + if (!source || !dest) { + return result; + } + + // + // Check idx is standard ... + if ( + !source || + !source.end || + !source.start || + source.start > source.end + ) { + return false; + } + + // + // Check types of destinations ... + for (let index of dest) { + // + // Check idx is standard ... + if ( + !index || + !index.end || + !index.start || + index.start > index.end + ) { + return false; + } + } + + // + if (dest.includes(source)) { + dest = dest.filter(d => d !== source); + } + + // + const insideContentIndex = dest.find(dIndex => { + // + const result = source.start >= dIndex.start && + source.start <= dIndex.end && + source.end >= dIndex.start && + source.end <= dIndex.end; + return result; + }); + + // + result = insideContentIndex; + return result; +} + +/** + * check a number exists in + * @param {number} idx the number which going to check ... + * @param {{ start: number, end: number}} index the index model + * @returns + */ +function isInsideIndex(idx = -1, index) { + // + let result = false; + + // + // Validate Args ... + if ( + !index || + !index.hasOwnProperty('end') || + !index.hasOwnProperty('start') + ) { + return result; + } + + // + result = idx > index.start && idx < index.end; + return result; +} + +/** + * determines an object is key/value and type ... + * + * @param {any} content the object which we are going to check ... + * @returns + */ +function isKeyValueType(content) { + // + const result = content && + content.hasOwnProperty('key') && + content.hasOwnProperty('type') && + content.hasOwnProperty('value'); + + // + return result; +} + + + +/** + * find all indexes of token(s) in content ... + * + * @param {string|string[]} tokens the tokens which require to search ... + * @param {string} content the content which using to search ... + * @returns {number[]} all occured indexes ... + */ +function findAllIndexes( + tokens, + content +) { + // + // Validate Args ... + if ( + !isValidArg(tokens) || + !isValidArg(content) + ) { + return []; + } + + // + // normalize tokens ... + const normalTokens = toNormalArray(tokens); + if (!hasChildArray(normalTokens)) { + return []; + } + + // + // Parse contents ... + let match; + const result = []; + const regExp = new RegExp( + normalTokens.join('|'), + 'g' + ); + while ((match = regExp.exec(content)) !== null) { + result.push(match.index); + } + if (!hasChildArray(result)) { + return []; + } + + // + return result; +} + +/** + * find nearest symbol in a content from specified index ... + * + * @param {string|string[]} candidates specifies which symbols to find ... + * @param {string} content te content for seasrch ... + * @param {number} startFromIndex the index of start position ... + * @returns + */ +function findNearest( + candidates, + content = '', + startFromIndex = 0 +) { + // + // Validate Args ... + if ( + !isValidArg(content) || + !isValidArg(candidates) || + !isValidArg(content.trim()) + ) { + return ''; + } + + // + // Normalize Content ... + content = content.trim(); + + // + // Normalize Starts From ... + startFromIndex = startFromIndex < 0 || startFromIndex > content.length - 1 ? 0 : startFromIndex; + + // + // Normalize Symbols ... + const normalCandidates = toNormalArray(candidates); + if (!hasChildArray(normalCandidates)) { + return ''; + } + + // + let nearestIndex = findNearestIndex( + normalCandidates, + content, + startFromIndex + ); + if (nearestIndex < 0) { + return ''; + } + + // + let result = content.substring( + nearestIndex, + nearestIndex + Math.max(...normalCandidates.map(nc => nc.length)) + ).trim(); + return result; +} + +/** + * search candidates in content and find nearest one and return it ... + * + * @param {string|string[]} candidates which candidates required to check ... + * @param {string} content the content which required to search candidates ... + * @param {number} startFromIndex the proposed index to start searching content from on ... + * @returns + */ +function findNearestIndex( + candidates = [''], + content = '', + startFromIndex = 0, + ignoreClosedItems = false +) { + // + // Validate Args ... + if ( + !isValidArg(content) || + !isValidArg(candidates) + ) { + return -1; + } + + // + // Mormalize startFromIndex value ... + startFromIndex = startFromIndex < 0 ? + 0 : + startFromIndex > content.length - 1 ? + content.length - 1 : + startFromIndex; + + // + // Normalize candidates ... + let normalCandidates = toNormalArray(candidates); + + // + if (!!ignoreClosedItems) { + normalCandidates = normalCandidates + .map(c => content.indexOf( + c, + startFromIndex + ) + ).map(c => +c) + .filter(c => +c > -1); + } else { + normalCandidates = findAllIndexesOutOfCloseds(normalCandidates, content) + .filter(c => c >= startFromIndex); + } + if (!hasChildArray(normalCandidates)) { + return -1; + } + + // + let result = -1; + result = Math.min(...normalCandidates); + + // + return result; +} + +/** + * find close index of specific sign in destination content ... + * + * @param {string} openSymbol open of area sign ... + * @param {string} closeSymbol close of area sign ... + * @param {string} content the destination content for parsing ... + * @param {number} startsFrom an start index of content for start parsing ... + * @returns + */ +function findCloseIndex( + openSymbol = '', + closeSymbol = '', + content = '', + startsFrom = -1 +) { + // + // Validate Args ... + if ( + startsFrom < 0 || + !isValidArg(content) || + !isValidArg(openSymbol) || + !isValidArg(closeSymbol) || + openSymbol === closeSymbol || + !content.includes(openSymbol) || + !content.includes(closeSymbol) || + startsFrom > content.length - 1 + ) { + return -1; + } + + // + let result = -1; + + // + let index = startsFrom; + const openSignStack = []; + while (index < content.length) { + // + const openCandidate = content.substring(index, index + openSymbol.length); + const closeCandidate = content.substring(index, index + closeSymbol.length); + + // + if (openCandidate === openSymbol) { + openSignStack.push(index); + } else if (closeCandidate === closeSymbol) { + // + if (openSignStack.length > 0) { + openSignStack.pop(); + } + + // + if (openSignStack.length === 0) { + result = index; + break; + } + } + + // + index++; + } + + // + return result; +} + +/** + * find closed contents of specific sign in destination content ... + * + * @param {string} openSymbol open of area sign ... + * @param {string} closeSymbol close of area sign ... + * @param {string} content the destination content for parsing ... + * @param {number} startsFrom an start index of content for start parsing ... + * @returns + */ +function findClosedContent( + openSymbol = '', + closeSymbol = '', + content = '', + startsFrom = 0, +) { + // + let result = [{ + start: -1, + end: -1, + content: '' + }]; + result.pop(); + + // + // Validate Args ... + if ( + !isValidArg(content) || + !isValidArg(openSymbol) || + !isValidArg(closeSymbol) || + !content.includes(openSymbol) || + !content.includes(closeSymbol) || + openSymbol.length >= content.length || + closeSymbol.length >= content.length + ) { + return result; + } + + // + // Normalize Start From ... + startsFrom = startsFrom < 0 || startsFrom >= content.length ? 0 : startsFrom; + + // + let canContinue = true; + while (!!canContinue) { + // + let openSymbolIndex = content.indexOf(openSymbol, startsFrom); + if (openSymbolIndex < 0) { + // + canContinue = false; + continue; + } + + // + let closeSymbolIndex = findCloseIndex( + openSymbol, + closeSymbol, + content, + openSymbolIndex + ); + if (closeSymbolIndex < 0) { + // + canContinue = false; + continue; + } + if (content.charAt(closeSymbolIndex) !== closeSymbol) { + closeSymbolIndex++; + } + + // + // Prevent ${} string interpolations ... + if ( + openSymbol === '{' && + openSymbolIndex - 1 >= 0 + ) { + // + const prevChar = content.charAt(openSymbolIndex - 1); + if (prevChar === '$') { + continue; + } + } + + // + const item = content + .substring(openSymbolIndex, closeSymbolIndex + 1) + .trim(); + startsFrom = closeSymbolIndex + 1; + result.push({ + start: openSymbolIndex, + end: closeSymbolIndex, + content: item + }); + } + + // + if (!hasChildArray(result)) { + return result; + } + + // + return result; +} + +/** + * extract a collection of closed contents exists in a content ... + * + * @param symbols a collection of open and close contents ... + * @param {string} content a content for searching inside it ... + * @returns a collection of closed content ... + */ +function findClosedContents( + symbols = [ + { + openSymbol: '', + closeSymbol: '' + } + ], + content = '' +) { + // + let result = [{ + start: -1, + end: -1, + content: '' + }]; + result.pop(); + + // + if ( + !isValidArg(content) || + !hasChildArray(symbols) + ) { + return []; + } + + // + symbols.forEach(symbol => { + // + const closedContent = findClosedContent( + symbol.openSymbol, + symbol.closeSymbol, + content + ); + + // + if (hasChildArray(closedContent)) { + result.push( + ...closedContent + ); + } + }); + + // + return result; +} + +/** + * find all string content closed items ... + * + * @param {string} content a content which going to search ... + * @returns a collection of index descriptors ... + */ +function findClosedStrings(content = '') { + // + // Validate Args ... + if (!isValidArg(content)) { + return []; + } + + // + // there are 3 types of strings ... + // ' " and ` + + // + const token1 = '\''; + const token1Stack = [0]; + token1Stack.pop(); + + // + const token2 = '"'; + const token2Stack = [0]; + token2Stack.pop(); + + // + const token3 = '`'; + const token3Stack = [0]; + token3Stack.pop(); + + // + const result = [ + { + start: -1, + end: -1, + content: '' + } + ]; + result.pop(); + + // + for (let i = 0; i < content.length; i++) { + // + const currentChart = content.charAt(i); + + // + //#region Token 1 ... + if (currentChart === token1) { + // + if (!hasChildArray(token1Stack)) { + token1Stack.push(i); + } else { + // + const start = token1Stack.pop(); + const end = i + 1; + const pContent = content.substring(start, end); + result.push({ + start, + end, + content: pContent + }); + } + } + //#endregion + + // + //#region Token 2 ... + if (currentChart === token2) { + // + if (!hasChildArray(token2Stack)) { + token2Stack.push(i); + } else { + // + const start = token2Stack.pop(); + const end = i + 1; + const pContent = content.substring(start, end); + result.push({ + start, + end, + content: pContent + }); + } + } + //#endregion + + // + //#region Token 3 ... + if (currentChart === token3) { + // + if (!hasChildArray(token3Stack)) { + token3Stack.push(i); + } else { + // + const start = token3Stack.pop(); + const end = i + 1; + const pContent = content.substring(start, end); + result.push({ + start, + end, + content: pContent + }); + } + } + //#endregion + } + + // + return result; +} + +/** + * find container indexes from within indexes ... + * + * @param {...{start: number, end: number}} index the collection of indexes to find beiggers inside ... + * @returns + */ +function findContainerIndexes(...index) { + // + let result = [ + { + start: -1, + end: -1, + content: '' + } + ]; + result.pop(); + + // + let concatedIndexes = []; + for (let idx of index) { + // + // Index Childs ... + for (let iix of idx) { + // + // Check idx is standard ... + if ( + !iix || + !iix.end || + !iix.start || + iix.start > iix.end + ) { + continue; + } + + // + // Check index inside another index ... + concatedIndexes.push(iix); + } + } + + // + if (!hasChildArray(concatedIndexes)) { + return result; + } + + // + for (let ccIdx of concatedIndexes) { + // + const isInside = isIndexInside(ccIdx, ...concatedIndexes); + if (isInside) { + continue; + } + + // + if (hasChildArray(result)) { + // + const isInsideResult = isIndexInside(ccIdx, ...result); + if (isInsideResult) { + continue; + } + } + + // + result.push(ccIdx); + } + + // + return result; +} + +/** + * find all tokens indexes inside a content which they are not inside closed items ... + * + * @param {string|string[]} tokens the tokens which require to search ... + * @param {string} content the content which using to search ... + * @returns + */ +function findAllIndexesOutOfCloseds1( + tokens, + content, +) { + // + // Validate Args ... + if (!isValidArg(content)) { + return []; + } + + // + // Extract token Indexes ... + const tokensIndexes = findAllIndexes(tokens, content); + if (!hasChildArray(tokensIndexes)) { + return []; + } + + // + // Extract Closed Objects Indexes ... + const closedArrays = findClosedContent('[', ']', content); + const closedObjects = findClosedContent('{', '}', content); + const closedStrings = findClosedStrings(content); + if ( + !hasChildArray(closedObjects) && + !hasChildArray(closedArrays) && + !hasChildArray(closedStrings) + ) { + return tokensIndexes; + } + + // + // find bigger sloded ... + let containerClosedItems = findContainerIndexes( + closedArrays, + closedObjects, + closedStrings + ).filter(i => !isSurroundedString(i.content)); + + // + let result = [-1]; + result.pop(); + + // + for (let tIdx of tokensIndexes) { + // + let canAdd = true; + for (let ccIndex of containerClosedItems) { + // + canAdd = isInsideIndex(tIdx, ccIndex); + if (canAdd) { + break; + } + } + + // + if (!canAdd) { + result.push(tIdx); + } + } + + // + return result; +} + +/** + * find all tokens indexes inside a content which they are not inside closed items ... + * + * @param {string|string[]} tokens the tokens which require to search ... + * @param {string} content the content which using to search ... + * @returns + */ +function findAllIndexesOutOfCloseds( + tokens, + content, +) { + // + // Define Result ... + let result = [-1]; + result.pop(); + + // + // Validate Args ... + if (!isValidArg(content)) { + return []; + } + + // + // Normalize Tokens ... + const normalizeTokens = toNormalArray(tokens); + if (!hasChildArray(normalizeTokens)) { + return result; + } + + // + // Extract Closed Objects Indexes ... + let openSymbols = [ + '{', + '[', + '\'', + '"', + '`' + ]; + let closeSymbols = [ + '}', + ']', + '\'', + '"', + '`' + ]; + let openStack = []; + let lastOpenSymbol = ''; + let lastClosedIndex = -1; + for (let i = 0; i < content.length; i++) { + // + const prevChar = content.charAt(i - 1) || ''; + const char = content.charAt(i); + const nextChar = content.charAt(i + 1) || ''; + + // + const isToken = normalizeTokens.includes(char); + const isOpenSymbol = openSymbols.includes(char); + const isCloseSymbol = closeSymbols.includes(char); + + // + if (isOpenSymbol && lastOpenSymbol !== char) { + openStack.push(i); + lastOpenSymbol = char === '\'' || char === '"' || char === '`' ? char : lastOpenSymbol; + } else if (isCloseSymbol) { + // + lastOpenSymbol = char === '\'' || char === '"' || char === '`' ? '' : lastOpenSymbol; + let lastPop = openStack.pop(); + if (openStack.length === 0) { + lastClosedIndex = lastPop; + } + } else if (isToken) { + if ( + i > lastClosedIndex && + openStack.length === 0 + ) { + result.push(i); + } + } + } + + // + return result; +} +//#endregion + +// +//#region Validator Actions ... +/** + * check specified value is Valid URL Address or not ... + * + * @param {string} value specified string which required to check + * @returns {boolean} + */ +function isValidURL(value = "") { + // + if (!isValidArg(value)) { + return false; + } + + const pattern = new RegExp( + '^([a-zA-Z]+:\\/\\/)?' + // protocol + '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name + '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR IP (v4) address + '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path + '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string + '(\\#[-a-z\\d_]*)?$', // fragment locator + 'i' + ); + + // + const result = pattern.test(value); + return result; +} + +/** + * check specified value is Valid URL Address or not ... + * + * @param {string} value specified string which required to check + */ +function isValidEmail(value = "") { + // + if (!isValidArg(value)) { + return false; + } + + // + const pattern = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/gim; + + // + const result = pattern.test(value); + return result; +} +//#endregion + +// +//#region Normallizers ... +/** + * normallize an string ... + * + * @param {string} value specified value ... + * @returns {string} + */ +function toNormalString(value = "") { + // + if (!XTypeTools.isString(value)) { + value = ""; + } + + // + const result = value + .trim() + .toLowerCase(); + + // + return result; +} +//#endregion + +// +//#region Beautifiers ... +/** + * converts an object to string based on json and beautify result ... + * + * @param {any} object + * @returns {string} + */ +function beautifyJSON(object = undefined) { + // + // TODO: Complete this ... + let result = ""; + + // + // validate object ... + if (object === undefined) { + return result; + } + + // + // Convert result ... + result = JSON.stringify( + object, + null, + 4 + ); + + // + return result; +} +//#endregion + +// +//#region Module Exports ... +module.exports = { + // + endsWidth, + surroundBy, + isValidArg, + isValidArgs, + toNormalArray, + hasChildArray, + toStringExpression, + + // + sliceContent, + clearContent, + clearSurround, + clearArraySurround, + clearObjectSurround, + + // + isSurrounded, + isIndexInside, + isInsideIndex, + isKeyValueType, + isSurroundedArray, + isSurroundedString, + isSurroundedObject, + + // + findNearest, + findAllIndexes, + findCloseIndex, + findNearestIndex, + findClosedContent, + findClosedStrings, + findClosedContents, + findAllIndexesOutOfCloseds, + + // + // Validator Actions ... + isValidURL, + isValidEmail, + + // + // Normallizers ... + toNormalString, + + // + beautifyJSON, +} +//#endregion \ No newline at end of file diff --git a/Publishes/.gitkeep b/Publishes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..22078bc --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# MQL4 + +this is a workspace which contains MetaTrader4 Data Folder Contents to Directly develop MQL4 using VSCode and test them. + +## Maintainer + +Hadi Khazaee asl + +[https://www.saherelm.ir](https://www.saherelm.ir) + +[hadi_khazaee_asl@yahoo.com](mailto:hadi_khazaee_asl@yahoo.com) diff --git a/Temp/result.md b/Temp/result.md new file mode 100644 index 0000000..e2430d1 --- /dev/null +++ b/Temp/result.md @@ -0,0 +1,307 @@ +# Report On OSC + +1- + + +2- + + +3- + + +4- + + +5- + + +6- + + +7- + + +8- + + +9- + + +10- + + +11- + + +12- + + +13- + + +14- + + +15- + + +16- + + +17- + + +18- + + +19- + + +20- + + +21- + + +22- + + +23- + + +24- + + +25- + + +26- + + +27- + + +28- + + +29- + + +30- + + +31- + + +32- + + +33- + + +34- + + +35- + + +36- + + +37- + + +38- + + +39- + + +40- + + +41- + + +42- + + +43- + + +44- + + +45- + + +46- + + +47- + + +48- + + +49- + + +50- + + +51- + + +52- + + +53- + + +54- + + +55- + + +56- + + +57- + + +58- + + +59- + + +60- + + +61- + + +62- + + +63- + + +64- + + +65- + + +66- + + +67- + + +68- + + +69- + + +70- + + +71- + + +72- + + +73- + + +74- + + +75- + + +76- + + +77- + + +78- + + +79- + + +80- + + +81- + + +82- + + +83- + + +84- + + +85- + + +86- + + +87- + + +88- + + +89- + + +90- + + +91- + + +92- + + +93- + + +94- + + +95- + + +96- + + +97- + + +98- + + +99- + + +100- + + +101- + + +102- + diff --git a/Templates/x-saherelm.ea..xtpw.btc.tpl b/Templates/x-saherelm.ea..xtpw.btc.tpl new file mode 100644 index 0000000..d890a98 --- /dev/null +++ b/Templates/x-saherelm.ea..xtpw.btc.tpl @@ -0,0 +1,90 @@ + +id=133391534035912727 +comment=x-saherelm.ea testing with candleGapBetweenSignals=7; allowTrade=1; allowLongTrades=1; allowShortTrades=1; alertEvents=1; alertPositions=1; longPositionAlerts=1; shortPositionAlerts=1; terminalAlert=0; pushAlert=0; lotsPerTradePercent=0.00001; maxOpenTrad +symbol=BTCUSD +period=15 +leftpos=846 +digits=2 +scale=32 +graph=1 +fore=0 +grid=0 +volume=0 +scroll=0 +shift=0 +ohlc=1 +one_click=0 +one_click_btn=1 +askline=0 +days=0 +descriptions=0 +shift_size=20 +fixed_pos=0 +window_left=52 +window_top=52 +window_right=1352 +window_bottom=477 +window_type=3 +background_color=0 +foreground_color=16777215 +barup_color=65280 +bardown_color=255 +bullcandle_color=65280 +bearcandle_color=255 +chartline_color=65280 +volumes_color=3329330 +grid_color=10061943 +askline_color=255 +stops_color=255 + + +height=100 +fixed_height=0 + +name=main + + + + +height=50 +fixed_height=0 + +name=Custom Indicator + +name=x-saherelm.xtpow +flags=259 +window_num=-1 + +marketLength=7 + + +shift_0=0 +draw_0=2 +color_0=65280 +style_0=2 +weight_0=1 +shift_1=0 +draw_1=2 +color_1=255 +style_1=2 +weight_1=1 +shift_2=0 +draw_2=0 +color_2=65535 +style_2=2 +weight_2=1 +min=0.00000000 +max=100.00000000 +levels_color=8421504 +levels_style=2 +levels_weight=-1 +level_0=0.00000000 +level_1=20.00000000 +level_2=50.00000000 +level_3=100.00000000 +period_flags=0 +show_data=1 + + + + diff --git a/Templates/x-saherelm.ea.15m.tpl b/Templates/x-saherelm.ea.15m.tpl new file mode 100644 index 0000000..23db707 --- /dev/null +++ b/Templates/x-saherelm.ea.15m.tpl @@ -0,0 +1,208 @@ + +id=133391534035912728 +comment=x-saherelm.ea testing with candleGapBetweenSignals=7; allowTrade=1; allowLongTrades=1; allowShortTrades=1; alertEvents=1; alertPositions=1; longPositionAlerts=1; shortPositionAlerts=1; terminalAlert=0; pushAlert=0; lotsPerTradePercent=0.00001; maxOpenTrad +symbol=BTCUSD +period=15 +leftpos=354 +digits=2 +scale=32 +graph=1 +fore=0 +grid=0 +volume=0 +scroll=0 +shift=0 +ohlc=1 +one_click=0 +one_click_btn=1 +askline=0 +days=0 +descriptions=0 +shift_size=20 +fixed_pos=0 +window_left=26 +window_top=26 +window_right=1356 +window_bottom=460 +window_type=3 +background_color=0 +foreground_color=16777215 +barup_color=65280 +bardown_color=255 +bullcandle_color=65280 +bearcandle_color=255 +chartline_color=65280 +volumes_color=3329330 +grid_color=10061943 +askline_color=255 +stops_color=255 + + +height=100 +fixed_height=0 + +name=main + + +name=Parabolic SAR +step=0.0200 +end=0.2000 +color=65280 +style=0 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=288 +shift=0 +method=1 +apply=4 +color=7059389 +style=4 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=288 +shift=0 +method=0 +apply=0 +color=3937500 +style=4 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=144 +shift=0 +method=0 +apply=0 +color=36095 +style=4 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=96 +shift=0 +method=1 +apply=4 +color=13434880 +style=3 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=96 +shift=0 +method=0 +apply=0 +color=16711935 +style=3 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=48 +shift=0 +method=0 +apply=0 +color=16776960 +style=3 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=14 +shift=0 +method=1 +apply=4 +color=8388736 +style=2 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=14 +shift=0 +method=0 +apply=0 +color=255 +style=2 +weight=1 +period_flags=0 +show_data=1 + + +name=Moving Average +period=7 +shift=0 +method=0 +apply=0 +color=32768 +style=2 +weight=1 +period_flags=0 +show_data=1 + + + + +height=50 +fixed_height=0 + +name=Custom Indicator + +name=x-saherelm.xtpow +flags=259 +window_num=-1 + +marketLength=7 + + +shift_0=0 +draw_0=2 +color_0=65280 +style_0=2 +weight_0=1 +shift_1=0 +draw_1=2 +color_1=255 +style_1=2 +weight_1=1 +shift_2=0 +draw_2=0 +color_2=65535 +style_2=2 +weight_2=1 +min=0.00000000 +max=100.00000000 +levels_color=8421504 +levels_style=2 +levels_weight=-1 +level_0=0.00000000 +level_1=20.00000000 +level_2=50.00000000 +level_3=100.00000000 +period_flags=0 +show_data=1 + + + + diff --git a/publish.js b/publish.js new file mode 100644 index 0000000..70aff7e --- /dev/null +++ b/publish.js @@ -0,0 +1,253 @@ +/** + * Publish XEa ... + * a node js based application for publishing x-ea Expert ... + * + * Maintainer + * + * Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) + */ + +// +//#region Imports ... +const XFileTools = require("./Node/x-file.tools"); +const XArgsParser = require("./Node/x-arg.parser"); +const XValueTools = require("./Node/x-value.tools"); +const XLoggerTools = require("./Node/x-logger.tools"); +//#endregion + +// +//#region Constants / Variables ... +const MESSAGES = { + // + // Errors ... + InvalidArgs: "invalid arg ...", + ActionFailed: "action failed ...", + DuplicateName: "duplicate name ...", + // + // Messages ... + CheckNameValue: "checking pack name value ...", + CheckPackExists: "checking given pack name exists or not ...", + CreatePackFolder: "creating publish destination folder ...", + StartPacking: "start packing ...", + Succeed: "packing successfully finished ...", +}; +//#endregion + +// +//#region Actions ... +//#endregion + +// +//#region Startup ... +const args = process.argv; +const packName = process.argv[2]; +const packFolderPath = XFileTools.joinPath(__dirname, "Publishes"); + +// +// Startup function ... +async function startup() { + // + // Check pack name contains value ... + XLoggerTools.simpleInfoLog(MESSAGES.CheckNameValue); + if (!XValueTools.isValidArg(packName)) { + // + XLoggerTools.simpleErrorLog(MESSAGES.InvalidArgs); + exit(); + } + + // + // Check Pack Path Exists ... + if (!XFileTools.isDirectoryExists(packFolderPath)) { + // + // Create Pack Folder ... + const isCreated = XFileTools.createDirectory(packFolderPath); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + } + + // + // Prepare Pack Dest Folder Path ... + const packPath = XFileTools.joinPath(packFolderPath, packName); + + // + // Check Existance ... + XLoggerTools.simpleInfoLog(MESSAGES.CheckPackExists); + if (XFileTools.isDirectoryExists(packPath)) { + // + XLoggerTools.simpleErrorLog(MESSAGES.DuplicateName); + exit(); + } + + // + // Create Dest Pack Path Folder ... + XLoggerTools.simpleInfoLog(MESSAGES.CreatePackFolder); + let isCreated = XFileTools.createDirectory(packPath); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + + // + // Generate a List of Files ... + // + // Ex4 Files ... + let ex4FilesList = await XFileTools.getRecursiveFilesList( + __dirname, + [".ex4"] + ); + + // + // MQ4 Files ... + let mq4FilesList = await XFileTools.getRecursiveFilesList( + __dirname, + [".mq4"] + ); + + // + // Filter BKP files ... + // + // From Ex4 ... + ex4FilesList = ex4FilesList.filter(f => + !f.toLowerCase().includes("bkp") + && f.toLowerCase().includes("x-saherelm.") + ); + + // + // From MQ4 ... + mq4FilesList = mq4FilesList.filter(f => + !f.toLowerCase().includes("bkp") + && f.toLowerCase().includes("x-saherelm.") + ); + + // + // Create required Dest Folders on Pack Dest ... + XLoggerTools.simpleInfoLog(MESSAGES.StartPacking); + + // + const packEx4Folder = XFileTools.joinPath(packPath, "Ex4"); + isCreated = XFileTools.createDirectory(packEx4Folder); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed()); + exit(); + } + + // + const packMQ4Folder = XFileTools.joinPath(packPath, "MQ4"); + isCreated = XFileTools.createDirectory(packMQ4Folder); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed()); + exit(); + } + + // + const packReportsFolder = XFileTools.joinPath(packPath, "Reports"); + isCreated = XFileTools.createDirectory(packReportsFolder); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed()); + exit(); + } + + // + // Transfer Files ... + for(let idx = 0; idx < ex4FilesList.length; idx++) { + // + const ex4 = ex4FilesList[idx]; + const mq4 = mq4FilesList[idx]; + + // + // Clear Current Dir and File Name to found Path ... + const clearEx4FilePath = ex4.replace(__dirname, ""); + const clearMQ4FilePath = mq4.replace(__dirname, ""); + + // + const ex4FileName = XFileTools.basename(clearEx4FilePath); + const mq4FileName = XFileTools.basename(clearMQ4FilePath); + + // + let ex4FilePath = clearEx4FilePath.replace(ex4FileName, ""); + if (ex4FilePath.startsWith(XFileTools.PathSeparator)) { + ex4FilePath = ex4FilePath.substring(1); + } + if (ex4FilePath.endsWith(XFileTools.PathSeparator)) { + ex4FilePath = ex4FilePath.substring(0, ex4FilePath.length - 1); + } + ex4FilePath = XFileTools.joinPath(packEx4Folder, ex4FilePath); + if (!XFileTools.isDirectoryExists(ex4FilePath)) { + // + isCreated = XFileTools.createDirectory(ex4FilePath); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + } + let isTransfered = await XFileTools.copyFile(ex4, ex4FilePath); + if (!isTransfered) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + + // + let mq4FilePath = clearMQ4FilePath.replace(mq4FileName, ""); + if (mq4FilePath.startsWith(XFileTools.PathSeparator)) { + mq4FilePath = mq4FilePath.substring(1); + } + if (mq4FilePath.endsWith(XFileTools.PathSeparator)) { + mq4FilePath = mq4FilePath.substring(0, mq4FilePath.length - 1); + } + mq4FilePath = XFileTools.joinPath(packMQ4Folder, mq4FilePath); + if (!XFileTools.isDirectoryExists(mq4FilePath)) { + // + isCreated = XFileTools.createDirectory(mq4FilePath); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + } + isTransfered = await XFileTools.copyFile(mq4, mq4FilePath); + if (!isTransfered) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + } + + // + // Adding Pack Time ... + const packVersionFile = XFileTools.joinPath(packPath, "Version.txt"); + const packVersionContent = `packed at: ${new Date()}`; + isCreated = await XFileTools.writeFile( + packVersionFile, + packVersionContent + ); + if (!isCreated) { + // + XLoggerTools.simpleErrorLog(MESSAGES.ActionFailed); + exit(); + } + + // + // Succeed the Action ... + XLoggerTools.simpleInfoLog(MESSAGES.Succeed); + exit(); +} + +/** + * exit from app ... + */ +function exit() { + process.exit(); +} +// +// Startup Application ... +startup(); +//#endregion \ No newline at end of file