Forex



Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems






Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 10-04-2008, 07:27 PM
DREWP's Avatar
Member
 
Join Date: Oct 2008
Location: Gatlinburg TN, Mary Esther FL.
Posts: 97
DREWP is on a distinguished road
robp,
There are choppy areas, this system is far from perfect, but to avoid this, I typically only trade when two markets are active, Sydney and Tokyo. If my indicators are not providing "clean" entry points I switch to a higher timeframe. I stick mainly to EUR/YEN, USD/YEN, and GBP/YEN. Any given trade is between 2% and 5%, depending on market conditions.

fxbs,
Thanks for your interest! I will be testing out your modification.

-DREWP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #12 (permalink)  
Old 10-04-2008, 10:07 PM
Senior Member
 
Join Date: May 2006
Posts: 768
robp is on a distinguished road
Maybe an MTF version of the channels would help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #13 (permalink)  
Old 10-04-2008, 10:11 PM
Senior Member
 
Join Date: May 2006
Posts: 768
robp is on a distinguished road
I'm missing something. I don't see any difference in the original code to this mod fxbs is suggesting.

If someone mods the adx cross indi, please post it. Thank you.

Quote:
Originally Posted by fxbs View Post
change adx cross
this one- ADXcrosses.mq4 (3.4 KB,- cheating(repaints),future bar
b4plusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i - 1);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #14 (permalink)  
Old 10-05-2008, 02:04 PM
Junior Member
 
Join Date: Sep 2008
Posts: 9
void is on a distinguished road
Quote:
Originally Posted by robp View Post
I'm missing something. I don't see any difference in the original code to this mod fxbs is suggesting.

If someone mods the adx cross indi, please post it. Thank you.
i think this will work, the signal of this new indicator comes one bar later than the old one
Code:
        b4plusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i + 1);
        nowplusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i);
        b4minusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i + 1);
        nowminusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i);  
        //----
        if(b4plusdi < b4minusdi && nowplusdi > nowminusdi)
            ExtMapBuffer1[i] = Low[i] - nShift*Point;
        //----
        if(b4plusdi > b4minusdi && nowplusdi < nowminusdi)
            ExtMapBuffer2[i] = High[i] + nShift*Point;
