// Zeitdefinitionen
global calc Uhrzeit: Uhrzeit();
global calc Tageswechsel: Tageswechsel();
global calc dst_: Komp(# DST_USA(DIF)#,#T#); // Sommer-Winterzeit Unterschied USA/D
global calc dst: dst_*100;
// Definition des Handelszeit in dem der Einstieg erlaubt ist ----------------------------
global const Zeitgrenze: 1200;
global calc dst_HZ: [DST für Handelszeit berücksichtigen:1,0|1]; // 0=nein, 1=ja
global const Entry_Beginn_: [Entry_Begin:925,905|910|915|920|925|930|935|940|945|1000];
global calc Entry_Beginn: If( Entry_Beginn_ <= Zeitgrenze, Entry_Beginn_, Entry_Beginn_ +(dst*dst_HZ));
global const Entry_Ende_: [Entry_Ende:1730,1000|1015|1030|1045|1100|1115|1130|1145|1200|1215|1230|1245|1300|1315|1330|1345|1400|1415|1430|1445|1500|1515|1530|1545|1600|1615|1630|1645|1700|1705|1710|1715|1720|1725|1730];
global calc Entry_Ende: If( Entry_Ende_ <= Zeitgrenze, Entry_Ende_, Entry_Ende_ +(dst*dst_HZ));
global const Exit_Zeit_: [Exit_Zeit:2205,1745|1800|1815|1830|1845|1900|1915|1930|1945|2000|2015|2030|2045|2100|2105|2110|2115|2120|2125|2130|2135|2140|2145|2150|2155|2200|2205];
global calc Exit_Zeit: If( Exit_Zeit_ <= Zeitgrenze, Exit_Zeit_, Exit_Zeit_ +(dst*dst_HZ));
global calc Handelszeit: Uhrzeit >= Entry_Beginn and Uhrzeit < Entry_Ende and Uhrzeit < Exit_Zeit;
global calc BreakAtTageswechsel: If( [BreakAtTageswechsel:1,0|1]=1, Tageswechsel, 0);
// Europäische Newszeit siehe
www.derivatecheck.de/termine
global const rvn: [Respect vor News:7,0,3,0,21,1,1,I]*#_Komp#;
global const rnn: [Respect nach News:21,0,5,0,45,1,1,I]*#_Komp#;
global const Zeit1: 1000;
global const Zeit2: 1200;
global const Zeit3: 1300;
global const Zeit4: 1600;
global calc NewsZeit: Zwischen(Uhrzeit, (Zeit1-40)-rvn, Zeit1+rnn-1)
or Zwischen(Uhrzeit, (Zeit2-40)-rvn, Zeit2+rnn-1)
or Zwischen(Uhrzeit, (Zeit3-40)-rvn, Zeit3+rnn-1)
or Zwischen(Uhrzeit, (Zeit4-40)-rvn, Zeit4+rnn-1)
;
// ... und amerikanische Newstime siehe
www.forexfactory.com
global const Time1: 1030;
global const Time2: 1430;
global calc NewsTime: Zwischen(Uhrzeit,(Time1-00)-rvn+dst,Time1+rnn-1+dst)
or Zwischen(Uhrzeit, (Time2-00)-rvn+dst,time2+rnn-1+dst)
;
// und dann die Mittagszeit
global calc Mittagszeit: Zwischen(Uhrzeit,[Beginn Mittagspause:1100,1100|1110|1120|1130|1140|1145|1150|1155|1200|1205|1210|1215|1220|1225|1230|1235|1240|1245|1300],[Ende Mittagspause:1530,1235|1240|1245|1250|1255|1300|1305|1310|1315|1320|1325|1330|1345|1400|1430|1445|1500|1515|1530|1545|1600])
;
global calc Doldrums: Zwischen(Uhrzeit,[Beginn Doldrum:1800fix,1700|1715|1730|1745|1800|1815|1830|1845|1900]+dst,[Ende Doldrum:1900fix,1715|1730|1745|1800|1815|1830|1845|1900|1915|1930|1945|2000|2015]+dst)
;