Hey
Long-time reader of threads in Forex Factory but I finally joined because I have a question on buying and selling scripts.
I've tested out many of the buying and selling scripts that are stickied but I have a special request for anyone that can help me.
I'm accustomed to a buying/selling script posted by goingforward.
The buy script looks like
The script is really brilliant.
But I'd like to see if I could get two modifications to it.
The Money Management feature:
When I set the risk percent to 2, it buys a lot equal to two percent of my balance.
Instead, I'd like for the risk percent to make the stop loss equal to 2 percent of my balance.
For example if my account balance was $5,000, my stop loss would equal $100. And have the percentage be changeable as the first code is.
Is that possible? xD
If it is, please let me know what should be changed or if you're feeling generous, change the code and post it here haha
Second whenever I use the script (hotkeyed or dragged), I get this little message:
http://img17.imageshack.us/img17/720...ithslandtp.jpg
I was wondering if the script could be modified in such a way that I wouldn't get that message when I executed the script and it just... y'know... executed itself without pressing OK haha.
Thanks to goingforward and anyone who'll reply to this thread in advanced.
Attached are the original scripts:
Long-time reader of threads in Forex Factory but I finally joined because I have a question on buying and selling scripts.
I've tested out many of the buying and selling scripts that are stickied but I have a special request for anyone that can help me.
I'm accustomed to a buying/selling script posted by goingforward.
The buy script looks like
Inserted Code
//+------------------------------------------------------------------+ //| Buy with SL and TP | //| Copyright © 2008, smjones | //| sjcoinc | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, smjones" #property link "[email protected]" #property show_inputs extern double Lots = 1; extern bool UseMoneyMgmt = true; extern double RiskPercent = 2; extern bool UseStop = true; extern bool UseTakeProfit = true; extern double StopLoss = 60; extern double TakeProfit = 40; extern string Note="0 in Entry field means Market Order Buy"; extern double Entry = 0.0000; string Input = " Buy Price "; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { double Risk = RiskPercent / 100; if (UseMoneyMgmt) Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2); int Mode = OP_BUYSTOP; if (Ask > Entry && Entry > 0) Mode = OP_BUYLIMIT; if (Entry == 0) {Entry = Ask; Mode = OP_BUY;} double SLB = Entry - StopLoss*Point, TPB = Entry + TakeProfit*Point; if (UseStop == false) SLB = 0; if (UseTakeProfit == false) TPB = 0; if(Lots > 0) OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , TPB, "Buy Script", 0, NULL, LimeGreen); return(0); } //+------------------------------------------------------------------+
The script is really brilliant.
But I'd like to see if I could get two modifications to it.
The Money Management feature:
When I set the risk percent to 2, it buys a lot equal to two percent of my balance.
Instead, I'd like for the risk percent to make the stop loss equal to 2 percent of my balance.
For example if my account balance was $5,000, my stop loss would equal $100. And have the percentage be changeable as the first code is.
Is that possible? xD
If it is, please let me know what should be changed or if you're feeling generous, change the code and post it here haha
Second whenever I use the script (hotkeyed or dragged), I get this little message:
http://img17.imageshack.us/img17/720...ithslandtp.jpg
I was wondering if the script could be modified in such a way that I wouldn't get that message when I executed the script and it just... y'know... executed itself without pressing OK haha.
Thanks to goingforward and anyone who'll reply to this thread in advanced.
Attached are the original scripts:
Attached File(s)
Buy with SL and TP.mq4
2 KB
|
479 downloads
Sell with SL and TP.mq4
2 KB
|
433 downloads