|
@@ -123,13 +123,13 @@ void Bos(int i)
|
|
|
|
|
|
|
|
high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
|
|
high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
|
|
|
|
|
|
|
|
- Print("high index ",high_index);
|
|
|
|
|
|
|
+ // Print("high index ",high_index);
|
|
|
|
|
|
|
|
int count = (high_index-1) - i;
|
|
int count = (high_index-1) - i;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("count is ",count);
|
|
|
|
|
|
|
+ // Print("count is ",count);
|
|
|
|
|
|
|
|
for(int j=count; j >= 1; j--)
|
|
for(int j=count; j >= 1; j--)
|
|
|
{
|
|
{
|
|
@@ -143,7 +143,8 @@ void Bos(int i)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
high = high1;
|
|
high = high1;
|
|
|
- Print(" high is updated : ",high);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Print(" high is updated : ",high);
|
|
|
|
|
|
|
|
|
|
|
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
@@ -159,13 +160,13 @@ void Bos(int i)
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
+ // Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("bearish candle found and its low is ",low);
|
|
|
|
|
|
|
+ // Print("bearish candle found and its low is ",low);
|
|
|
|
|
|
|
|
low = iLow(Symbol(),PERIOD_CURRENT,high_index-j);
|
|
low = iLow(Symbol(),PERIOD_CURRENT,high_index-j);
|
|
|
- Print("bearish candle found and its low is ",low);
|
|
|
|
|
|
|
+ // Print("bearish candle found and its low is ",low);
|
|
|
bearish_found = true;
|
|
bearish_found = true;
|
|
|
count = high_index-j;
|
|
count = high_index-j;
|
|
|
index_of_low_time = iTime(Symbol(),PERIOD_CURRENT,high_index-j);
|
|
index_of_low_time = iTime(Symbol(),PERIOD_CURRENT,high_index-j);
|
|
@@ -189,7 +190,7 @@ void Bos(int i)
|
|
|
|
|
|
|
|
//index_of_low = high_index- k;
|
|
//index_of_low = high_index- k;
|
|
|
|
|
|
|
|
- Print(" ------------------index of low ",index_of_low);
|
|
|
|
|
|
|
+ // Print(" ------------------index of low ",index_of_low);
|
|
|
bearish_found = false;
|
|
bearish_found = false;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -225,8 +226,8 @@ void Bos(int i)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("high of uptrend is ", high);
|
|
|
|
|
- Print("low of uptrend is ", low);
|
|
|
|
|
|
|
+ // Print("high of uptrend is ", high);
|
|
|
|
|
+ // Print("low of uptrend is ", low);
|
|
|
|
|
|
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
|
|
|
|
@@ -273,11 +274,11 @@ void Bos(int i)
|
|
|
|
|
|
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
|
|
|
|
|
|
- Print("low index ",low_index);
|
|
|
|
|
|
|
+ // Print("low index ",low_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
int count = (low_index-1) - i;
|
|
int count = (low_index-1) - i;
|
|
|
- Print("count is ",count);
|
|
|
|
|
|
|
+ // Print("count is ",count);
|
|
|
|
|
|
|
|
for(int j=count; j >= 1; j--)
|
|
for(int j=count; j >= 1; j--)
|
|
|
{
|
|
{
|
|
@@ -303,7 +304,7 @@ void Bos(int i)
|
|
|
|
|
|
|
|
|
|
|
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
- Print(store_last_bos_index_time);
|
|
|
|
|
|
|
+ // Print(store_last_bos_index_time);
|
|
|
|
|
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
|
|
@@ -313,14 +314,14 @@ void Bos(int i)
|
|
|
//------
|
|
//------
|
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
|
|
|
|
|
|
- Print("low index ",low_index);
|
|
|
|
|
|
|
+ // Print("low index ",low_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("bullish candle found and its high is ",high);
|
|
|
|
|
|
|
+ // Print("bullish candle found and its high is ",high);
|
|
|
|
|
|
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,low_index-j);
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,low_index-j);
|
|
|
- Print("bullish candle found and its high is ",high);
|
|
|
|
|
|
|
+ // Print("bullish candle found and its high is ",high);
|
|
|
bullish_found = true;
|
|
bullish_found = true;
|
|
|
count = low_index-j;
|
|
count = low_index-j;
|
|
|
index_of_high_time = iTime(Symbol(),PERIOD_CURRENT,low_index-j);
|
|
index_of_high_time = iTime(Symbol(),PERIOD_CURRENT,low_index-j);
|
|
@@ -371,8 +372,8 @@ void Bos(int i)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("high is ", high);
|
|
|
|
|
- Print("low is ", low);
|
|
|
|
|
|
|
+ // Print("high is ", high);
|
|
|
|
|
+ // Print("low is ", low);
|
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -588,7 +589,7 @@ void choch(int i)
|
|
|
|
|
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
|
|
|
- Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
+ // Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
|
int diff1 = Store_bos_last_index - (i);
|
|
int diff1 = Store_bos_last_index - (i);
|
|
|
|
|
|
|
@@ -613,9 +614,9 @@ void choch(int i)
|
|
|
|
|
|
|
|
//Entry_Action_1_up(Store_bos_last_index,i,di);
|
|
//Entry_Action_1_up(Store_bos_last_index,i,di);
|
|
|
|
|
|
|
|
- Print("low update due to choch : ", low);
|
|
|
|
|
|
|
+ // Print("low update due to choch : ", low);
|
|
|
trend = "downtrend";
|
|
trend = "downtrend";
|
|
|
- Print("choch at uptrend index --- ", iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
|
|
+ // Print("choch at uptrend index --- ", iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -640,7 +641,7 @@ void choch(int i)
|
|
|
ObjectSetInteger(0,"line7"+iTime(Symbol(),PERIOD_CURRENT,i),OBJPROP_COLOR,clrGreen);
|
|
ObjectSetInteger(0,"line7"+iTime(Symbol(),PERIOD_CURRENT,i),OBJPROP_COLOR,clrGreen);
|
|
|
|
|
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
- Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
+ // Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
|
int diff = Store_bos_last_index - (i);
|
|
int diff = Store_bos_last_index - (i);
|
|
|
|
|
|
|
@@ -664,8 +665,8 @@ void choch(int i)
|
|
|
|
|
|
|
|
trend = "uptrend";
|
|
trend = "uptrend";
|
|
|
|
|
|
|
|
- Print("high is update due to choch : ", high);
|
|
|
|
|
- Print("choch at downtrend index ---- ", iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
|
|
+ // Print("high is update due to choch : ", high);
|
|
|
|
|
+ // Print("choch at downtrend index ---- ", iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -684,6 +685,12 @@ void bos2(int i)
|
|
|
bool cnd;
|
|
bool cnd;
|
|
|
bool candle_bullish = false;
|
|
bool candle_bullish = false;
|
|
|
bool candle_bearish = false;
|
|
bool candle_bearish = false;
|
|
|
|
|
+ double find_high = 0.0;
|
|
|
|
|
+ datetime find_high_time = 0.0;
|
|
|
|
|
+
|
|
|
|
|
+ double find_low = 0.0;
|
|
|
|
|
+ datetime find_low_time = 0.0;
|
|
|
|
|
+
|
|
|
if(trend == "downtrend")
|
|
if(trend == "downtrend")
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -711,9 +718,16 @@ void bos2(int i)
|
|
|
}
|
|
}
|
|
|
choch_index = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
|
|
choch_index = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ find_high = iHigh(Symbol(),PERIOD_CURRENT,choch_index);
|
|
|
for(int j=choch_index; j>=i; j--)
|
|
for(int j=choch_index; j>=i; j--)
|
|
|
{
|
|
{
|
|
|
|
|
+ double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+
|
|
|
|
|
+ if(find_high < find_high1)
|
|
|
|
|
+ {
|
|
|
|
|
+ find_high = find_high1;
|
|
|
|
|
+ find_high_time = iTime(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
|
|
|
{
|
|
{
|
|
@@ -734,8 +748,17 @@ void bos2(int i)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
+
|
|
|
|
|
+ find_high = iHigh(Symbol(),PERIOD_CURRENT,Store_bos_last_index);
|
|
|
for(int j=Store_bos_last_index; j>=i; j--)
|
|
for(int j=Store_bos_last_index; j>=i; j--)
|
|
|
{
|
|
{
|
|
|
|
|
+ double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+
|
|
|
|
|
+ if(find_high < find_high1)
|
|
|
|
|
+ {
|
|
|
|
|
+ find_high = find_high1;
|
|
|
|
|
+ find_high_time = iTime(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+ }
|
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
|
|
|
{
|
|
{
|
|
|
cnd = false;
|
|
cnd = false;
|
|
@@ -747,6 +770,20 @@ void bos2(int i)
|
|
|
if(cnd == true && candle_bullish == true)
|
|
if(cnd == true && candle_bullish == true)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+ Print("high is --------------",find_high);
|
|
|
|
|
+ Print("high time is --------------",find_high_time);
|
|
|
|
|
+
|
|
|
|
|
+ if(object_find("high") > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ObjectDelete(0,"high");
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ high = find_high;
|
|
|
|
|
+ index_of_high = iBarShift(Symbol(), PERIOD_CURRENT, find_high_time, false);
|
|
|
|
|
+ ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_high),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
|
|
|
+ ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
|
|
|
|
|
+ ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
|
|
|
+
|
|
|
if(object_find("low") > 0)
|
|
if(object_find("low") > 0)
|
|
|
{
|
|
{
|
|
|
ObjectDelete(0,"low");
|
|
ObjectDelete(0,"low");
|
|
@@ -761,23 +798,23 @@ void bos2(int i)
|
|
|
|
|
|
|
|
|
|
|
|
|
ObjectCreate(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),low);
|
|
ObjectCreate(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),low);
|
|
|
- ObjectSetString(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos");
|
|
|
|
|
|
|
+ ObjectSetString(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos2");
|
|
|
|
|
|
|
|
|
|
|
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
- Print(store_last_bos_index_time);
|
|
|
|
|
|
|
+ // Print(store_last_bos_index_time);
|
|
|
|
|
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
+ // Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
|
- Print("low is ", low);
|
|
|
|
|
|
|
+ // Print("low is ", low);
|
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
|
|
|
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
|
|
|
|
|
|
|
|
- Print("low index ",low_index);
|
|
|
|
|
|
|
+ // Print("low index ",low_index);
|
|
|
cnd = false;
|
|
cnd = false;
|
|
|
candle_bullish = false;
|
|
candle_bullish = false;
|
|
|
|
|
|
|
@@ -803,16 +840,27 @@ void bos2(int i)
|
|
|
|
|
|
|
|
if(choch_index_time < store_last_bos_index_time)
|
|
if(choch_index_time < store_last_bos_index_time)
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
for(int m=Store_bos_last_index; m>i; m--)
|
|
for(int m=Store_bos_last_index; m>i; m--)
|
|
|
{
|
|
{
|
|
|
if(checkCandle(m) == "Bearish")
|
|
if(checkCandle(m) == "Bearish")
|
|
|
{
|
|
{
|
|
|
- Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
|
|
|
|
|
|
|
+ // Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
|
|
|
candle_bearish = true;
|
|
candle_bearish = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ find_low = iLow(Symbol(),PERIOD_CURRENT,Store_bos_last_index);
|
|
|
for(int j=Store_bos_last_index; j>=i; j--)
|
|
for(int j=Store_bos_last_index; j>=i; j--)
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+ double find_low1 = iLow(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+
|
|
|
|
|
+ if(find_low > find_low1)
|
|
|
|
|
+ {
|
|
|
|
|
+ find_low = find_low1;
|
|
|
|
|
+ find_low_time = iTime(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
|
|
|
{
|
|
{
|
|
|
cnd = false;
|
|
cnd = false;
|
|
@@ -827,12 +875,20 @@ void bos2(int i)
|
|
|
{
|
|
{
|
|
|
if(checkCandle(m) == "Bearish")
|
|
if(checkCandle(m) == "Bearish")
|
|
|
{
|
|
{
|
|
|
- Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
|
|
|
|
|
|
|
+ // Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
|
|
|
candle_bearish = true;
|
|
candle_bearish = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ find_low = iLow(Symbol(),PERIOD_CURRENT,choch_index);
|
|
|
for(int j=choch_index; j>=i; j--)
|
|
for(int j=choch_index; j>=i; j--)
|
|
|
{
|
|
{
|
|
|
|
|
+ double find_low1 = iLow(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+
|
|
|
|
|
+ if(find_low > find_low1)
|
|
|
|
|
+ {
|
|
|
|
|
+ find_low = find_low1;
|
|
|
|
|
+ find_low_time = iTime(Symbol(),PERIOD_CURRENT,j);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
|
|
if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
|
|
|
{
|
|
{
|
|
@@ -848,6 +904,24 @@ void bos2(int i)
|
|
|
if(cnd == true && candle_bearish == true)
|
|
if(cnd == true && candle_bearish == true)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+ Print("low is --------------",find_low);
|
|
|
|
|
+ Print("low time is --------------",find_low_time);
|
|
|
|
|
+
|
|
|
|
|
+ if(object_find("low") > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ObjectDelete(0,"low");
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ low = find_low;
|
|
|
|
|
+ index_of_low = iBarShift(Symbol(), PERIOD_CURRENT, find_low_time, false);
|
|
|
|
|
+ ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_low),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
|
|
|
|
|
+ ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
|
|
|
|
|
+ ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if(object_find("high") > 0)
|
|
if(object_find("high") > 0)
|
|
|
{
|
|
{
|
|
|
ObjectDelete(0,"high");
|
|
ObjectDelete(0,"high");
|
|
@@ -855,7 +929,7 @@ void bos2(int i)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,i);
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,i);
|
|
|
- Print(" high is updated : ",high);
|
|
|
|
|
|
|
+ // Print(" high is updated : ",high);
|
|
|
|
|
|
|
|
|
|
|
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
@@ -863,7 +937,7 @@ void bos2(int i)
|
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
|
|
|
|
|
|
ObjectCreate(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),high);
|
|
ObjectCreate(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),high);
|
|
|
- ObjectSetString(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos");
|
|
|
|
|
|
|
+ ObjectSetString(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos2");
|
|
|
|
|
|
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
Print(store_last_bos_index_time);
|
|
Print(store_last_bos_index_time);
|
|
@@ -871,17 +945,17 @@ void bos2(int i)
|
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
+ // Print("last bos index is ",Store_bos_last_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Print("high is ", high);
|
|
|
|
|
|
|
+ // Print("high is ", high);
|
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
|
|
|
|
|
|
high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
|
|
high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
|
|
|
|
|
|
|
|
- Print("low index ",high_index);
|
|
|
|
|
|
|
+ // Print("low index ",high_index);
|
|
|
|
|
|
|
|
|
|
|
|
|
cnd = false;
|
|
cnd = false;
|
|
@@ -911,8 +985,8 @@ void third_Condition(int i)
|
|
|
if(low2 < low)
|
|
if(low2 < low)
|
|
|
{
|
|
{
|
|
|
third_condition_met = true;
|
|
third_condition_met = true;
|
|
|
- // ObjectCreate(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
- // ObjectSetString(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
+ ObjectCreate(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
+ ObjectSetString(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
low = low2;
|
|
low = low2;
|
|
|
|
|
|
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
@@ -930,14 +1004,14 @@ void third_Condition(int i)
|
|
|
|
|
|
|
|
ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
|
|
ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
|
|
|
|
|
|
|
|
- Print("low update due to third condition",low," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
|
|
+ // Print("low update due to third condition",low," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(high2 > high)
|
|
if(high2 > high)
|
|
|
{
|
|
{
|
|
|
//third_condition_met = true;
|
|
//third_condition_met = true;
|
|
|
- // ObjectCreate(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
- // ObjectSetString(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
+ ObjectCreate(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
+ ObjectSetString(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
high = high2;
|
|
high = high2;
|
|
|
|
|
|
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
|
|
@@ -955,7 +1029,7 @@ void third_Condition(int i)
|
|
|
|
|
|
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
|
|
|
|
|
|
- Print("high update due to third condition",high," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
|
|
+ // Print("high update due to third condition",high," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -969,8 +1043,8 @@ void third_Condition(int i)
|
|
|
if(high2 > high)
|
|
if(high2 > high)
|
|
|
{
|
|
{
|
|
|
//third_condition_met = true;
|
|
//third_condition_met = true;
|
|
|
- // ObjectCreate(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
- // ObjectSetString(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
+ ObjectCreate(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
+ ObjectSetString(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
|
high = high2;
|
|
high = high2;
|
|
|
|
|
|
|
@@ -986,14 +1060,14 @@ void third_Condition(int i)
|
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
|
|
|
ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
|
|
ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
|
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
|
|
|
- Print("high update due to third condition",high);
|
|
|
|
|
|
|
+ // Print("high update due to third condition",high);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(low2 < low)
|
|
if(low2 < low)
|
|
|
{
|
|
{
|
|
|
third_condition_met = true;
|
|
third_condition_met = true;
|
|
|
- // ObjectCreate(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
- // ObjectSetString(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
+ ObjectCreate(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
|
|
|
|
|
+ ObjectSetString(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
|
|
|
|
|
|
|
|
low = low2;
|
|
low = low2;
|
|
|
|
|
|
|
@@ -1006,11 +1080,11 @@ void third_Condition(int i)
|
|
|
ObjectDelete(0,"low");
|
|
ObjectDelete(0,"low");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- Print("low value is ", low);
|
|
|
|
|
|
|
+ // Print("low value is ", low);
|
|
|
ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
|
|
ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
|
|
|
ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
|
|
ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
|
|
|
ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
|
|
ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
|
|
|
- Print("low update due to third condition",low);
|
|
|
|
|
|
|
+ // Print("low update due to third condition",low);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1212,7 +1286,7 @@ void foo1(int value)
|
|
|
|
|
|
|
|
//Bos(i);
|
|
//Bos(i);
|
|
|
//choch(i);
|
|
//choch(i);
|
|
|
- third_Condition(i);
|
|
|
|
|
|
|
+ //third_Condition(i);
|
|
|
|
|
|
|
|
|
|
|
|
|
// if(signal == "buy" || signal == "sell")
|
|
// if(signal == "buy" || signal == "sell")
|
|
@@ -1356,27 +1430,26 @@ int OnInit()
|
|
|
|
|
|
|
|
|
|
|
|
|
int idx = 0;
|
|
int idx = 0;
|
|
|
-int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT,inpTime, false);
|
|
|
|
|
-if(ObjectCreate(0,"line",OBJ_VLINE,0,inpTime,iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
|
|
|
|
|
- {
|
|
|
|
|
- Print("vertical line created on chart : ");
|
|
|
|
|
- }
|
|
|
|
|
-else
|
|
|
|
|
- {
|
|
|
|
|
- Print("error in creating line : ");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- //int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT, D'2022.09.01 15:30:27', false);
|
|
|
|
|
- //if(ObjectCreate(0,"line",OBJ_VLINE,0,D'2022.09.01 15:30:27',iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
|
|
|
|
|
- // {
|
|
|
|
|
- // Print("object created on chart : ");
|
|
|
|
|
- // }
|
|
|
|
|
- //else
|
|
|
|
|
- // {
|
|
|
|
|
- // Print("object not created : ");
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
|
|
+//int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT,inpTime, false);
|
|
|
|
|
+//if(ObjectCreate(0,"line",OBJ_VLINE,0,inpTime,iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
|
|
|
|
|
+// {
|
|
|
|
|
+// Print("vertical line created on chart : ");
|
|
|
|
|
+// }
|
|
|
|
|
+//else
|
|
|
|
|
+// {
|
|
|
|
|
+// Print("error in creating line : ");
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT, D'2022.09.01 15:30:27', false);
|
|
|
|
|
+ if(ObjectCreate(0,"line",OBJ_VLINE,0,D'2022.09.01 15:30:27',iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
|
|
|
|
|
+ {
|
|
|
|
|
+ Print("object created on chart : ");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ Print("object not created : ");
|
|
|
|
|
+ }
|
|
|
object_find(object_name);
|
|
object_find(object_name);
|
|
|
if(object_find(object_name) == true)
|
|
if(object_find(object_name) == true)
|
|
|
{
|
|
{
|
|
@@ -1386,7 +1459,7 @@ else
|
|
|
//
|
|
//
|
|
|
// index = iBarShift(Symbol(), PERIOD_CURRENT, time_of_candle1, false);
|
|
// index = iBarShift(Symbol(), PERIOD_CURRENT, time_of_candle1, false);
|
|
|
|
|
|
|
|
- Print("candle is ",checkCandle(user_input_index));
|
|
|
|
|
|
|
+ // Print("candle is ",checkCandle(user_input_index));
|
|
|
|
|
|
|
|
if(checkCandle(user_input_index) == "Bullish")
|
|
if(checkCandle(user_input_index) == "Bullish")
|
|
|
{
|
|
{
|
|
@@ -1424,7 +1497,7 @@ else
|
|
|
{
|
|
{
|
|
|
if(checkCandle(j) == "Bullish")
|
|
if(checkCandle(j) == "Bullish")
|
|
|
{
|
|
{
|
|
|
- Print("bullish found ",iTime(Symbol(),PERIOD_CURRENT,j));
|
|
|
|
|
|
|
+ // Print("bullish found ",iTime(Symbol(),PERIOD_CURRENT,j));
|
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,j);
|
|
high = iHigh(Symbol(),PERIOD_CURRENT,j);
|
|
|
idx = j;
|
|
idx = j;
|
|
|
break;
|
|
break;
|
|
@@ -1449,8 +1522,8 @@ else
|
|
|
//high = iHigh(Symbol(),PERIOD_CURRENT,user_input_index);
|
|
//high = iHigh(Symbol(),PERIOD_CURRENT,user_input_index);
|
|
|
//low = iLow(Symbol(),PERIOD_CURRENT,user_input_index);
|
|
//low = iLow(Symbol(),PERIOD_CURRENT,user_input_index);
|
|
|
|
|
|
|
|
- Print(high);
|
|
|
|
|
- Print(low);
|
|
|
|
|
|
|
+ // Print(high);
|
|
|
|
|
+ // Print(low);
|
|
|
//high_index = user_input_index;
|
|
//high_index = user_input_index;
|
|
|
//low_index = user_input_index;
|
|
//low_index = user_input_index;
|
|
|
|
|
|