| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
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 |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
need help coding a simple trailing stop
hello,
I am a newbie for this. I tried to code a simple trailing stop but something is wrong. When I compile the result is : unbalenced parenthesis (at the end.) Please tell me the mistake(s) and if you are kind enough to explain : use simple words I am not a native english speaker. Thank you. Here is rhe code : ----------------------------------- int start() { int cnt, totalOrders; totalOrders = OrdersTotal(); if (totalOrders>0) // open orders identified { for (cnt=1;cnt<totalOrders;cnt++)} } |
|
||||
|
Quote:
OrderModify((OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*Point,OrderTakeProfit(),YellowGreen); It can't be more simple than that ![]() |
|
|||
|
Quote:
Thank you for your answer. Did you count my parenthesis ? I suppose you didn't. They match. The last line is the problem according to the compiler. I wrote : "at the end" I tried a lot of things about those parenthesis. When the compiler finds nothing else he states : "unbalanced parenthesis..." at the last caracter !! where nothing is written. If someone has an idea please help. |
|
||||
|
Quote:
look OrderModify((OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*Point,OrderTakeProfit(),YellowGreen); U have 2 (( after OrderModify and only 1 to close it ); U have 2 lines like that I know that the compiler gives u a wrong line where the error lies, but this is how compilers work, and here is not the place to discuss why |
|
|||
|
Counting parenthesis
Quote:
Can you go over how you count parentheis.. Thanks |
|
|||
|
Counting parenthesis
I find it best to do it this way:
Start with one for the first left paren, then add one for each left paren and subtract one for each right paren. If they are balenced you should end with zero. OrderModify((OrderTicket(),OrderOpenPrice(),...,or derTakeProfit(),...)) count: ......1 2............ 3 2.................. 3 2...................... 3 2.. 1 0 DS |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ATR Trailing Stop - Help | Boiseboy | Indicators - Metatrader 4 | 53 | 07-26-2008 03:57 AM |
| Can someone add a simple Trailing Stop to this EA? | fibofan | Expert Advisors - Metatrader 4 | 7 | 05-21-2007 10:08 PM |