Forex



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
 
Thread Tools Display Modes
  #21 (permalink)  
Old 02-20-2006, 06:12 AM
konjn's Avatar
Junior Member
 
Join Date: Jan 2006
Posts: 4
konjn is on a distinguished road
similar boat

I'm up against the same thing... but instead of having a line (more clutter) i'd like to ahve a candle colored... again it needs to be user input so we can show the opens of various markets... as an example.

konjn
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
  #22 (permalink)  
Old 02-23-2006, 11:42 AM
Junior Member
 
Join Date: Feb 2006
Posts: 7
gqjs is on a distinguished road
about code of mql4




i want to put the hight and low price in current chart .

but i do not konw how to write the code in my indicator by MQL4.

thanks a lot!

Last edited by gqjs; 02-23-2006 at 11:45 AM.
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
  #23 (permalink)  
Old 02-23-2006, 11:43 AM
Junior Member
 
Join Date: Feb 2006
Posts: 7
gqjs is on a distinguished road
like these


Last edited by gqjs; 02-24-2006 at 12:42 AM.
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
  #24 (permalink)  
Old 02-23-2006, 12:06 PM
Junior Member
 
Join Date: Feb 2006
Posts: 9
divergence_trader is on a distinguished road
Code to move stoploss?

Hi all,

Coding an EA at the moment to autotrade for me, it's getting towards completion but i can't figure out how to move the stoploss on an open trade. i am posting my code here, if anyone could point out what i'm doing wrong i would greatly appreciate


This is the part of code which opens a LONG position:

PHP Code:

{
         if(
//long entry criteria met)
            
{
            if (
priorbartime == Time[0])
            return(
0);
            
priorbartime Time[0];
            
Alert("Long Signal");
            
ObjectCreate(arrowlongOBJ_ARROW0Time[0], Open[0], 0000);
            
ObjectSet(arrowlongOBJPROP_ARROWCODE233);
            
ObjectSet(arrowlongOBJPROP_COLORAqua);
            
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"am crossing",16677,0,Green);  // HDB CHANGED Close TO Ask and SlipPage to 0
         
if(ticket>0)
           {
            if(
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print(
"Error opening BUY order : ",GetLastError()); 
         return(
0);
            }
    } 
then once the trade is open I want to manage it by moving stop to -5 when the trade is +15, and by moving stop to b/e when trade is +20. this is the code i have come up with so far but it doesnt seem to be working:

PHP Code:
total=OrdersTotal();
   if(
total>0)
      { 
      for(
cnt=0;cnt<total;cnt++)
         {
         
OrderSelect(cntSELECT_BY_POSMODE_TRADES);
         if(
OrderType()==OP_BUY && OrderSymbol()==Symbol())
            {
            if(
Bid-OrderOpenPrice()==Point*15)
               {
               
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-Point*5,OrderTakeProfit(),0,Blue);
               return(
0);
               }
            if(
Bid-OrderOpenPrice()==Point*20)
               {
               
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Blue);
               return(
0);
               }
            }
         }
      } 
As mentioned, this is all for LONG positions.

Thanks for any help!

divergence_trader
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
  #25 (permalink)  
Old 02-23-2006, 12:24 PM
Administrator
 
Join Date: Sep 2005
Posts: 20,016
Blog Entries: 235
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Many people asked about it already many times.
So read:
- this post,

- this one and

- this Codersguru thread.
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
  #26 (permalink)  
Old 02-23-2006, 12:31 PM
Junior Member
 
Join Date: Feb 2006
Posts: 9
divergence_trader is on a distinguished road
thanks newdigital, i'ev looked round many threads at SBFX, metaquotes and here but managed to not find what i was looking for, hopefully these will 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
  #27 (permalink)  
Old 02-23-2006, 07:17 PM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Try this:

PHP Code:
   total=OrdersTotal();
   if(
total>0){ 
      for(
cnt=0;cnt<total;cnt++){
         
OrderSelect(cntSELECT_BY_POSMODE_TRADES);
         if(
OrderType()==OP_BUY && OrderSymbol()==Symbol()){
            if(
Bid-OrderOpenPrice()>=Point*15 &&  Bid-OrderOpenPrice()<Point*20 && OrderStopLoss()< OrderOpenPrice()-5*Point){
               
OrderModify(OrderTicket(),OrderOpenPrice()-Point*5,OrderTakeProfit(),Blue);
            }
            if(
Bid-OrderOpenPrice()>=Point*20 && OrderStopLoss()< OrderOpenPrice()){
               
OrderModify(OrderTicket(),OrderOpenPrice(),OrderTakeProfit(),Blue);
            }
         }
      }
   } 

Last edited by Nicholishen; 02-23-2006 at 07:23 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
  #28 (permalink)  
Old 02-25-2006, 09:15 PM
mas mas is offline
Junior Member
 
Join Date: Nov 2005
Posts: 17
mas is on a distinguished road
code of MA levels

hi

i try to write a code of MA levels but it's not working ...

any one can tell me how can i do it plz.

thanks
Attached Images
File Type: png levels.PNG (19.6 KB, 1071 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
  #29 (permalink)  
Old 02-26-2006, 12:58 AM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 130
keris2112 is on a distinguished road
Quote:
Originally Posted by mas
hi

i try to write a code of MA levels but it's not working ...

any one can tell me how can i do it plz.

thanks
You can use the Vegas Currancy Daily indicator as a guide. See attachement.
Keris
Attached Files
File Type: mq4 Vegas Currency Daily.mq4 (5.9 KB, 344 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
  #30 (permalink)  
Old 02-28-2006, 11:27 AM
Junior Member
 
Join Date: Feb 2006
Posts: 9
divergence_trader is on a distinguished road
Quote:
Originally Posted by Nicholishen
Try this:
Thanks Nicholishen, your code works perfectly. Didn't get an opportunuity to test it in a live market until now but all working fine. thanks again!
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
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop

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
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 09:26 AM.



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