RE: RSI in ZeroCode ?????
  #1 (permalink)  
Old 07-28-2005, 04:43 AM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Default RE: RSI in ZeroCode ?????

For some reason I can't figure out how to input the buy and seel logics in ZeroCode I have the wma and sma figured out but here is what I want to add......


//*---------------------------------------------------------------------------------------------------------*\
// This MQL is automatically generated by FXFisherman ZeroCode v1.0.2014.30845 (www.fxfisherman.com)
//
// DISCLAIMER:
//
// FXFisherman ZeroCode is provided free of charge, and, therefore, on an "as is" basis, without warranty
// of any kind, express or implied, including without limitation the warranties that it is free of defects,
// virus free, able to operate on an uninterrupted basis, merchantable, fit for a particular purpose or
// non-infringing. In any case, the author(s) will not be responsible or liable for ANY SPECIAL, INCIDENTAL,
// CONSEQUENTIAL, INDIRECT OR ANY OTHER LOSSES caused by using of this software. USE IT AT YOUR OWN RISK.
//
//*-----------------------------------PLEASE DO NOT REMOVE THIS HEADER--------------------------------------*/

/*[[
Name := Turbo_trader-3
Author :=
Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com
Lots := 1
Stop Loss := 20
Take Profit := 20
Trailing Stop := 15
]]*/
defines: Slippage(3);
defines: ;
var: cnt(0),IsBuying(False),IsSelling(False),IsClosing( False),RealTP(0),RealSL(0);
var: rsi4_1(0),rsi4_0(0),stoc3d_1(0),stoc3d_0(0),stoc3k _1(0),stoc3k_0(0),ma1_1(0),ma1_0(0),ma2_1(0),ma2_0 (0);

// Check for invalid bars and takeprofit
If Bars<200 then Exit;

// Calculate indicators' value
rsi4_1 = iRSI(20,1);
rsi4_0 = iRSI(20,0);
stoc3d_1 = iSTO(21,6,6,MODE_SMA,MODE_SIGNAL,1);
stoc3d_0 = iSTO(21,6,6,MODE_SMA,MODE_SIGNAL,0);
stoc3k_1 = iSTO(21,6,6,MODE_SMA,MODE_MAIN,1);
stoc3k_0 = iSTO(21,6,6,MODE_SMA,MODE_MAIN,0);
ma1_1 = iMAEx(10,MODE_SMA,0,PRICE_CLOSE,1);
ma1_0 = iMAEx(10,MODE_SMA,0,PRICE_CLOSE,0);
ma2_1 = iMAEx(10,MODE_LWMA,0,PRICE_CLOSE,1);
ma2_0 = iMAEx(10,MODE_LWMA,0,PRICE_CLOSE,0);


// Check for BUY, SELL, and CLOSE signal
IsBuying = (ma1_1 <= ma2_1)
and (ma1_0 > ma2_0)
and (stoc3k_0 == stoc3k_0)
and (rsi4_1 == rsi4_1);
IsSelling = False;
IsClosing = False;

// Control open trades
for cnt=1 to TotalTrades
{
// Control only market trades not entry order
if OrderValue(cnt,VAL_TYPE)<=OP_SELL and
OrderValue(cnt,VAL_SYMBOL)=Symbol then
{

// Check for close signal for bought trade
If OrderValue(cnt,VAL_TYPE)=OP_BUY then
{

If IsSelling or IsClosing then
{
// Close bought trade
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Bid,3,Violet);
Alert("Turbo_trader-3: Closing BUY order.");
};

// Check trailing stop
If TrailingStop>0 then
{
If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(Point*TrailingStop ) then
{
If OrderValue(cnt,VAL_STOPLOSS)<(Bid-Point*TrailingStop) then
{
// Modify trailing stop
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE),
Bid-Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROFIT), Red);
};
};
};
}
else
{

// Check sold trade for close signal
If IsBuying or IsClosing then
{
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Ask,3,Violet);
Alert("Turbo_trader-3: Closing SELL order.");
};

