zoop Posted January 26, 2010 Report Share Posted January 26, 2010 hi my friends,im experimenting with a LSMA indicator to stop an ea trading when in a certain state how would i modify this comment below i need return 1 (allowing trade) in current state or else 0 if not in this state if(lsmaga!=EMPTY_VALUE && lsmag!=EMPTY_VALUE)return(0); if(lsmara!=EMPTY_VALUE && lsmar!=EMPTY_VALUE)return(0); thanks! Quote Link to comment Share on other sites More sharing options...
konorti Posted January 26, 2010 Report Share Posted January 26, 2010 Re: (Ask) How to change logic state of this code It is hard to say anything without seeng the full code, but if you want to close the trades when lsmaga and lsmag are also 0, you can write sg similar: if(lsmaga==EMPTY_VALUE && lsmag==EMPTY_VALUE) { OrderClose(OrderTicket(),OrderLots(),Bid,10,Red); return(0); } or if you dont want the to open trade you write sg like this in front ordersend: if(lsmaga!=EMPTY_VALUE && lsmag!=EMPTY_VALUE) { OrderSend(Symbol(),OP_SELL,lot,Bid,5,Bid+Stop_Loss*Point,Bid-Take_Profit*Point,NULL,0,0,Lime); return(0); } Quote Link to comment Share on other sites More sharing options...
scarface Posted January 27, 2010 Report Share Posted January 27, 2010 Re: (Ask) How to change logic state of this code Hi kopaszn, Good day, Thanks a lot for coming by and helping out. That was exactly what I was thinking about to say. :) there is one thing you need to be sure about though, if the broker has 5-digit price, in this case the slippage would be 30 instead of 3. Some broker have special requirements for Slippage. You can check however from the broker itself by asking them through the live chat. Thanks again kopaszn. Best wishes, Quote a New Year 2011 has come, and the challenge has just started 8-) Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.