Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information
I'm up against the same thing... but instead of having a line (more clutter) i'd like to ahve a candle colored... again it needs to be user input so we can show the opens of various markets... as an example.
Coding an EA at the moment to autotrade for me, it's getting towards completion but i can't figure out how to move the stoploss on an open trade. i am posting my code here, if anyone could point out what i'm doing wrong i would greatly appreciate
This is the part of code which opens a LONG position:
PHP Code:
{
if(//long entry criteria met)
{
if (priorbartime == Time[0])
return(0);
priorbartime = Time[0];
Alert("Long Signal");
ObjectCreate(arrowlong, OBJ_ARROW, 0, Time[0], Open[0], 0, 0, 0, 0);
ObjectSet(arrowlong, OBJPROP_ARROWCODE, 233);
ObjectSet(arrowlong, OBJPROP_COLOR, Aqua);
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"am crossing",16677,0,Green); // HDB CHANGED Close TO Ask and SlipPage to 0
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
}
then once the trade is open I want to manage it by moving stop to -5 when the trade is +15, and by moving stop to b/e when trade is +20. this is the code i have come up with so far but it doesnt seem to be working:
thanks newdigital, i'ev looked round many threads at SBFX, metaquotes and here but managed to not find what i was looking for, hopefully these will help!