// Control trailing stop
If TrailingStop>0 then
{
If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(Point*TrailingStop) then
{
If OrderValue(cnt,VAL_STOPLOSS)=0 or
OrderValue(cnt,VAL_STOPLOSS)>(Ask+Point*TrailingSt op) then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE),
Ask+Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROF IT),Red);
};
};
};
};
};
};


// If there is no open trade
If TotalTrades<1 then
{
// If we have enough money for 1 lot
If FreeMargin<1000 then Exit;

// Check for BUY entry signal
If IsBuying and IsSelling=False and IsClosing=False then
{
// Buy
If StopLoss>0 then
{
RealSL=Ask-StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Ask+TakeProfit*Point;
}
SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED);
Alert("Turbo_trader-3: Buying");
};

// Check for SELL entry signal
If IsSelling and IsBuying=False and IsClosing=False then
{
// Sell
If StopLoss>0 then
{
RealSL=Bid+StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Bid-TakeProfit*Point;
}
SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,R ED);
Alert("Turbo_trader-3: Selling");
};
};


//-------------- Coded by FXFisherman ZeroCode v1.0.2014.30845
Reply With Quote
  #2 (permalink)  
Old 07-28-2005, 03:04 PM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,922
Thanks: 97
Thanked 361 Times in 147 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Hey, what do you want to add Turbo? It seems that you improperly added stoch. and rsi logics.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
RSI AND Stoch
  #3 (permalink)  
Old 07-28-2005, 06:41 PM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Default RSI AND Stoch

Here is what i am trying to do

Buy when the wma pass the sma and RSi is above 50 and Stoch is above 50 then buy


Sell when the Wma passes the sma and the rsi is below 50 and the stoch is below 50 then sell
I hope this makes more sence to ya Thanks Scorpion

Thanks
Mike

Hey I ment to ask if ya would you like me to show your progran to other traders on other forums......Let me know

Thanks again
Reply With Quote
  #4 (permalink)  
Old 07-29-2005, 01:00 AM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,922
Thanks: 97
Thanked 361 Times in 147 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Check if current RSI level is above 50: RSI (x) Current > 50

For stoch. there are %K and %D lines, so which one do you prefer?
Check if current stoch. %D line is below 50: Stoc (x) %D Current < 50

I left the rest of logics for you, coz it's simple, and you need to learn how to do it by yourself. Ok, now write the logics and I'll confirm.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
Re RSI
  #5 (permalink)  
Old 07-31-2005, 12:25 AM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Default Re RSI

Thanks Here is the program re written to conferm, I got no error codes finnaly

Thanks Mike
Attached Files
File Type: mql Turbo_Trader-3.mql (5.0 KB, 15 views)
Best Forex Systems
Proven forex trading systems for auto trading.
See the real trading records yourself.
Reply With Quote
  #6 (permalink)  
Old 07-31-2005, 03:30 AM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,922
Thanks: 97
Thanked 361 Times in 147 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Hey, brilliant! You got the right logics here
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.

Last edited by scorpion : 07-31-2005 at 03:34 AM.
Reply With Quote
  #7 (permalink)  
Old 07-31-2005, 03:56 AM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Default

Thanks Scorpion

Mike
Reply With Quote
SRI CROSS Close
  #8 (permalink)  
Old 08-02-2005, 10:17 PM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Default SRI CROSS Close

Hey i have almost finished with my code and only have on problem to finish it and for some reason i don't understand the logics to close a trade when the wma amd sma cross i mean what to put in ZeroCode I have looked and can't find it in the forum

Thanks Much
Mike


My code also can you make shure I addid the pip filter correctly


