What is the extra { for ?
int start() { {
RaptorUK:
What is the extra { for ?
Hello RaptorUK nice to see you again.
The real problem is that I try to modify a code because when execute, the original, it open 3 specific trades, but it open again, and again, and again, and I want that open only 1 trade for pair (a total of 3), and when this 3 operations will close (I use another e.a. for this), then, open this 3 trades again.
If you want to help me (again) I write below what I add to the original code
{ int total,ord,i; string symbol; total = OrdersTotal(); for(i=0;i<total;i++) { OrderSelect(i,SELECT_BY_POS); if(OrderSymbol() = Symbol())ord++; } if(ord>0) return (0); //Abort! A Position For This Pair is Already Open
And the original is here
#property copyright "Copyright © 2006, Taylor Stockwell" #property link "stockwet@yahoo.com" #property show_inputs extern string Symbol_1 = "EURUSD"; extern bool S1_Buy = true; extern double S1_Lots = 1.0; extern string Symbol_2 = "GBPUSD"; extern bool S2_Buy = true; extern double S2_Lots = 1.0; extern string Symbol_3 = "USDCHF"; extern bool S3_Buy = true; extern double S3_Lots = 1.0; extern string Symbol_4 = "USDJPY"; extern bool S4_Buy = true; extern double S4_Lots = 0; extern string Symbol_5 = "USDCAD"; extern bool S5_Buy = true; extern double S5_Lots = 0; extern string Symbol_6 = "AUDUSD"; extern bool S6_Buy = true; extern double S6_Lots = 0; extern string Symbol_7 = "EURGBP"; extern bool S7_Buy = true; extern double S7_Lots = 0; int magic=9502; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { if(S1_Lots > 0) { if(S1_Buy == 1) OrderSend(Symbol_1,OP_BUY, S1_Lots, MarketInfo(Symbol_1,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_1,OP_SELL, S1_Lots, MarketInfo(Symbol_1,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S2_Lots > 0) { if(S2_Buy == 1) OrderSend(Symbol_2,OP_BUY, S2_Lots, MarketInfo(Symbol_2,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_2,OP_SELL, S2_Lots, MarketInfo(Symbol_2,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S3_Lots > 0) { if(S1_Buy == 1) OrderSend(Symbol_3,OP_BUY, S3_Lots, MarketInfo(Symbol_3,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_3,OP_SELL, S3_Lots, MarketInfo(Symbol_3,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S4_Lots > 0) { if(S1_Buy == 1) OrderSend(Symbol_4,OP_BUY, S4_Lots, MarketInfo(Symbol_4,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_4,OP_SELL, S4_Lots, MarketInfo(Symbol_4,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S5_Lots > 0) { if(S1_Buy == 1) OrderSend(Symbol_5,OP_BUY, S5_Lots, MarketInfo(Symbol_5,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_5,OP_SELL, S5_Lots, MarketInfo(Symbol_5,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S6_Lots > 0) { if(S1_Buy == 1) OrderSend(Symbol_6,OP_BUY, S6_Lots, MarketInfo(Symbol_6,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_6,OP_SELL, S6_Lots, MarketInfo(Symbol_6,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } if(S7_Lots > 0) { if(S7_Buy == 1) OrderSend(Symbol_7,OP_BUY, S7_Lots, MarketInfo(Symbol_7,MODE_ASK), 2, NULL, NULL, "RapidFire", magic, NULL, LimeGreen); else OrderSend(Symbol_7,OP_SELL, S7_Lots, MarketInfo(Symbol_7,MODE_BID), 2, NULL, NULL, "RapidFire", magic, NULL, FireBrick); } return(0); } //+------------------------------------------------------------------+
Well... If you could help me, thank you very much, and if you coldnt thank you very much too.
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
Could someone know where have to put the end program bracket?.
Thank you very much