I want to open orders in multiple charts in a giving condition.
example in EURUSD chart ,when price above MA10 and MA15 and no orderstotal , open buy orders.
after sometime later , in USDCHF chart ,same signal occurs ,need to open next order .
Here problem is how can code orders total counts to open next orders.
if one or more open orders present ,open next order in condition is complicated.
will open so many orders frequently.
give me some examples.
thanks
let me phrase your question into my understanding. You want to create an EA that can open position more than one currencies but you don't want it to open more than numbers of orderstotal. is this right?
let me phrase your question into my understanding. You want to create an EA that can open position more than one currencies but you don't want it to open more than numbers of orderstotal. is this right?
ok check photo here
When MA cross down, EU open order
and also on another chart ,MA is cross but not open orders
because of OrdersTotal()==0 function
I want to open orders whenever MA cross in many different charts but first trde condition must be OrdersTogtal()==0 ,
if OrdersTotal()>= 0, will open many orders at same price because of not control orders.
How can solve it.
let me phrase your question into my understanding. You want to create an EA that can open position more than one currencies but you don't want it to open more than numbers of orderstotal. is this right?
codes and results
double FastMovingAverageS1 = iMA(symbol1,0 ,period1,0,MODE_EMA,PRICE_CLOSE,0); double LastFastMovingAverageS1 = iMA(symbol1,0 ,period1,0,MODE_EMA,PRICE_CLOSE,1); double SlowMovingAverageS1 = iMA(symbol1,0 ,period2,0,MODE_EMA,PRICE_CLOSE,0);//current bar double LastSlowMovingAverageS1 = iMA(symbol1,0 ,period2,0,MODE_EMA,PRICE_CLOSE,1);//previous bar double FastMovingAverageS2 = iMA(symbol2,0 ,period1,0,MODE_EMA,PRICE_CLOSE,0); double LastFastMovingAverageS2 = iMA(symbol2,0 ,period1,0,MODE_EMA,PRICE_CLOSE,1); double SlowMovingAverageS2 = iMA(symbol2,0 ,period2,0,MODE_EMA,PRICE_CLOSE,0);//current bar double LastSlowMovingAverageS2 = iMA(symbol2,0 ,period2,0,MODE_EMA,PRICE_CLOSE,1);//previous bar double FastMovingAverageS3 = iMA(symbol3,0 ,period1,0,MODE_EMA,PRICE_CLOSE,0); double LastFastMovingAverageS3 = iMA(symbol3,0 ,period1,0,MODE_EMA,PRICE_CLOSE,1); double SlowMovingAverageS3 = iMA(symbol3,0 ,period2,0,MODE_EMA,PRICE_CLOSE,0);//current bar double LastSlowMovingAverageS3 = iMA(symbol3,0 ,period2,0,MODE_EMA,PRICE_CLOSE,1);//previous bar if ( OrdersTotal() == 0 || CountOrdersThisPairMainBUY()>0 ||CountOrdersThisPairMainSELL()>0 ) { if ((LastFastMovingAverageS1<LastSlowMovingAverageS1)&& (FastMovingAverageS1>SlowMovingAverageS1) ) //2 - trade condition = 100 /40 { OrderSend (symbol1,OP_BUY ,lot , Ask, 3,0,0,"Main Buy",MAGIC,0,Green); // 3 -open order } if ((LastFastMovingAverageS1>LastSlowMovingAverageS1)&& (FastMovingAverageS1<SlowMovingAverageS1) ) { OrderSend (symbol1,OP_SELL ,lot, Bid, 3,0,0,"Main Sell",MAGIC,0,Red); } if ((LastFastMovingAverageS2<LastSlowMovingAverageS2)&& (FastMovingAverageS2>SlowMovingAverageS2) ) //2 - trade condition = 100 /40 { OrderSend (symbol2,OP_BUY ,lot , Ask, 3,0,0,"Main Buy",MAGIC,0,Green); // 3 -open order } if ((LastFastMovingAverageS2>LastSlowMovingAverageS2)&& (FastMovingAverageS2<SlowMovingAverageS2) ) { OrderSend (symbol2,OP_SELL ,lot, Bid, 3,0,0,"Main Sell",MAGIC,0,Red); } if ((LastFastMovingAverageS3<LastSlowMovingAverageS3)&& (FastMovingAverageS3>SlowMovingAverageS3) ) //2 - trade condition = 100 /40 { OrderSend (symbol3,OP_BUY ,lot , Ask, 3,0,0,"Main Buy",MAGIC,0,Green); // 3 -open order } if ((LastFastMovingAverageS3>LastSlowMovingAverageS3)&& (FastMovingAverageS3<SlowMovingAverageS3) ) { OrderSend (symbol3,OP_SELL ,lot, Bid, 3,0,0,"Main Sell",MAGIC,0,Red); } }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to open orders in multiple charts in a giving condition.
example in EURUSD chart ,when price above MA10 and MA15 and no orderstotal , open buy orders.
after sometime later , in USDCHF chart ,same signal occurs ,need to open next order .
Here problem is how can code orders total counts to open next orders.
if one or more open orders present ,open next order in condition is complicated.
will open so many orders frequently.
give me some examples.
thanks