Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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
 
LinkBack (1) Thread Tools Display Modes
  #601 (permalink)  
Old 01-02-2008, 07:38 AM
Junior Member
 
Join Date: Nov 2005
Posts: 22
waleed9091 is on a distinguished road
sell,buy,sell,buy.....

hi..
i want to add a code to my expert that let expert close sell or buy position when certaine pips reached"say 50 pips"... then look only for opposite position of first closed position " if first closed position was sell, look for buy to close"...third position closed will be opposite for 2nd closed position....
report of account will be :
sell
buy
sell
buy
sll
buy

is this possible to be coded?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #602 (permalink)  
Old 01-04-2008, 06:31 AM
Senior Member
 
Join Date: Sep 2006
Posts: 120
Dr.GM is on a distinguished road
use "comment(all you variables,v2,v3,v4...)" to preview all variables you have in the expert
and run a visual test ... and keep your eye in the upper left corner specially when long signal is expected
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #603 (permalink)  
Old 01-08-2008, 08:38 AM
MrM MrM is offline
Member
 
Join Date: Jul 2007
Posts: 71
MrM is on a distinguished road
Two indicators: from two in 1 window to 2 in 2 windows with different values...

Imagine you put two seperate (custom) indicators in the same seperate chart window on a chart in your terminal. They seem to correspond, cross over or whatever: they do have approximately the same values if you look at the graph, but when you place those two custom indicators in two other seperate chart windows, they turn out to have different values.

This looks like a pretty common problem to me, but I haven't found the answer on making those two indicators range between the same set of numbers (more or less) without changing the shape of the indicator. Please help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #604 (permalink)  
Old 01-09-2008, 01:10 AM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 2,753
Blog Entries: 30
Linuxser has disabled reputation
Quote:
Originally Posted by MrM View Post
Imagine you put two seperate (custom) indicators in the same seperate chart window on a chart in your terminal. They seem to correspond, cross over or whatever: they do have approximately the same values if you look at the graph, but when you place those two custom indicators in two other seperate chart windows, they turn out to have different values.

This looks like a pretty common problem to me, but I haven't found the answer on making those two indicators range between the same set of numbers (more or less) without changing the shape of the indicator. Please help.
Can you past a picture as example?

I´m trying to understand your question.
You refer to something like drop rsi above macd?
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #605 (permalink)  
Old 01-09-2008, 07:32 PM
Junior Member
 
Join Date: Aug 2007
Posts: 2
sorrex is on a distinguished road
Function for programmed scrolling of windows

I use MTF stochastic for trading.
When I manually backtest some ideas I have open more windows with various TF where I check actual status of indicators. My idea is to put vertical line on actual time in main TF windows and using global variables and joined "move" indicator on other TF windows for automatic scroll that I can see actual situation without manual scrolling every TF window.
But - I cannot find any function that allows me to scroll windows to defined position (shift). Have anybody an idea how to do it? thx in advn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #606 (permalink)  
Old 01-10-2008, 02:36 AM
Dan7974's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 264
Dan7974 is on a distinguished road
A code

How can I code this?

If the market touches (X.XX50 or X.XX00)
then buy. How to identify last two numbers?


thanks.
__________________
God Bless Everyone, and their trading logic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #607 (permalink)  
Old 01-10-2008, 03:16 AM
TheRumpledOne's Avatar
Banned
 
Join Date: Nov 2006
Posts: 806
TheRumpledOne is an unknown quantity at this point
Quote:
Originally Posted by Dan7974 View Post
How can I code this?

If the market touches (X.XX50 or X.XX00)
then buy. How to identify last two numbers?


thanks.

This should do it:

Code:
     
if ( Point == 0.01 )  {xPrice = Close[i] - MathMod(Close[i],0.50) ; }
     else { xPrice = Close[i] - ( MathMod(100*Close[i],0.50)*0.01 ) ;  } 


        P1Buffer[i] = xPrice + Point*50;
        P2Buffer[i] = xPrice ;
        P3Buffer[i] = xPrice - Point*50;

When MathMod(Close[i],0.50) = 0 then the price ends in 00 or 50.






Here's my indicator to identify 00 lines:


Code:
//+------------------------------------------------------------------+
//|          _TRO_00_Lines                                           |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+

#property indicator_chart_window 

#property indicator_buffers 3

#property indicator_color1 LightGray 
#property indicator_color2 LightGray 
#property indicator_color3 LightGray  

// indicators parameters

//---- buffers
double P1Buffer[];
double P2Buffer[];
double P3Buffer[];

double xPrice ;
int myStyle  = 2 ;

int myWingDing  = 250 ;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {

   SetIndexBuffer(0, P1Buffer);
   SetIndexBuffer(1, P2Buffer);
   SetIndexBuffer(2, P3Buffer); 

SetIndexArrow(0, myWingDing); 
SetIndexArrow(1, myWingDing); 
SetIndexArrow(2, myWingDing); 

   SetIndexStyle(0, DRAW_ARROW, myStyle, 1);
   SetIndexStyle(1, DRAW_ARROW, myStyle, 1);   
   SetIndexStyle(2, DRAW_ARROW, myStyle, 1);   
   
   SetIndexEmptyValue(0,0); 
   SetIndexEmptyValue(1,0);
   SetIndexEmptyValue(2,0);

   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   int i, dayi, 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--;  
   int limit = Bars - counted_bars;
//----   





   for(i = limit - 1; i >= 0; i--)
     {
      
     if ( Point == 0.01 )  {xPrice = Close[i] - MathMod(Close[i],1.00) ; }
     else { xPrice = Close[i] - ( MathMod(100*Close[i],1.00)*0.01 ) ;  }  
   
        P1Buffer[i] = xPrice + Point*100;
        P2Buffer[i] = xPrice ;
        P3Buffer[i] = xPrice - Point*100;  
                    
     } // for 
 
   return(0);

  } // start
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #608 (permalink)  
Old 01-10-2008, 03:55 AM
Dan7974's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 264
Dan7974 is on a distinguished road
I need it for an EA though!
__________________
God Bless Everyone, and their trading logic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #609 (permalink)  
Old 01-14-2008, 07:25 AM
Senior Member
 
Join Date: Sep 2007
Location: Poland
Posts: 226
Pucio is on a distinguished road
Coders please help

What to change in the code to move more up and down dots from candlesticks ?
Attached Images
File Type: gif diagram.gif (17.0 KB, 89 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #610 (permalink)  
Old 01-14-2008, 08:07 AM
Senior Member
 
Join Date: Nov 2006
Posts: 179
luxinterior is on a distinguished road
Somebody might actually help you if you posted the code.

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
CHinGsMAroonCLK, I_XO_A_H

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 06:24 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 04:22 PM


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



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