Código: Seleccionar todo
protected override void OnBarUpdate()
{/// SetRanges///
/// Calculate the Asian Sesion Range...
if (ToTime(Time[0]) == ToTime(8, 0, 0))
{
Variable0 = MAX(High, 5)[0];
Variable1 = MIN(Low, 5)[0];
DrawLine("Bull" + CurrentBar, 4, MAX(High, 5)[0], 0, Variable0, Color.Green);
DrawLine("Bear" +CurrentBar,4,MIN(Low, 5)[0],0, Variable1,Color.Red);
}
/// EnterLong ...
if (GetCurrentAsk() + 2 * TickSize >= Variable0
&& ToTime(Time[0])> ToTime(8,0,0)
&& ToTime(Time[0])<= ToTime(10,0,0)
&& MACD(12, 26, 9)[0] > MACD(12, 26, 9).Avg[0] )
{
EnterLong (InitialLot,"InitialBuy");
DrawText("Buy" + CurrentBar, "", 0, Low[0] - 10 * TickSize, Color.Green);
}
/// EnterShort ...
if (GetCurrentBid() -2 * TickSize <= Variable1
&& ToTime(Time[0])> ToTime(8,0,0)
&& ToTime(Time[0])<= ToTime(10,0,0)
&& MACD(12, 26, 9)[0] < MACD(12, 26, 9).Avg[0])
{
EnterShort (InitialLot,"InitialSell");
DrawText("My text" + CurrentBar, "Sell", 0, High[0] + 10 * TickSize, Color.Red);
}
}