PS. my set file keeps changing so
PSS don't use it on live account.
Code: Select all
//Force a pending grid order send
if (SendGrid)
{
int type = PendingOrderType + 2;//enum starts at 0, so we need to add 2 to make the order a stop or limit
int retno = MessageBox("Please confirm that you want to send a pending trade grid", "Confirm grid sending", MB_YESNOCANCEL);
if (retno == IDYES)
{
double price = NormalizeDouble(Bid + (DistanceBetweenTrades / factor), Digits);//Defaults to buy stop/sell limit
if (type == 2 || type == 5)//Buy limit sell stop
price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits);
if (!CloseEnough(GridStartPrice, 0))
price = GridStartPrice;
if (type == 2 || type == 4)
SendBuyGrid(Symbol(), type, price, Lot);
else
SendSellGrid(Symbol(), type, price, Lot);
RemoveExpert = true;
Alert(Symbol() + ": I have removed myself from the chart.");
ExpertRemove();
return(0);
}//if (retno == IDYES)
}//if (SendGrid)
SteveHopwood » Sun Jan 31, 2016 3:00 pm wrote:V 1u is in post 1.
It occurred to me that there might be times when we want to add a fresh grid - I do at the mo on that GJ chart I posted. I have added this functionality.
Thanks for the update Steve!SteveHopwood » Mon Feb 01, 2016 8:51 am wrote:Anybody using 1u to fill in a missing grid will have come across the same problems I did. I have fixed them in V 1v in post 1.
To make the changes yourselves, go to line 900 and copy this over the top of the code snippet:Code: Select all
//Force a pending grid order send if (SendGrid) { int type = PendingOrderType + 2;//enum starts at 0, so we need to add 2 to make the order a stop or limit int retno = MessageBox("Please confirm that you want to send a pending trade grid", "Confirm grid sending", MB_YESNOCANCEL); if (retno == IDYES) { double price = NormalizeDouble(Bid + (DistanceBetweenTrades / factor), Digits);//Defaults to buy stop/sell limit if (type == 2 || type == 5)//Buy limit sell stop price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits); if (!CloseEnough(GridStartPrice, 0)) price = GridStartPrice; if (type == 2 || type == 4) SendBuyGrid(Symbol(), type, price, Lot); else SendSellGrid(Symbol(), type, price, Lot); RemoveExpert = true; Alert(Symbol() + ": I have removed myself from the chart."); ExpertRemove(); return(0); }//if (retno == IDYES) }//if (SendGrid)
Read the user guide. It is there to stop me having to read damn fool questions.cozybooks » Mon Feb 01, 2016 2:28 pm wrote:Hey Steve,
I'm not convinced I'm encountering a real problem but thought I'd post it in case anyone else sees the same thing. I've had the same issue with rev U and V.
I initially had the problem on a one hour timeframe, so I tried setting up tests with a 5 minute timeframe, but both had the same problem.
I'm doing Stop_Orders_Only with a grid size of 5.
I'm using the ATR setting for TP, SL and grid. The grid size works fine, and the TP on the pending buy and sell stop orders is correct, but the SL on the pendings orders (both long and short) is zero.
I was using an oddball setting for SL ( .72 of a 4 Hour ATR with 20 periods), so I tried using a straight 1.0 instead of the .72, but had the same issue. I then tried putting in a SL at the top of the EA, thinking maybe if there was an initial stop loss, then it would change it. Same problem, except on my 5 minute timeframe test (just to get a signal more quickly), it got as far as the first four sell stop orders (all with a SL of zero instead of the ATR setting), then hit an error trying to send the 5th pending sell order for an invalid stop.
The journal shows sl: 0.00000 on the pending orders sent.
I was getting this problem on an ECN broker account, so I tried setting it up on my non-ecn broker, but that's the setup where I got the invalid stop error trying to generate the 5th pending.
Sorry in advance if I'm missing something obvious. It's still early Monday here in the U.S. and my brain isn't very functional even at its peak!!
Hey Cyber, how are you going mate? Thanks for the use of your setfile...cyberevil » Mon Feb 01, 2016 8:00 am wrote:Here is my current working set file. It's running on some very basic settings for the time being. Once I get the basic logic up and running and my heart is satisfied then i'll start playing with all the bells and whistles Steve has added![]()
PS. my set file keeps changing so![]()
PSS don't use it on live account.
Just a little curious to know what you would use in your 'Grid Inputs', under Grid Type as your setfile suggests '0'!
Which would you use 'Stop_And_Limit_Orders', or just the 'Stop_Orders_Only' to replace the '0' in your style of trading?
Thanks Bob, I appreciate the clarification...FXCoder » Tue Feb 02, 2016 11:12 am wrote:Hi Tony,
A value of 0 in GridType represents "Stop Orders Only". A value of 1 represents "Stop and Limit Orders".
Cheers,
Bob
Just a little curious to know what you would use in your 'Grid Inputs', under Grid Type as your setfile suggests '0'!
Which would you use 'Stop_And_Limit_Orders', or just the 'Stop_Orders_Only' to replace the '0' in your style of trading?
Code: Select all
enum GridStrategyType
{
Stop_Orders_Only,
Stop_And_Limit_Orders
};