Quote:
Originally Posted by ElectricSavant
Entry is not correct in 1.8..
You added or subtracted when you should of done the opposite...we are getting entries at 2 pips inside the bar...or else the lookback did not lookback correctly...
ES
|
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?