|
|
@@ -474,9 +474,11 @@ void Entry_Action_2_down(int Store_bos_last_index, int i,int diff)
|
|
474
|
474
|
//+------------------------------------------------------------------+
|
|
475
|
475
|
void Check_Inside_bar(int inex)
|
|
476
|
476
|
{
|
|
|
477
|
+// Print("-----------------------------------------------------------------------------------------------------------------------------------");
|
|
477
|
478
|
|
|
478
|
479
|
for(int j=inex+1; j>=1; j--)
|
|
479
|
480
|
{
|
|
|
481
|
+ // Print(" i am checking inside bar ");
|
|
480
|
482
|
if(checkCandle(j) == "Bearish" && (checkCandle(j-1) == "Bearish" || checkCandle(j-1) == "Doji"))
|
|
481
|
483
|
{
|
|
482
|
484
|
if(iHigh(Symbol(),PERIOD_CURRENT,j) > iOpen(Symbol(),PERIOD_CURRENT,j-1) && iLow(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,j-1))
|
|
|
@@ -501,6 +503,7 @@ void Check_Inside_bar(int inex)
|
|
501
|
503
|
{
|
|
502
|
504
|
if(iHigh(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,j-1) && iLow(Symbol(),PERIOD_CURRENT,j) < iOpen(Symbol(),PERIOD_CURRENT,j-1))
|
|
503
|
505
|
{
|
|
|
506
|
+ // Print("j index is",j," j-1 index is ",j-1);
|
|
504
|
507
|
tp_date_time_sell = 0.0;
|
|
505
|
508
|
tp_date_time_buy = 0.0;
|
|
506
|
509
|
// Print("Target line deleted due to in bar ");
|
|
|
@@ -1808,6 +1811,46 @@ void OnTick()
|
|
1808
|
1811
|
int reversal_indexx = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].reversal_index_date_time,false);
|
|
1809
|
1812
|
int close_index = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].choch_index_date_time,false);
|
|
1810
|
1813
|
|
|
|
1814
|
+ if(checkCandle(close_index) == "Bearish" && (checkCandle(close_index-1) == "Bearish" || checkCandle(close_index-1) == "Doji"))
|
|
|
1815
|
+ {
|
|
|
1816
|
+ if(iHigh(Symbol(),PERIOD_CURRENT,close_index) > iOpen(Symbol(),PERIOD_CURRENT,close_index-1) && iLow(Symbol(),PERIOD_CURRENT,close_index) < iClose(Symbol(),PERIOD_CURRENT,close_index-1))
|
|
|
1817
|
+ {
|
|
|
1818
|
+ tp_date_time_sell = 0.0;
|
|
|
1819
|
+ tp_date_time_buy = 0.0;
|
|
|
1820
|
+ // Print("Target line deleted due to in bar ");
|
|
|
1821
|
+ if(object_find("target line") > 0)
|
|
|
1822
|
+ {
|
|
|
1823
|
+ Print("Target line deleted due to in bar ");
|
|
|
1824
|
+ ObjectDelete(0,"target line");
|
|
|
1825
|
+ }
|
|
|
1826
|
+
|
|
|
1827
|
+ if(object_find("target line1") > 0)
|
|
|
1828
|
+ {
|
|
|
1829
|
+ ObjectDelete(0,"target line1");
|
|
|
1830
|
+ }
|
|
|
1831
|
+ }
|
|
|
1832
|
+ }
|
|
|
1833
|
+
|
|
|
1834
|
+ if(checkCandle(close_index) == "Bullish" && (checkCandle(close_index-1) == "Bullish" || checkCandle(close_index-1) == "Doji"))
|
|
|
1835
|
+ {
|
|
|
1836
|
+ if(iHigh(Symbol(),PERIOD_CURRENT,close_index) > iClose(Symbol(),PERIOD_CURRENT,close_index-1) && iLow(Symbol(),PERIOD_CURRENT,close_index) < iOpen(Symbol(),PERIOD_CURRENT,close_index-1))
|
|
|
1837
|
+ {
|
|
|
1838
|
+ // Print("j index is",j," j-1 index is ",j-1);
|
|
|
1839
|
+ tp_date_time_sell = 0.0;
|
|
|
1840
|
+ tp_date_time_buy = 0.0;
|
|
|
1841
|
+ // Print("Target line deleted due to in bar ");
|
|
|
1842
|
+ if(object_find("target line") > 0)
|
|
|
1843
|
+ {
|
|
|
1844
|
+ Print("Target line deleted due to in bar ");
|
|
|
1845
|
+ ObjectDelete(0,"target line");
|
|
|
1846
|
+ }
|
|
|
1847
|
+
|
|
|
1848
|
+ if(object_find("target line1") > 0)
|
|
|
1849
|
+ {
|
|
|
1850
|
+ ObjectDelete(0,"target line1");
|
|
|
1851
|
+ }
|
|
|
1852
|
+ }
|
|
|
1853
|
+ }
|
|
1811
|
1854
|
|
|
1812
|
1855
|
double reversalMax = iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx) < iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) ? iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) : iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx);
|
|
1813
|
1856
|
// bool snd_con = false;
|
|
|
@@ -1856,6 +1899,47 @@ void OnTick()
|
|
1856
|
1899
|
int reversal_indexx = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].reversal_index_date_time,false);
|
|
1857
|
1900
|
int close_index = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].choch_index_date_time,false);
|
|
1858
|
1901
|
|
|
|
1902
|
+ if(checkCandle(close_index) == "Bearish" && (checkCandle(close_index-1) == "Bearish" || checkCandle(close_index-1) == "Doji"))
|
|
|
1903
|
+ {
|
|
|
1904
|
+ if(iHigh(Symbol(),PERIOD_CURRENT,close_index) > iOpen(Symbol(),PERIOD_CURRENT,close_index-1) && iLow(Symbol(),PERIOD_CURRENT,close_index) < iClose(Symbol(),PERIOD_CURRENT,close_index-1))
|
|
|
1905
|
+ {
|
|
|
1906
|
+ tp_date_time_sell = 0.0;
|
|
|
1907
|
+ tp_date_time_buy = 0.0;
|
|
|
1908
|
+ // Print("Target line deleted due to in bar ");
|
|
|
1909
|
+ if(object_find("target line") > 0)
|
|
|
1910
|
+ {
|
|
|
1911
|
+ Print("Target line deleted due to in bar ");
|
|
|
1912
|
+ ObjectDelete(0,"target line");
|
|
|
1913
|
+ }
|
|
|
1914
|
+
|
|
|
1915
|
+ if(object_find("target line1") > 0)
|
|
|
1916
|
+ {
|
|
|
1917
|
+ ObjectDelete(0,"target line1");
|
|
|
1918
|
+ }
|
|
|
1919
|
+ }
|
|
|
1920
|
+ }
|
|
|
1921
|
+
|
|
|
1922
|
+ if(checkCandle(close_index) == "Bullish" && (checkCandle(close_index-1) == "Bullish" || checkCandle(close_index-1) == "Doji"))
|
|
|
1923
|
+ {
|
|
|
1924
|
+ if(iHigh(Symbol(),PERIOD_CURRENT,close_index) > iClose(Symbol(),PERIOD_CURRENT,close_index-1) && iLow(Symbol(),PERIOD_CURRENT,close_index) < iOpen(Symbol(),PERIOD_CURRENT,close_index-1))
|
|
|
1925
|
+ {
|
|
|
1926
|
+ // Print("j index is",j," j-1 index is ",j-1);
|
|
|
1927
|
+ tp_date_time_sell = 0.0;
|
|
|
1928
|
+ tp_date_time_buy = 0.0;
|
|
|
1929
|
+ // Print("Target line deleted due to in bar ");
|
|
|
1930
|
+ if(object_find("target line") > 0)
|
|
|
1931
|
+ {
|
|
|
1932
|
+ Print("Target line deleted due to in bar ");
|
|
|
1933
|
+ ObjectDelete(0,"target line");
|
|
|
1934
|
+ }
|
|
|
1935
|
+
|
|
|
1936
|
+ if(object_find("target line1") > 0)
|
|
|
1937
|
+ {
|
|
|
1938
|
+ ObjectDelete(0,"target line1");
|
|
|
1939
|
+ }
|
|
|
1940
|
+ }
|
|
|
1941
|
+ }
|
|
|
1942
|
+
|
|
1859
|
1943
|
|
|
1860
|
1944
|
double reversalMin = iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx) > iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) ? iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) : iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx);
|
|
1861
|
1945
|
// double reversalMin = iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx) > iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) ? iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) : iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx);
|
|
|
@@ -1910,6 +1994,8 @@ void OnTick()
|
|
1910
|
1994
|
|
|
1911
|
1995
|
if(indexOfTradePlace > 2)
|
|
1912
|
1996
|
{
|
|
|
1997
|
+ int close_index1 = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].choch_index_date_time,false);
|
|
|
1998
|
+ Check_Inside_bar(close_index1);
|
|
1913
|
1999
|
|
|
1914
|
2000
|
// second condition match
|
|
1915
|
2001
|
|
|
|
@@ -1942,6 +2028,7 @@ void OnTick()
|
|
1942
|
2028
|
|
|
1943
|
2029
|
int reversal_indexx = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].reversal_index_date_time,false);
|
|
1944
|
2030
|
int close_index = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].choch_index_date_time,false);
|
|
|
2031
|
+ //Print("Reversal Index time is ",od_1[m].reversal_index_date_time," and chock tine is ",od_1[m].choch_index_date_time);
|
|
1945
|
2032
|
Check_Inside_bar(reversal_indexx);
|
|
1946
|
2033
|
bool snd_con = false;
|
|
1947
|
2034
|
double reversalMax = iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx) < iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) ? iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) : iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx);
|
|
|
@@ -2023,6 +2110,7 @@ void OnTick()
|
|
2023
|
2110
|
|
|
2024
|
2111
|
int reversal_indexx = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].reversal_index_date_time,false);
|
|
2025
|
2112
|
int close_index = iBarShift(Symbol(), PERIOD_CURRENT,od_1[m].choch_index_date_time,false);
|
|
|
2113
|
+ //Print("Reversal Index time is ",od_1[m].reversal_index_date_time," and chock tine is ",od_1[m].choch_index_date_time);
|
|
2026
|
2114
|
Check_Inside_bar(reversal_indexx);
|
|
2027
|
2115
|
double reversalMin = iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx) > iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) ? iClose(Symbol(),PERIOD_CURRENT,reversal_indexx) : iOpen(Symbol(),PERIOD_CURRENT,reversal_indexx);
|
|
2028
|
2116
|
bool snd_con1 = false;
|