//*---------------------------------------------------------------------------------------------------------*\
// This MQL is automatically generated by FXFisherman ZeroCode v1.0.2014.30845 (www.fxfisherman.com)
//
// DISCLAIMER:
//
// FXFisherman ZeroCode is provided free of charge, and, therefore, on an "as is" basis, without warranty
// of any kind, express or implied, including without limitation the warranties that it is free of defects,
// virus free, able to operate on an uninterrupted basis, merchantable, fit for a particular purpose or
// non-infringing. In any case, the author(s) will not be responsible or liable for ANY SPECIAL, INCIDENTAL,
// CONSEQUENTIAL, INDIRECT OR ANY OTHER LOSSES caused by using of this software. USE IT AT YOUR OWN RISK.
//
//*-----------------------------------PLEASE DO NOT REMOVE THIS HEADER--------------------------------------*/

/*[[
Name := Turbo_Trader1.2
Author := Mike Mckeough
Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com
Lots := 1
Stop Loss := 0
Take Profit := 499
Trailing Stop := 10
]]*/
defines: Slippage(3);
defines: ;
var: cnt(0),IsBuying(False),IsSelling(False),IsClosing( False),RealTP(0),RealSL(0);
var: rsi3_1(0),rsi3_0(0),stoc4d_1(0),stoc4d_0(0),stoc4k _1(0),stoc4k_0(0),ma1_1(0),ma1_0(0),ma6_1(0),ma6_0 (0),ma5_1(0),ma5_0(0),ma2_1(0),ma2_0(0);

// Check for invalid bars and takeprofit
If Bars<200 then Exit;

// Calculate indicators' value
rsi3_1 = iRSI(19,1);
rsi3_0 = iRSI(19,0);
stoc4d_1 = iSTO(4,2,2,MODE_SMA,MODE_SIGNAL,1);
stoc4d_0 = iSTO(4,2,2,MODE_SMA,MODE_SIGNAL,0);
stoc4k_1 = iSTO(4,2,2,MODE_SMA,MODE_MAIN,1);
stoc4k_0 = iSTO(4,2,2,MODE_SMA,MODE_MAIN,0);
ma1_1 = iMAEx(3,MODE_LWMA,0,PRICE_CLOSE,1);
ma1_0 = iMAEx(3,MODE_LWMA,0,PRICE_CLOSE,0);
ma6_1 = iMAEx(4,MODE_SMA,0,PRICE_CLOSE,1);
ma6_0 = iMAEx(4,MODE_SMA,0,PRICE_CLOSE,0);
ma5_1 = iMAEx(5,MODE_LWMA,0,PRICE_CLOSE,1);
ma5_0 = iMAEx(5,MODE_LWMA,0,PRICE_CLOSE,0);
ma2_1 = iMAEx(3,MODE_SMA,0,PRICE_CLOSE,1);
ma2_0 = iMAEx(3,MODE_SMA,0,PRICE_CLOSE,0);

// Note the bid price at crossover point
defines: FilterPips(0.0003);
var: CrossBid(0),IsBuyingBak(False),IsSellingBak(False) ;
// Check for BUY, SELL, and CLOSE signal
IsBuying = (ma1_1 <= ma2_1)
and (ma1_0 > ma2_0)
and (rsi3_0 > 60)
and (stoc4d_0 > 50);
IsSelling = (ma1_1 >= ma2_1)
and (ma1_0 < ma2_0)
and (rsi3_0 < 45)
and (stoc4d_0 < 63);
// Closing Trade On Cross On WMA SMA
IsClosing = (ma5_1 >= ma6_1)
(ma5_1 <= ma6_1)
);

// Check price filter
if (IsBuying and not IsBuyingBak) or (IsSelling and Not IsSellingBak ) then {
CrossBid = pricebid ;
}
IsBuyingBak = IsBuying;
IsSellingBak = IsSelling;
IsBuying = IsBuying and (PriceBid >= CrossBid + FilterPips);
IsSelling = IsSelling and (PriceBid <= CrossBid - FilterPips);