Attached Files
File Type: mq4 ADXcrosses.mq4 (3.4 KB, 269 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #15 (permalink)  
Old 10-05-2008, 03:10 PM
DREWP's Avatar
Member
 
Join Date: Oct 2008
Location: Gatlinburg TN, Mary Esther FL.
Posts: 97
DREWP is on a distinguished road
This is the original:

ea.gif

This is the mod:

eamod.gif

void,
When the market opens, I will be trying this modification. Thanks.
-DREWP

Last edited by Linuxser; 10-12-2008 at 08:01 PM. Reason: Pictures uploaded to forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #16 (permalink)  
Old 10-05-2008, 05:39 PM
DREWP's Avatar
Member
 
Join Date: Oct 2008
Location: Gatlinburg TN, Mary Esther FL.
Posts: 97
DREWP is on a distinguished road
I'm trying to figure out a bit of code to determine whether or not the ssl channels are crossed and the red is over the green or vise versa

Here is the code for the ssl channels:

Code:
//+------------------------------------------------------------------+
//|                                            SSL channel chart.mq4 |
//|                                                           mladen |
//|                                                                  |
//| initial SSL for metatrader developed by Kalenzo                  |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "mladenfx@gmail.com"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_width1 2
#property indicator_width2 2
//----
extern int  Lb           =10;
extern bool alertsOn     =false;
extern bool alertsMessage=true;
extern bool alertsSound  =false;
extern bool alertsEmail  =false;
//----
double ssld[];
double sslu[];  
double Hlv[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(3);
   SetIndexBuffer(0,ssld); SetIndexDrawBegin(0,Lb+1);
   SetIndexBuffer(1,sslu); SetIndexDrawBegin(0,Lb+1);
   SetIndexBuffer(2,Hlv);
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int counted_bars=IndicatorCounted();
   int i,limit;
//----
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(i=limit;i>=0;i--)
     {
      Hlv[i]=Hlv[i+1];
      if(Close[i]>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv[i]= 1;
      if(Close[i]<iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1))  Hlv[i]=-1;
      if(Hlv[i]==-1)
        {
         ssld[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
         sslu[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
        }
      else
        {
         ssld[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
         sslu[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
        }
     }
//----
   if (alertsOn)
      if (Hlv[0]!=Hlv[1])
         if (Hlv[0]==1)
            doAlert("up");
         else  doAlert("down");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void doAlert(string doWhat)
  {
   static string   previousAlert="nothing";
   static datetime previousTime;
   string message;
//----
     if (previousAlert!=doWhat || previousTime!=Time[0]) 
     {
      previousAlert =doWhat;
      previousTime  =Time[0];
//----
      message= StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," SSL trend changed to ",doWhat);
      if (alertsMessage) Alert(message);
      if (alertsEmail)   SendMail(StringConcatenate(Symbol(),"SSL "),message);
      if (alertsSound)   PlaySound("alert2.wav");
     }
  }
//+------------------------------------------------------------------+
Can I use something like the following code for sslu and ssld?

Code:
int Crossed (double line1 , double line2)
  {
    static int last_direction = 0;
    static int current_direction = 0;
    //Don't work in the first load, wait for the first cross!
    static bool first_time = true;
    if(first_time == true)
      {
        first_time = false;
        return (0);
      }
//----
    if(line1 > line2)
        current_direction = 1;  //up
    if(line1 < line2)
        current_direction = 2;  //down
//----
    if(current_direction != last_direction)  //changed 
      {
        last_direction = current_direction;
        return(last_direction);
      }
    else
      {
        return (0);  //not changed
      }
  }
Obviously, i'm looking for a way to generate an OP_BUY or OP_SELL condition given that an ADX arrow is indicated and the corresponding ssl cross happens before the 3rd bar from the ADX arrow is printed or a ssl cross occurs and the corresponding ADX arrow is indicated before the 3rd bar from the ssl cross occurs.

Here is the code for the ADXcrosses:

Code:
//+------------------------------------------------------------------+
//|                                                   ADXcrosses.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int ADXcrossesPeriod = 14;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//----
double b4plusdi, b4minusdi, nowplusdi, nowminusdi;
int    nShift;   
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    SetIndexStyle(0, DRAW_ARROW, 0, 1);
    SetIndexArrow(0, 233);
    SetIndexBuffer(0, ExtMapBuffer1);
//----
    SetIndexStyle(1, DRAW_ARROW, 0, 1);
    SetIndexArrow(1, 234);
    SetIndexBuffer(1, ExtMapBuffer2);
//---- name for DataWindow and indicator subwindow label
    IndicatorShortName("ADXcrosses(" + ADXcrossesPeriod + ")");
    SetIndexLabel(0, "ADXcrUp");
    SetIndexLabel(1, "ADXcrDn"); 
//----
    switch(Period())
      {
        case     1: nShift = 1;   break;    
        case     5: nShift = 3;   break; 
        case    15: nShift = 5;   break; 
        case    30: nShift = 10;  break; 
        case    60: nShift = 15;  break; 
        case   240: nShift = 20;  break; 
        case  1440: nShift = 80;  break; 
        case 10080: nShift = 100; break; 
        case 43200: nShift = 200; break;               
      }
//----
    return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
    return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int limit;
    int counted_bars = IndicatorCounted();
//---- check for possible errors
    if(counted_bars < 0) 
        return(-1);
//---- last counted bar will be recounted
    if(counted_bars > 0) 
        counted_bars--;
    limit = Bars - counted_bars;
//----
    for(int i = 0; i < limit; i++)
      {
        b4plusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i - 1);
        nowplusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i);
        b4minusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i - 1);
        nowminusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i);  
        //----
        if(b4plusdi > b4minusdi && nowplusdi < nowminusdi)
            ExtMapBuffer1[i] = Low[i] - nShift*Point;
        //----
        if(b4plusdi < b4minusdi && nowplusdi > nowminusdi)
            ExtMapBuffer2[i] = High[i] + nShift*Point;
      }
//----
    return(0);
  }
//+------------------------------------------------------------------+
In order to use these indicators in an EA I would have to embed them as a function since i can't call the necessary variables through iCustom, correct?

