Jerommeke007 / Profile
Jerommeke007
Added topic Buy/Sell after first hour of trading
Hi All, Im rather new here and I want to create a simple system where I look at the high and low of the first 1 hour candle at a start time (in this case 9.00). If after this first 1 hour the rate goes above the high, than sell. If it goes
Jerommeke007
Added topic Buy/Sell after first 1 hour of trading
Hi All, Im rather new here and I want to create a simple system where I look at the high and low of the first 1 hour candle at a start time (in this case 9.00). If after this first 1 hour the rate goes above the high, than sell. If it goes
:
{ // Determine a hora de abertura do mercado datetime market_open = (TimeCurrent() / 86400) * 86400 + 3600; // Arredonda para o início do dia e adiciona 1 hora // Determine o preço máximo e mínimo na primeira hora de negociação do dia double max_price = 0.0; double min_price = 0.0; int hour = Hour(market_open); for(int i=0; i max_price || max_price == 0.0) max_price = high[i]; if(low[i] < min_price || min_price == 0.0) min_price = low[i]; } // Desenhe as linhas horizontais na tela ObjectCreate("MaxPriceLine", OBJ_HLINE, 0, 0, max_price); ObjectSet("MaxPriceLine", OBJPROP_COLOR, Lime); ObjectSet("MaxPriceLine", OBJPROP_STYLE, STYLE_SOLID); ObjectCreate("MinPriceLine", OBJ_HLINE, 0, 0, min_price); ObjectSet("MinPriceLine", OBJPROP_COLOR, Red); ObjectSet("MinPriceLine", OBJPROP_STYLE, STYLE_SOLID);
}