Register
Welcome to Forex-TSD! , one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more
12-06-2006, 04:28 AM
Senior Member
Join Date: Sep 2006
Location: San Diego
Posts: 138
Here it is with the Wrap Code ...
Check for Open
PHP Code:
void CheckForOpen () {
if ( UseStoch ){
double STOCHOSCMAIN = iCustom ( NULL , STOCHTIME , "Zerolagstochs" , 0 , SIGNALCANDLE );
double STOCHOSCSIGNAL = iCustom ( NULL , STOCHTIME , "Zerolagstochs" , 1 , SIGNALCANDLE );
double pSTOCHOSCMAIN = iCustom ( NULL , STOCHTIME , "Zerolagstochs" , 0 , SIGNALCANDLE + 1 );
double pSTOCHOSCSIGNAL = iCustom ( NULL , STOCHTIME , "Zerolagstochs" , 1 , SIGNALCANDLE + 1 );
if ( STOCHOSCMAIN >= STOCHOSCSIGNAL && pSTOCHOSCMAIN > pSTOCHOSCSIGNAL && STOCHOSCSIGNAL < 50 ){
EnterOpenBuy ();
}
if ( STOCHOSCMAIN <= STOCHOSCSIGNAL && pSTOCHOSCMAIN < pSTOCHOSCSIGNAL && STOCHOSCSIGNAL > 50 ){
EnterOpenSell ();
}
}
if ( UseCCI ){
double CCI = iCCI ( NULL , 0 , CciPer , PRICE_MEDIAN , SIGNALCANDLE );
double CCIPrevious = iCCI ( NULL , 0 , CciPer , PRICE_MEDIAN , SIGNALCANDLE + 1 );
if ( CCI > Cci_Level1 && CCIPrevious <= Cci_Level1 ){
EnterOpenBuy ();
}
if ( CCI > Cci_Level2 && CCIPrevious <= Cci_Level2 ){
EnterOpenBuy ();
}
if ( CCI > Cci_Level3 && CCIPrevious <= Cci_Level3 ){
EnterOpenBuy ();
}
if ( CCI < Cci_Level1 && CCIPrevious >= (- Cci_Level1 )){
EnterOpenSell ();
}
if ( CCI < Cci_Level2 && CCIPrevious >= (- Cci_Level2 )){
EnterOpenSell ();
}
if ( CCI < Cci_Level3 && CCIPrevious >= (- Cci_Level3 )){
EnterOpenSell ();
}
}
}
And Enter Open
PHP Code:
void EnterOpenBuy (){
GetTrend ();
double LongLots = (( AccountFreeMargin ()* AccountLeverage ()* UpTrend / MarketInfo ( Symbol (), MODE_LOTSIZE )) * ( RiskPercent / 100.0 ))/ MaxOrders ;
if ( LongLots < 0.1 ) { LongLots = 0.1 ;}
OrderSend ( Symbol (), OP_BUY , LongLots , Ask , OrderSlippage , Bid - StopLoss * Point , Ask + TakeProfit * Point , "Open Buy" , Magic , 0 , Green );
Print ( "OPEN BUY : " , OrderLots ());
return ( 0 );
}
void EnterOpenSell (){
GetTrend ();
double ShortLots = (( AccountFreeMargin ()* AccountLeverage ()* DownTrend / MarketInfo ( Symbol (), MODE_LOTSIZE )) * ( RiskPercent / 100.0 ))/ MaxOrders ;
if ( ShortLots < 0.1 ) { ShortLots = 0.1 ;}
OrderSend ( Symbol (), OP_SELL , ShortLots , Bid , OrderSlippage , Ask + StopLoss * Point , Bid - TakeProfit * Point , "Open Sell" , Magic , 0 , Red );
Print ( "OPEN SELL : " , OrderLots ());
return ( 0 );
}
And Manage Orders ...
PHP Code:
void ManageOrders (){
for ( cnt = OrdersTotal (); cnt >= 0 ; cnt --) {
OrderSelect ( cnt , SELECT_BY_POS , MODE_TRADES );
if ( OrderSymbol () == Symbol () && OrderMagicNumber () == Magic ) {
if ( OrderType () == OP_BUY ) {
if ( Bid <= SL || Bid >= TP || Bid > QUICKUPPER3 ) {
CloseOrders ();
}
else if ( OrdersTotal () < MaxOrders && Ask >= TP - (( TakeProfit + Pips ) * Point )) {
EnterOpenBuy ();
}
}
else if ( OrderType () == OP_SELL ) {
if ( Ask >= SL || Ask <= TP || Ask < QUICKLOWER3 ) {
CloseOrders ();
}
else if ( OrdersTotal () < MaxOrders && Bid <= TP + (( TakeProfit + Pips ) * Point )) {
EnterOpenSell ();
}
}
}
}
return ( 0 );
}
Hopefully this helps...
Thanks.
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 09:28 PM .