double SellPendingLevelOnNewTrend()
{
int j,z ;
int TheDemandTDPointSameLevelOfSupply_BO ;
[B] int LevelOfDemandBO=-1,LevelOfSupplyBO =-1;[/B]
int Location_FirstTDPoint_OnLevelDemand ;
int Location_NxtTDPoint_OnLevelDemand ;
int Location_FirstTDPoint_OnLevelSupply ;
int Location_NxtTDPoint_OnLevelSupply ;
double value ;
double PSL_ValueBasedOnSupply_BO ;
double PSL_ValueBasedOnDemand_BO ;
for(int i=1; i<300; i++)
{
Location_FirstTDPoint_OnLevelDemand = Get_DemandTD_Location_As_Level(i);
Location_NxtTDPoint_OnLevelDemand = Get_NX_DemandTD_Location_As_Level(i);
for(j=Location_FirstTDPoint_OnLevelDemand+1 ; j < Location_NxtTDPoint_OnLevelDemand ; j++)
{
if(Is_DemandTD_Point(j) == true && Level_TDPoint_Demand(j)>Level_TDPoint_Demand(Location_FirstTDPoint_OnLevelDemand))
{
LevelOfDemandBO = Level_TDPoint_Demand(j);
PSL_ValueBasedOnDemand_BO = iLow(NULL,0, Location_FirstTDPoint_OnLevelDemand);
// Print("Level of Demand BO"," ",LevelOfDemandBO," ","Candle Number"," ", j);
break;
}
}
if(LevelOfDemandBO > 0)
{
break;
}
}
//------------------------------------------------------------------------------------------------
for(int i=1; i<300; i++)
{
Location_FirstTDPoint_OnLevelSupply = Get_SupplyTD_Location_As_Level(i);
Location_NxtTDPoint_OnLevelSupply = Get_NX_SupplyTD_Location_As_Level(i);
for(z=Location_FirstTDPoint_OnLevelSupply+1 ; z < Location_NxtTDPoint_OnLevelSupply ; z++)
{
if(Is_SupplyTD_Point(z) == true && Level_TDPoint_Supply(z)>Level_TDPoint_Supply(Location_FirstTDPoint_OnLevelSupply))
{
LevelOfSupplyBO = Level_TDPoint_Supply(z);
TheDemandTDPointSameLevelOfSupply_BO = Get_DemandTD_Location_As_Level(LevelOfSupplyBO);
PSL_ValueBasedOnSupply_BO = iLow(NULL,0,TheDemandTDPointSameLevelOfSupply_BO);
// Print("Level of Supply BO"," ",LevelOfSupplyBO," ","Candle Number"," ", z," ", "Demand Candle as Supply Level BO" = TheDemandTDPointSameLevelOfSupply_BO );
break;
}
}
if(LevelOfSupplyBO > 0)
{
break;
}
}
if(LevelOfSupplyBO < LevelOfDemandBO && LevelOfSupplyBO != 0)
{
Print("Level of Demand BO"," ",LevelOfDemandBO," ","Candle Number"," ", j, "The candle of PSL loc."," ",Location_FirstTDPoint_OnLevelDemand," ","its value:"," ",PSL_ValueBasedOnDemand_BO);
Print("Level of Supply BO"," ",LevelOfSupplyBO," ","Candle Number"," ", z, " The candle of PSL loc."," ",TheDemandTDPointSameLevelOfSupply_BO," ","its value:"," ",PSL_ValueBasedOnSupply_BO);
return (PSL_ValueBasedOnSupply_BO);
}
if(LevelOfDemandBO < LevelOfSupplyBO && LevelOfDemandBO != 0)
{
Print("Level of Demand BO"," ",LevelOfDemandBO," ","Candle Number"," ", j, "The candle of PSL loc."," ",Location_FirstTDPoint_OnLevelDemand," ","its value:"," ",PSL_ValueBasedOnDemand_BO);
Print("Level of Supply BO"," ",LevelOfSupplyBO," ","Candle Number"," ", z, " The candle of PSL loc."," ",TheDemandTDPointSameLevelOfSupply_BO," ","its value:"," ",PSL_ValueBasedOnSupply_BO);
return (PSL_ValueBasedOnDemand_BO);
}
if(LevelOfDemandBO == 0)
{
Print("Level of Demand BO"," ",LevelOfDemandBO," ","Candle Number"," ", j, "The candle of PSL loc."," ",Location_FirstTDPoint_OnLevelDemand," ","its value:"," ",PSL_ValueBasedOnDemand_BO);
Print("Level of Supply BO"," ",LevelOfSupplyBO," ","Candle Number"," ", z, " The candle of PSL loc."," ",TheDemandTDPointSameLevelOfSupply_BO," ","its value:"," ",PSL_ValueBasedOnSupply_BO);
return (PSL_ValueBasedOnSupply_BO);
}
if(LevelOfSupplyBO == 0)
{
Print("Level of Demand BO"," ",LevelOfDemandBO," ","Candle Number"," ", j, "The candle of PSL loc."," ",Location_FirstTDPoint_OnLevelDemand," ","its value:"," ",PSL_ValueBasedOnDemand_BO);
Print("Level of Supply BO"," ",LevelOfSupplyBO," ","Candle Number"," ", z, " The candle of PSL loc."," ",TheDemandTDPointSameLevelOfSupply_BO," ","its value:"," ",PSL_ValueBasedOnSupply_BO);
return (PSL_ValueBasedOnDemand_BO);
}
return (0);
}