i have problem with fxfisherman output
  #1 (permalink)  
Old 08-25-2005, 01:58 PM
Freshman
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mssarath is on a distinguished road
Default i have problem with fxfisherman output

Hi,
I just tested this with a simple code.
using 21 ema
if price close above 21 ema buy
if price close below 21 ema sell.

indicator setup section
MA(1) /* 21 period ema to close*/

logic section

buy logic
AND close>MA(1)


Sell logic

AND close< MA(1)

hope things are right. i got out put , i am pasting it at the end of the post. the error i am getting while compiling is - variable MA not defined.

code



//*---------------------------------------------------------------------------------------------------------*\
// 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 := sarath'stest
Author := sarath
Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com
Lots := 1
Stop Loss := 25
Take Profit := 100
Trailing Stop := 25
]]*/
defines: Slippage(3);
defines: ;
var: cnt(0),IsBuying(False),IsSelling(False),IsClosing( False),RealTP(0),RealSL(0);
var: ma1_1(0),ma1_0(0);

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

// Calculate indicators' value
ma1_1 = iMAEx(21,MODE_EMA,0,PRICE_CLOSE,1);
ma1_0 = iMAEx(21,MODE_EMA,0,PRICE_CLOSE,0);


// Check for BUY, SELL, and CLOSE signal
IsBuying = (close > MA(1));
IsSelling = (close < MA(1));
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("sarath'stest: 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("sarath'stest: 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("sarath'stest: 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("sarath'stest: Selling");
};
};


//-------------- Coded by FXFisherman ZeroCode v1.0.2014.30845
Reply With Quote
  #2 (permalink)  
Old 08-25-2005, 02:00 PM
Freshman
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mssarath is on a distinguished road
Default

i am thankful for this great product
Reply With Quote
  #3 (permalink)  
Old 08-25-2005, 02:36 PM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,992
Thanks: 125
Thanked 383 Times in 152 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

Thanks for kind words.

Have you watched the Video Walkthrough: Create a simple MACD Cross expert yet? You should watch it to get started.

Btw, your problem is because you write MA (1) in logic boxs. You should right-click the box, then you'll see the indicator.
__________________
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
Problem getting the zero code to verify rosstodd MetaTrader and ZeroCode 4 06-10-2005 11:49 PM


All times are GMT. The time now is 01:36 PM.
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