// Control open trades
for cnt=1 to TotalTrades
{
// Control only market trades not entry order
if OrderValue(cnt,VAL_TYPE)<=OP_SELL and
OrderValue(cnt,VAL_SYMBOL)=Symbol then
{

// Check for close signal for bought trade
If OrderValue(cnt,VAL_TYPE)=OP_BUY then
{

If IsSelling or IsClosing then
{
// Close bought trade
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Bid,3,Violet);
Alert("Turbo_Trader1.2: Closing BUY order.");
};

// Check trailing stop
If TrailingStop>0 then
{
If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(Point*TrailingStop ) then
{
If OrderValue(cnt,VAL_STOPLOSS)<(Bid-Point*TrailingStop) then
{
// Modify trailing stop
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE),
Bid-Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROFIT), Red);
};
};
};
}
else
{

// Check sold trade for close signal
If IsBuying or IsClosing then
{
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(c nt,VAL_LOTS),Ask,3,Violet);
Alert("Turbo_Trader1.2: Closing SELL order.");
};

// Control trailing stop
If TrailingStop>0 then
{
If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(Point*TrailingStop) then
{
If OrderValue(cnt,VAL_STOPLOSS)=0 or
OrderValue(cnt,VAL_STOPLOSS)>(Ask+Point*TrailingSt op) then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE),
Ask+Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROF IT),Red);
};
};
};
};
};
};


// If there is no open trade
If TotalTrades<1 then
{
// If we have enough money for 1 lot
If FreeMargin<1000 then Exit;

// Check for BUY entry signal
If IsBuying and IsSelling=False and IsClosing=False then
{
// Buy
If StopLoss>0 then
{
RealSL=Ask-StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Ask+TakeProfit*Point;
}
SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED);
Alert("Turbo_Trader1.2: Buying");
};

// Check for SELL entry signal
If IsSelling and IsBuying=False and IsClosing=False then
{
// Sell
If StopLoss>0 then
{
RealSL=Bid+StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Bid-TakeProfit*Point;
}
SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,R ED);
Alert("Turbo_Trader1.2: Selling");
};
};


//-------------- Coded by FXFisherman ZeroCode v1.0.2014.30845
Reply With Quote
Re Header
  #9 (permalink)  
Old 08-03-2005, 09:40 PM
Sophomore
 
Join Date: Jul 2005
Posts: 42
Thanks: 0
Thanked 7 Times in 2 Posts
TurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the roughTurboTrader24 is a jewel in the rough
Cool Re Header

Oh I mean't to mention that when I addid my code here I didn't copy the header Just to save room......Don't worry when I go live and give the code away I WILL have your header on it.....

Just Wanted to Let ya know....

TurboTrader
Reply With Quote
  #10 (permalink)  
Old 08-04-2005, 03:28 AM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,922
Thanks: 97
Thanked 361 Times in 147 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

IsClosing = (ma5_1 >= ma6_1)
(ma5_1 <= ma6_1)

Two MAs crosses up or down:

AND MA (1) Previous <= MA (2) Previous
AND MA (1) Current > MA (2) Current
OR MA (1) Previous >= MA (2) Previous
AND MA (1) Current < MA (2) Current

*Note: replace (1) and (2) with yours.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ZeroCode Beta 2 Status scorpion MetaTrader and ZeroCode 85 06-21-2008 04:11 PM
ZeroCode Sample: Create "10-Minute" Strategy Expert scorpion Tutorials, Tips & Tricks 16 04-13-2008 11:29 PM
ZeroCode Expert Running 3 Majors (?) Scicronys MetaTrader and ZeroCode 8 12-12-2007 08:58 AM
Closing with RSI TurboTrader24 MetaTrader and ZeroCode 1 09-07-2005 03:50 AM
Important: ZeroCode Header in Compiled MQL files scorpion MetaTrader and ZeroCode 0 06-09-2005 08:59 AM


All times are GMT. The time now is 02:37 AM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now