- Purpose of the blow strategy is to enter in the Live Candle when it is forming ( Live Bar only) and Place the trade on the Green or Red candle.
- Calculate = Calculate.OnEachTick;
- it will exit the position when next forming candle will become Red or Green.
Result :
Unfortunately, it is working only once is it activated and nothing is happening after that.
It is in Testing environment currently.
Any suggestions, Please welcome and Thanks in advance.
================================================== ================================================== ====
if( Close[0] > Open[0] ){
if(IsFirstTickOfBar == true ){
Print("Green" + Position.MarketPosition);
if(Position.MarketPosition == MarketPosition.Short){
ExitShort(1);
Print("ExitShort " + Time[0] + " Current Open-->" + Open[0] + " Current Close " + Close[0]);
}
//SetStopLoss(CalculationMode.Ticks, 1);
if(Position.MarketPosition != MarketPosition.Long){
EnterLong(1, "GREEN "+ DateTime.Now );
Print("Buy Signal " + Time[0] + " Current Open-->" + Open[0] + " Current Close " + Close[0]);
}
}
}
if( Close[0] < Open[0] ){
if(IsFirstTickOfBar == true){
Print("RED" + Position.MarketPosition);
if(Position.MarketPosition == MarketPosition.Long){
ExitLong(1);
Print("ExitLong " + Time[0] + " Current Open-->" + Open[0] + " Current Close " + Close[0]);
}
//SetStopLoss(CalculationMode.Ticks, 1);
if(Position.MarketPosition != MarketPosition.Short){
EnterShort(1, "Short " + DateTime.Now);
Print("RED Signal Entershort " + Time[0] + " Current Open-->" + Open[0] + " Current Close " + Close[0]);
}
}
}
Comment