Add "string syb = Symbol () ;" before "Comment (..) ;"
or change :
"Comment ( "No Orders To Manage.Waiting 30 minutes for more trades to open on", "\n", Symbol () ) ;"
Add "string syb = Symbol () ;" before "Comment (..) ;"
or change :
"Comment ( "No Orders To Manage.Waiting 30 minutes for more trades to open on", "\n", Symbol () ) ;"
yes thanks but this is not the problem that causes it not to work properly tough :(
Delete invocation "start()" from "Trail()" that causes "stack overflow".
And change declaration "int tsprofit ;" to "double tsprofit ;"
And these declarftions are not used:
"double psl ;"
"double slr = 0.6 ;"
extern double threshold = 20 ; int tsticket ; int tstype ; double tsprofit ; double tsopen ; double tssl ; double tstp ; int start() { if ( OrdersTotal() != 0 ) Trail () ; else { Comment("No Orders To Manage.Waiting 30 minutes for more trades to open on","\n", Symbol () ) ; Sleep (1800000) ; } }// start() int Trail() { for (int selection=0;selection<OrdersTotal();selection++) { OrderSelect(selection,SELECT_BY_POS,MODE_TRADES); tsticket = OrderTicket () ; tstype = OrderType () ; tsprofit = OrderProfit () ; tsopen = OrderOpenPrice () ; tssl = OrderStopLoss () ; tstp = OrderTakeProfit () ; if ((tstype == OP_SELL) && (tsprofit > threshold) && (tssl > tsopen)) OrderModify(tsticket, OrderOpenPrice(), tsopen, tstp, 0, Blue); if ((tstype == OP_BUY ) && (tsprofit > threshold) && (tssl < tsopen)) OrderModify(tsticket, OrderOpenPrice(), tsopen, tstp, 0, Blue); }// for }// Trail
or
extern double tsThreshold = 20 ; int start() { if ( OrdersTotal() == 0 ) { Comment ( "No Orders To Manage.Waiting 30 minutes for more trades to open on","\n", Symbol () ) ; Sleep ( 1800000 ) ; } else Trail() ; }// start int Trail() { for (int selection = 0 ; selection < OrdersTotal() ; selection++ ) { OrderSelect ( selection, SELECT_BY_POS, MODE_TRADES ) ; double tsNewSL = OrderOpenPrice() ; if ( ( OrderType() == OP_SELL) && ( OrderProfit() > tsThreshold ) && ( OrderStopLoss() > OrderOpenPrice() ) ) OrderModify ( OrderTicket(), OrderOpenPrice(), tsNewSL, OrderTakeProfit(), 0, Blue) ; else if ( ( OrderType() == OP_BUY ) && ( OrderProfit() > tsTthreshold ) && ( OrderStopLoss() < OrderOpenPrice() ) ) OrderModify ( OrderTicket(), OrderOpenPrice(), tsNewSL, OrderTakeProfit(), 0, Blue) ; }// for }// Trail
Delete invocation "start()" from "Trail()" that causes "stack overflow". <<<===========================
And change declaration "int tsprofit ;" to "double tsprofit ;"
And these declarftions are not used:
"double psl ;"
"double slr = 0.6 ;"
or
for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. .... if (!OrderModify(...) ) Alert("OrderModify failed: ",GetLastError());

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
here is the script I wanted it to loop all the way to get max profit but it seem that I overcharged it with functions or something
says stack overflow but I don't get where it's overloaded with functions (I seen lots of eas that does use way more functions then that and ran)
thanks to anyone that could help me out :)