Thanks for bearing with me and humoring my limited knowledge of MQL4.
-DREWP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #17 (permalink)  
Old 10-05-2008, 10:25 PM
Member
 
Join Date: Sep 2008
Posts: 65
codobro is on a distinguished road
DREWP, are you trading these indicators as soon as they give a signal? SSL-channel-alert will give you an alert, enable alertOn==true for a text message. This occurs in realtime though, so it may change back before the close.

I have not tried the original ADXcross because as was noted, it repaints. void gave a nonrepaint edit, which in realtime will give different signals. If you are using the original repainting ADX with the SSL channel taking a trade as soon as both signal, there are probably signals you cannot backtest.

After these points, why can't you call both indicators through iCustom? You should be able to, each is using a buffer value. (ADXcrUp = buffer1).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #18 (permalink)  
Old 10-05-2008, 11:06 PM
DREWP's Avatar
Member
 
Join Date: Oct 2008
Location: Gatlinburg TN, Mary Esther FL.
Posts: 97
DREWP is on a distinguished road
codobro,
In the current iteration of this system I wait for the ssl channels to cross after the 3rd bar from the ADX indicator is printed or I wait for the ADX to indicate after the 3rd bar from the ssl cross is indicated. If it is not a "solid" cross, i.e. it opens and crosses, I typically wait for the next bar to open.

About the repainting issue, in back testing, I had imagined code that "looks back" for the indicators. I don't know practical or feasible this is.

I'm having a hard time finding information on calling a specific buffer with iCustom. I'm sure more research will reveal this to me.

Thanks for the brain food

-DREWP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #19 (permalink)  
Old 10-05-2008, 11:09 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 3,354
ElectricSavant is on a distinguished road
Ok I am in and tell me what you want me to test when you get the EA finished folks! (Majors or Crosses does not matter to me) I will test any pair and TF
(M1-H4) to exhaust some possibilities...

ES

Last edited by ElectricSavant; 10-05-2008 at 11:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #20 (permalink)  
Old 10-05-2008, 11:28 PM
Member
 
Join Date: Sep 2008
Posts: 65
codobro is on a distinguished road
For repainting the code does not "look back", rather, it would "look foward" which you don't want this indicator to do. This means in realtime you'll get more signals with less accuracy, because the ADX will always be comparing itself to the 0 values in the future.

You wait for a cross from one of them, then wait for a cross from the other within the close of the next 3 bars, then enter? Try letting your charts run, then refresh them and see how many entries disappear. SSL Channel will remain the same, but your original ADX crosses will probably show a lot of changes.

As for iCustom I mentioned this on another post, and FerruFx provided a more clear explaination

use this syntax:

adxcrossup[i] = iCustom(NULL,0,"ADXcrosses",0,i);
adxcrossdown[i] = iCustom(NULL,0,"ADXcrosses",1,i);

This will call the first 2 buffers of the indicator you name in "". Do the same with SSL Channel. It is case sensitive!



Just a thought if someone reads and wants to test this, could FFT be applied to repainting indicators to provide some sort of future projection to draw possible future bars?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
ADXcrosses.mq4, alaskanpipassasin, AlaskanPipAssassin, AlaskanPipAssassin ea, AlaskanPipAssassinMod, benkyalate, Bluewhale, digirsi, drewp, EAS Signals, EAS Signals v0.04b, EAS VST, eastandard.net, fxprime, Jurik Volty, ssl bar, SSL Channel, SSL Channels, system, trading, vasily, Vasily Pip Sniper, wilders dmi

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BB-TSI Trading system newdigital Indicators - Metatrader 3 2 09-01-2009 08:43 AM
Day Trading system WAW Suggestions for Trading Systems 2 12-28-2007 05:41 AM
How do I detect mini or standard account in EA? fxtrader625 Metatrader 4 2 06-23-2007 11:08 AM
Where to get a list of all Standard constants (MQL) ? budhax Metatrader 4 1 05-04-2007 07:10 AM
Need Standard MACD Indicator znny Indicators - Metatrader 4 14 10-18-2006 03:51 AM


All times are GMT. The time now is 02:39 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.