Thread: Martingale EA
View Single Post
  #883 (permalink)  
Old 02-27-2008, 03:23 AM
ElectricSavant's Avatar
ElectricSavant ElectricSavant is offline
Senior Member
 
Join Date: Jun 2007
Posts: 3,354
ElectricSavant is on a distinguished road
I will test...Thank you wolfe. Can I have some of those "smart pills" you are taking...What is your secret to keeping such a consistently nimble mind?

Your reasoning seems as sharp as a tack...

ES


Quote:
Originally Posted by wolfe View Post
This is the last thing I want to be on the "same page" with, before I post the (hopefully) corrected v1_8.

Let me explain what I tried to do:

All long ordersend commands must use the ask.
PHP Code:
OrderSend(Symbol(),OP_BUY,Lot_Size,Ask,Slippage,NULL,NULL,"TFX_LONG_ADDITIONAL",Magic_Number,0,Green); 
All short ordersend commands must use the bid.
PHP Code:
OrderSend(Symbol(),OP_SELL,Lot_Size,Bid,Slippage,NULL,NULL,"TFX_SHORT_ADDITIONAL",Magic_Number,0,Red); 
When you see an arrow on a chart for an opened long order, that arrow is the ask. The ask is the price you're long order opened at.

When you see an arrow on a chart for an opened short order, that arrow is the bid. The bid is the price you're short order opened at.

At least this is how I understand things.

So, in the code all the entry possibilities for a long I used the Ask:
PHP Code:
if (((Pyramid==true)&&(Use_MA_Entry==false)&&(Ask >= Next_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==false))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Ask <= Next_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==false))||
     ((
Pyramid==true)&&(Use_MA_Entry==false)&&(Ask >= Next_Buy)&&(Ask>Last_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true))||
     ((
Pyramid==true)&&(Use_MA_Entry==false)&&(Ask >= Next_Buy)&&(OTL(Magic_Number)==0)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Ask <= Next_Buy)&&(Ask<Last_Buy)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Ask <= Next_Buy)&&(OTL(Magic_Number)==0)&&(Last_Type==OP_SELL)&&(Last_Entry_Filter==true)))
   { 
In the code all the entry possibilities for a short I used the Bid:
PHP Code:
if (((Pyramid==true)&&(Use_MA_Entry==false)&&(Bid <= Next_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==false))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Bid >= Next_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==false))||
     ((
Pyramid==true)&&(Use_MA_Entry==false)&&(Bid <= Next_Sell)&&(Bid<Last_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true))||
     ((
Pyramid==true)&&(Use_MA_Entry==false)&&(Bid <= Next_Sell)&&(OTS(Magic_Number)==0)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Bid >= Next_Sell)&&(Bid>Last_Sell)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true))||
     ((
Pyramid==false)&&(Use_MA_Entry==false)&&(Bid >= Next_Sell)&&(OTS(Magic_Number)==0)&&(Last_Type==OP_BUY)&&(Last_Entry_Filter==true)))
   { 
This is what made sense to me, maybe I'm wrong though.

I tried to make it so when you enter 2 for your EntryLag_Long, the "arrow" is opened at 2 pips above the high, and when you enter 2 for your EntryLag_Short, the "arrow" is opened 2 pips below the low.

Now you know my reasoning and how I coded this, so is it right?

Last edited by ElectricSavant; 02-27-2008 at 03:30 AM.
Reply With Quote