| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Order modify question https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=851 |
Page 1 of 1 |
| Author: | mlewis [ Sat Sep 29, 2012 8:17 am ] |
| Post subject: | Order modify question |
Im trying to implement the triple order MM script (posted in the script section here) into a trend line trading semiauto EA. the order send function is working perfectly but I've tried lots of things and can't seem to get the order modify functions to work for SL and TP. Do I have to do things differently when modifying orders for a pair other than what chart the EA is loaded onto? Or should I just keep trying to make it work? |
|
| Author: | gaheitman [ Sat Sep 29, 2012 11:41 am ] |
| Post subject: | Re: Order modify question |
When accessing a non-chart pair, you can't use things like Bid and Ask, Point, etc. You have to look up everything with MarketInfo(). Post your code and we can give it a look. George |
|
| Author: | mlewis [ Sat Sep 29, 2012 9:57 pm ] |
| Post subject: | Re: Order modify question |
George... thank you so much for taking the time to do this!! You're a true gentleman! You will need to place these onto an AUDJPY chart. I use H1 but it doesn't matter really. You dont need the indicator for the EA to work but you do need to know where the close of the current candle is for the index that the indicator draws in order to place the trendlines, as this will be a different price to the current close of the pair that the EA is attached to. Eventually i will get around to working out how to get the EA to draw the index chart but i don't want to add too many layers of confusion at this stage. To place an order simply draw a trendline and name it "sl" for sell limit. when the close of the index is above the line it sends the tripple order. I haven't implimented any of the other order types yet so don't try to place buy limits, sell stops or buy stops. I use an ECN broker so can't wrap the stop loss / take profit info up into the ordersend. kind regards ML |
|
| Author: | gaheitman [ Sun Sep 30, 2012 4:55 am ] |
| Post subject: | Re: Order modify question |
What error messages are you getting? George |
|
| Author: | mlewis [ Sun Sep 30, 2012 9:31 am ] |
| Post subject: | Re: Order modify question |
Well, I've done various incarnations of this, using various types of orderselect and ordermodify. The most common error was "ordermodify failed with error 'no error' " or simply no error message but no stoploss or Break even. I'll have to wait until the market is open again as I had removed the ordermodify from the EA so I had to reconstructed what I has been trying to post here to give you an idea of what I had tried. I'm slightly suspicious that my bracketing is a bit out of control and that if the ordermodify was included into a different loop then it might spring into life. Possible perhaps? It's hard to test when the market is closed though since every incarnation has always compiled without errors or warnings... ML |
|
| Author: | mlewis [ Mon Oct 01, 2012 10:41 am ] |
| Post subject: | Re: Order modify question |
yep... it places all of the orders correctly, but with SL and TP set to 0.00000, then display three error alerts: Stoploss/Takeprofit 1 OrderModify failed with error No Error Stoploss/Takeprofit 2 OrderModify failed with error No Error Stoploss/Takeprofit 3 OrderModify failed with error No Error ML |
|
| Author: | mlewis [ Mon Oct 01, 2012 10:47 am ] |
| Post subject: | Re: Order modify question |
aha!!!! i might have worked it out!! in the experts messages it says : MJL Risk Index Semi-Auto Trader AUDJPY, H1, invalid TakeProfit for ORDERMODIFY function so clearly the Ordermodify is not in the form that it wants. ML |
|
| Author: | gaheitman [ Mon Oct 01, 2012 10:57 am ] |
| Post subject: | Re: Order modify question |
Go ahead and add an Alert() to print out the values of the temp_stoploss and temp_takeprofit1 to make sure they look like what you expect. George |
|
| Author: | mlewis [ Mon Oct 01, 2012 11:32 am ] |
| Post subject: | Re: Order modify question |
YES!!!! i worked it out!! i needed to do this otherwise the amount i was adding and subtracting to the OpenOrderPrice was in pips rather than as the actual price so was orders of magnitude too big. SL_Short_Price = StopLossShort*PointShort; TP1_Short_Price = TakeProfitShort1*PointShort; TP2_Short_Price = TakeProfitShort2*PointShort; TP3_Short_Price = TakeProfitShort3*PointShort; SL_Long_Price = StopLossShort*PointShort; TP1_Long_Price = TakeProfitShort1*PointShort; TP2_Long_Price = TakeProfitShort2*PointShort; TP3_Long_Price = TakeProfitShort3*PointShort; George, i really appreciate your kind offer to help out, It's the people whole roll up their sleves to help others out on a furum like this that really make the whole thing function as a community. Thank You! |
|
| Author: | gaheitman [ Mon Oct 01, 2012 11:46 am ] |
| Post subject: | Re: Order modify question |
Glad it worked out! George |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|