تحرير تعليقك
Help with sl/tp pls?
forex_trader_34052
عضو منذ Apr 13, 2011
16 المشاركات
May 09, 2011 at 13:23
عضو منذ Apr 13, 2011
16 المشاركات
Hi, looking for something that would allow me to auto set a fixed sl & tp on every trade. My entries are @ candle close instant and by time I set tp and sl price has moved on. Not a problem to edit if only one position taken but on a few different pairs simultaneously then its a pain ;)
I just want to be able to hit the buy or sell button and have an automatic 20pip stop loss and take profit attached at the same time. ie one click does it all.
I am new to MT4 so needs to be REALLY simple to set up ie idiot proof ;)
Any ideas appreciated, thanks :)
I just want to be able to hit the buy or sell button and have an automatic 20pip stop loss and take profit attached at the same time. ie one click does it all.
I am new to MT4 so needs to be REALLY simple to set up ie idiot proof ;)
Any ideas appreciated, thanks :)
عضو منذ Dec 08, 2010
33 المشاركات
May 11, 2011 at 06:52
عضو منذ Dec 08, 2010
33 المشاركات
Here is a script "AutoAssignSlTp.mq4" that will do what you requested.
Set the Take Profit and the Stop Loss values in pips. (e.g. TakeProfit_Pips = 20 and StopLoss_Pips = 20).
If ApplyToAllOpenPositions is TRUE, then the script will automatically apply the T/P and S/L to all open positions. If set to FALSE, it will only apply to the open positions of the current symbol.
If either value is set is 0, it will ignore that value. E.g. if TakeProfit_Pips = 0, then it will not apply the TakeProfit_Pips and likewise for StopLoss_Pips.
This script will only apply S/L and T/P if they are not set (0). If an open trade has T/P or S/L, the script ignores that order.
Set the Take Profit and the Stop Loss values in pips. (e.g. TakeProfit_Pips = 20 and StopLoss_Pips = 20).
If ApplyToAllOpenPositions is TRUE, then the script will automatically apply the T/P and S/L to all open positions. If set to FALSE, it will only apply to the open positions of the current symbol.
If either value is set is 0, it will ignore that value. E.g. if TakeProfit_Pips = 0, then it will not apply the TakeProfit_Pips and likewise for StopLoss_Pips.
This script will only apply S/L and T/P if they are not set (0). If an open trade has T/P or S/L, the script ignores that order.
عضو منذ Dec 08, 2010
33 المشاركات
May 11, 2011 at 06:58
عضو منذ Dec 08, 2010
33 المشاركات
Here is the correct script.
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 11, 2011 at 22:26
عضو منذ Jan 26, 2011
974 المشاركات
spotfx posted: I am new to MT4 so needs to be REALLY simple to set up ie idiot proof ;)
https://gawker.com/assets/resources/2008/04/hillbilly.jpeg
forex_trader_34052
عضو منذ Apr 13, 2011
16 المشاركات
May 11, 2011 at 22:54
عضو منذ Apr 13, 2011
16 المشاركات
zzzero posted:
spotfx posted: I am new to MT4 so needs to be REALLY simple to set up ie idiot proof ;)
https://gawker.com/assets/resources/2008/04/hillbilly.jpeg
The above says so much about u as a human being ...zzzero by name... and by brain.
forex_trader_34052
عضو منذ Apr 13, 2011
16 المشاركات
May 11, 2011 at 22:56
عضو منذ Apr 13, 2011
16 المشاركات
finstudio posted:
Here is a script "AutoAssignSlTp.mq4" that will do what you requested.
Set the Take Profit and the Stop Loss values in pips. (e.g. TakeProfit_Pips = 20 and StopLoss_Pips = 20).
If ApplyToAllOpenPositions is TRUE, then the script will automatically apply the T/P and S/L to all open positions. If set to FALSE, it will only apply to the open positions of the current symbol.
If either value is set is 0, it will ignore that value. E.g. if TakeProfit_Pips = 0, then it will not apply the TakeProfit_Pips and likewise for StopLoss_Pips.
This script will only apply S/L and T/P if they are not set (0). If an open trade has T/P or S/L, the script ignores that order.
Finstudio, thanks for your help, much appreciated. I will give this a try as soon as I have time. 😄
forex_trader_34052
عضو منذ Apr 13, 2011
16 المشاركات
May 12, 2011 at 13:56
عضو منذ Apr 13, 2011
16 المشاركات
Hi Finstudio, this is great ..exactly what I wanted! 😀 Thank u very much!!!
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 15, 2011 at 20:07
(تم التعديل May 15, 2011 at 20:12)
عضو منذ Jan 26, 2011
974 المشاركات
spotfx posted:
zzzero posted:
spotfx posted: I am new to MT4 so needs to be REALLY simple to set up ie idiot proof ;)
https://gawker.com/assets/resources/2008/04/hillbilly.jpeg
The above says so much about u as a human being ...zzzero by name... and by brain.
oh yes, i do so understand how you feel.
https://tesla.plunder.com/x/$65xDajVHzyESzxRcVDnSKr96URXNqZ3q/302214aed1/set_profits.txt
btw, the other guy that uploaded that code, might you ask him if he could complicate that bloated code any more than he did?
i do not believe it is possible.
int init(){}
int deinit(){}
int set_profits()
{
int total,pos;
total=OrdersTotal();
for(pos=0;pos
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 16, 2011 at 03:15
عضو منذ Jan 26, 2011
974 المشاركات
i cant fifnd the button or whatever here at myfxbook to include an attachment like the person did above.
anybody?
anybody?
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
عضو منذ Dec 08, 2010
33 المشاركات
May 16, 2011 at 14:53
عضو منذ Dec 08, 2010
33 المشاركات
>> btw, the other guy that uploaded that code, might you ask him if he could complicate that bloated code any
>> more than he did?
Bloated ?? How so ?
>> more than he did?
Bloated ?? How so ?
عضو منذ Dec 08, 2010
33 المشاركات
May 16, 2011 at 16:18
عضو منذ Dec 08, 2010
33 المشاركات
zzzero posted:
/*
i left out this part, cuz you were so awesomely rude.
dink.
*/
LOL !! Since he was "awesomely rude", you could have simply avoided posting or responding altogether !!
Seems like you are a person with an attitude.
forex_trader_34052
عضو منذ Apr 13, 2011
16 المشاركات
May 16, 2011 at 16:31
عضو منذ Apr 13, 2011
16 المشاركات
zzzero, for "awesomely rude" why not take a look in the mirror my friend! You posted the pointless and offensive pic without cause, not I.
As for Finstudio's kind contribution ~ whether the code is complex or bloated I know not and care even less. What I do know is that it does exactly what I require, was posted with courteousness and for both I am most grateful to him.
I have no idea why u continue(d) to post after I thanked Finstudio and said it was what I was looking for.
Why not move along now, there's a good lad!😉
As for Finstudio's kind contribution ~ whether the code is complex or bloated I know not and care even less. What I do know is that it does exactly what I require, was posted with courteousness and for both I am most grateful to him.
I have no idea why u continue(d) to post after I thanked Finstudio and said it was what I was looking for.
Why not move along now, there's a good lad!😉
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 16, 2011 at 20:54
عضو منذ Jan 26, 2011
974 المشاركات
I, KIND SIR, HAVE BEEN ACCUSED AND CONVICTED OF BEING MANY DIFFERENT THINGS.
BUT, BEING A GOOD LAD IS NOT ONE OF THOSE THINGS.
GOOD DAY.
BUT, BEING A GOOD LAD IS NOT ONE OF THOSE THINGS.
GOOD DAY.
عضو منذ Dec 08, 2010
33 المشاركات
May 17, 2011 at 03:32
عضو منذ Dec 08, 2010
33 المشاركات
zzzero posted:
I, KIND SIR, HAVE BEEN ACCUSED AND CONVICTED OF BEING MANY DIFFERENT THINGS.
BUT, BEING A GOOD LAD IS NOT ONE OF THOSE THINGS.
GOOD DAY.
Whatever, dude !!
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
عضو منذ Dec 08, 2010
33 المشاركات
May 17, 2011 at 05:47
عضو منذ Dec 08, 2010
33 المشاركات
Got something original to contribute ?
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 17, 2011 at 06:31
عضو منذ Jan 26, 2011
974 المشاركات
finstudio posted:
Got something original to contribute ?
عضو منذ Dec 08, 2010
33 المشاركات
May 17, 2011 at 06:41
عضو منذ Dec 08, 2010
33 المشاركات
zzzero posted:
OrderModify(TICKET,OPENPRICE,STOPLOSS,TAKEPROFIT,EXPIRATION,CLR_NONE);
No error handling nor any validations.
Crappy newbie code.
forex_trader_27988
عضو منذ Jan 26, 2011
974 المشاركات
May 17, 2011 at 06:54
عضو منذ Jan 26, 2011
974 المشاركات
i actually have been writing code since early 1983.
it would be a stretch to refer to me as a newbie.
my first computer was an atari 400.
i learned by writing atari basic and then i moved up to writing raw machine code.
in 1991, i was introduced to the C language.
i stated that i was leaving out a portion of the code, hence no error handling.
all of the UPPERCASE variables, such as STOPLOSS and TAKEPROFIT, would have been handled directly in the small block of code that i left out.
now, shall we continue the little pissing match?
or perhaps you might like to talk coding with somebody that actually enjoys coding?
regards,
edward/.

it would be a stretch to refer to me as a newbie.
my first computer was an atari 400.
i learned by writing atari basic and then i moved up to writing raw machine code.
in 1991, i was introduced to the C language.
i stated that i was leaving out a portion of the code, hence no error handling.
all of the UPPERCASE variables, such as STOPLOSS and TAKEPROFIT, would have been handled directly in the small block of code that i left out.
now, shall we continue the little pissing match?
or perhaps you might like to talk coding with somebody that actually enjoys coding?
regards,
edward/.

*لن يتم التسامح مع الاستخدام التجاري والبريد العشوائي، وقد يؤدي ذلك إلى إنهاء الحساب.
نصيحة: نشر رابط صورة أو فيديو من YouTube سيضمّنها تلقائيًا في مشاركتك!
نصيحة: اكتب العلامة @ للإكمال التلقائي لاسم المستخدم المشارك في هذه المناقشة.