how to modify trade wit ctrade ?
Stefano Cerbioni:
Hi guys I’m trying to modify a trade with ctrade, but I get this error:
I’m calling the function like this – do you think it’s correct?
Are you selecting the position first with PositionSelectByTicket() ? Your function should start something like this:
void TrailingStop(){ for (int i = PositionsTotal()-1; i >= 0; i--){ // Loop through all open positions ulong posTicket = PositionGetTicket(i); // Get the current position's ticket in the loop if(PositionSelectByTicket(posTicket)){ // Select position ticket // Now you can use CTrade and modify stuff in here } } }
Hi guys I’m trying to modify a trade with ctrade, but I get this error:
I’m calling the function like this – do you think it’s correct?