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 } } }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?