Orders Execution
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
Profitability Reports
GBP/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
NZD/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
CCI ver2.1
extern int shortcciperiod;
extern int longcciperiod;
extern int shortmaperiod;
extern int longmaperiod;
extern int stoploss;
extern int takeprofit;
bool notrades;
int tradeconditions;
int trend;
int magicnumber=1234;
int init() {
tradeconditions = 1;
double shortcci=iCCI(Symbol(),0,shortcciperiod,PRICE_OPEN,0);
double longcci=iCCI(Symbol(),0,longcciperiod,PRICE_OPEN,0);
if (shortcci > 0 && longcci > 0) trend=1;
if (shortcci < 0 && longcci < 0) trend=-1;
int allexpertorders=0;
for (int alltheorders=OrdersTotal(); alltheorders > 0; alltheorders--) {
OrderSelect(alltheorders,SELECT_BY_POS,MODE_TRADES);
if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicnumber) allexpertorders++;
}
return(0);
}
int start() {
RefreshRates();
double shortcci=iCCI(Symbol(),0,shortcciperiod,PRICE_OPEN,0);
double longcci=iCCI(Symbol(),0,longcciperiod,PRICE_OPEN,0);
double shortema=iMA(Symbol(),0,shortmaperiod,0,MODE_EMA,PRICE_OPEN,0);
double longema=iMA(Symbol(),0,longmaperiod,0,MODE_EMA,PRICE_OPEN,0);
double emavalue=shortema-longema;
if (tradeconditions == 0) tradeconditions++;
if (tradeconditions > 0) {
if (shortcci > 0 && longcci > 0 && emavalue > 0) {
OrderSend(Symbol(),OP_BUY,1,Ask,1,Ask-stoploss*Point,Ask+takeprofit*Point,NULL,magicnumber,0,Blue);
tradeconditions=-1;
trend=1;
Alert(trend);
}
if (shortcci < 0 && longcci < 0 && emavalue < 0) {
OrderSend(Symbol(),OP_SELL,1,Bid,1,Bid+stoploss*Point,Bid-takeprofit*Point,NULL,magicnumber,0,Red);
tradeconditions=-1;
trend=-1;
Alert(trend);
}
}
if (tradeconditions < 0) {
if (trend > 0) {
if (shortcci < 0 && longcci < 0) {
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
OrderClose(OrderTicket(),1,Bid,1,Blue);
tradeconditions=1;
}
}
if (trend < 0) {
if (shortcci > 0 && longcci > 0) {
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
OrderClose(OrderTicket(),1,Ask,1,Red);
tradeconditions=1;
}
}
}
}
int deinit() {
return(0);
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---