Author: Mohammad Soubra
The Commodity Channel Index, or CCI, is a fantastic tool for traders in the financial markets, including forex. Keep in mind that the example shared here is primarily for coding purposes and not meant to serve as a profitable trading system.
Here’s how the CCI can be utilized to open buy and sell orders based on the typical price:
double CCI_Typical_Curr=iCCI(NULL,0,CCIPeriod,PRICE_TYPICAL,0); double CCI_Typical_Prev=iCCI(NULL,0,CCIPeriod,PRICE_TYPICAL,1); // Buy order rule if((CCI_Typical_Prev<-90) && CCI_Typical_Curr>-80) // Sell order rule if((CCI_Typical_Prev>90) && (CCI_Typical_Curr<80))
With these rules, you can pinpoint some excellent entry points, as demonstrated below:
input string separator1="--------------- TRADES OPTIONS ---------------";//TRADING INPUTS input int TradesDuplicator=3;//How many times to duplicate trades input double Lots=0.03;//Standard Lot Size input int MagicNumber=1982;//ID for trades input double StopLoss=50;//Set Stop Loss input double TakeProfit=200;//Set Take Profit input int TrailingStop=50;//Trailing Stop input int Slippage=3; input string separator2="--------------- CCI OPTIONS ---------------";//CCI SETTINGS input int CCIPeriod=9;//CCI Calculation Period input string separator3="--------------- ON CHART COLORS ---------------";//TRADE ARROW COLORS input color BuyArrowOpen=clrBlue;//Color for Buy Arrows input color SellArrowOpen=clrRed;//Color for Sell Arrows input color ModificationArrow=clrWhite;//Color for Modified Trades


Important Notes:
- This code is intended as a demonstration for our community library and should not be used for live trading.
- Feel free to tweak or modify the code as you see fit, whether it's you, me, or another coder!
- Happy Trading!
Comments 0