• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 12:41am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 12:41am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Do I need a script or an EA here? Pyramid/Snowballing/Scaling In 7 replies

Basic Alt Key/Entry Script - Simplest Script Ever 1 reply

i like to add an indicator script into my own script. what would be the best idea? 3 replies

EA or Script for scaling out of trades...? 1 reply

scaling in/scaling out - how do you do it? 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 8
Attachments: Scaling in Script
Exit Attachments
Tags: Scaling in Script
Cancel

Scaling in Script

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Sep 5, 2011 12:01pm Sep 5, 2011 12:01pm
  •  AlienTrader
  • | Joined Mar 2011 | Status: Member | 53 Posts
hi guys,

I have been looking for a scaling in script to place pending orders, does anyone know if one exists?

If not does anyone know how to code a script to place an order a set number of pips away from the first order & not as I have seen from current price?

example:

from where the cursor is placed on screen order 1 with size,st,tp 1is placed. X number of pips away order 2 with size,st,tp 2 is placed & so on. Where the X number is different for each order.

So what you have is one entry point & the script lays the orders with variables for how far apart they are & their properties.

I have searched hi & low & have not been able to find something similar.

And of course looked in the ALL Order Related Indicators, Scripts and EA thread & could try & mod over one if I knew how to place order 2 a set number of pips away from first order?

Any help would be appreciated

Alien
  • Post #2
  • Quote
  • Sep 6, 2011 1:12am Sep 6, 2011 1:12am
  •  tigpips
  • | Joined May 2011 | Status: Member | 108 Posts
Hi Alien,

see if this is what you want. This is a scaling trade script.

Parameters used:

Slippage
Refers to the slippage used when a pending order is sent.

ScaleByPips
Indicates by how many pips you want the 2nd order to scale by. This setting is in pip value. Default is 20 pips.

Comment_Message
Refers to the comment message section of the pending order.

Magic
The pending order's magic number.

------------------------------------------------------------

In a nutshell, this script works by detecting whether or not there's an open order. Next, it will check if the open order is a buy order or a sell order. After which, it will take note of that order's Lot size, open price, take profit price, stop loss price. It will then calculate the new tp and sl price in your new pending order. If the open order has no take profit or stop loss indicated, it will just list them out as 0 tp and 0 sl in the pending order. The lot size used in the pending order will be same as the order it has taken reference from.

You can enable the comment section of your trade panel to see which order the script taking reference from.

If the order is a Buy open order, it will create a BUYSTOP pending order. Likewise, if the order is a Sell open order, it will create a SELLSTOP pending order.

Should there be any bugs, let me know.
Attached Image (click to enlarge)
Click to Enlarge

Name: Scaling script v1.jpg
Size: 140 KB
Attached File(s)
File Type: mq4 Scaling script v1.mq4   4 KB | 780 downloads
 
 
  • Post #3
  • Quote
  • Sep 6, 2011 5:07am Sep 6, 2011 5:07am
  •  AlienTrader
  • | Joined Mar 2011 | Status: Member | 53 Posts
hi tigpips,

thank you so much for your time (& brain power) !

Sorry no this is not what I am trying to do. My bad for perhaps poor explanation (working through head cold, tissues stuffed up each nostril).

I have seen multi order scripts that place say 3 orders at the same time at the same price. What I'm after is to do the same but have them at different price levels. But I do not want to input the price, just how many pips away from the first level.

So first input is choice of buy or sell, then if the inputs were 20, 40, 100 say, wherever I place my cursor it detects auto whether should be a limit or stop (above or below current price) & simultaneously places the orders.

Variable distances, stops & profits for each order as each level has its own inputs.

No need to detect if there is an open order already, there is no control order just a fresh line of orders at variable distances away.

Is this a clearer better explanation?

I do very much appreciate what you have done already.

Trade well

alien
 
 
  • Post #4
  • Quote
  • Sep 7, 2011 10:07am Sep 7, 2011 10:07am
  •  AlienTrader
  • | Joined Mar 2011 | Status: Member | 53 Posts
does anyone know what code is needed to place a second order x pips away from the first pending order?

So placing the script on the chart creates 2 orders, 1 where the cursor is & the 2nd one x pips away.

cheers

alien
 
 
  • Post #5
  • Quote
  • Sep 8, 2011 2:51am Sep 8, 2011 2:51am
  •  tigpips
  • | Joined May 2011 | Status: Member | 108 Posts
Ok I have changed the coding so that the script functions more like what you have described.

Added new variables:
Lots = 0.01
TakeProfit = 50
StopLoss = 50

Short Guide:

After placing the script in your "MT4 Broker/experts/scripts" folder.
1) Launch your MT4 terminal, fire up a chart.
2) Press Ctrl-N to bring up your Data Navigator panel. Scroll to "Scaling script v1.1".
3) Drag and Drop "Scaling script v1.1" to your chart window.
4) Remember to drop the script around the price level that you want.
5) Next an input window will pop. Adjust the Lot size and take profit and stoploss if you want. Else you can put take profit and stoploss as 0.
6) After this, a confirmation popup menu will pop on screen.
Attached Image (click to enlarge)
Click to Enlarge

Name: Scaling script v1.1-1.jpg
Size: 100 KB

7) If you can click "Yes" which represents "Buy", it will auto-calculate if your cursor position was above or below the current price level. If it is above, it will initiate a BUYSTOP pending order, if it is below, it will initiate a BUYLIMIT pending order.
8) Next it will create a 2nd pending order of the same type and scale it by X number of pips that you have decided in your input window.
9) Similarly, if you have clicked on "No", which represents "Sell. It will auto-calculate and decide whether to use a SELLSTOP or SELLLIMIT based on your cursor's position vs the current price.
10) It will also scale a 2nd pending order for either SELLSTOP or SELLLIMIT.

Here is what it looks like in the end:
Attached Image (click to enlarge)
Click to Enlarge

Name: Scaling script v1.1-2.jpg
Size: 134 KB
Attached File(s)
File Type: mq4 Scaling script v1.1.mq4   5 KB | 606 downloads
 
 
  • Post #6
  • Quote
  • Sep 9, 2011 2:23am Sep 9, 2011 2:23am
  •  AlienTrader
  • | Joined Mar 2011 | Status: Member | 53 Posts
tigpips thank you so much for creating the script & detailed explanation.

Now I can see how you have gone about scaling the next order I will try & mod for my needs.

You have been very kind & I appreciate your skills.

Thanks again & good trading

alien
 
 
  • Post #7
  • Quote
  • Sep 14, 2011 1:16pm Sep 14, 2011 1:16pm
  •  Trader88
  • | Joined Sep 2009 | Status: Member | 45 Posts
Dear tigpips,

tq for the great script...

I have another request to add here....could you add 1 more variable, that is "Number of Orders" so that our order not limited to 2 orders only?

For example, now the version 1.2 variable will be:

Lots:
Take Profit:
Stop Loss:
Number of Order:
Slippage:
Scale by Pips:
Comment:
Magic Number:

Any help would be appreciated

trader88
 
 
  • Post #8
  • Quote
  • Sep 15, 2011 4:52am Sep 15, 2011 4:52am
  •  tigpips
  • | Joined May 2011 | Status: Member | 108 Posts
Hi Trader88,

I have made the changes.

Added:
Number_of_Order_Cycle
This refers to the number of pending orders that will be sent.
Attached Image (click to enlarge)
Click to Enlarge

Name: Scaling script v1.2.jpg
Size: 156 KB
Attached File(s)
File Type: mq4 Scaling script v1.2.mq4   8 KB | 1,070 downloads
 
 
  • Post #9
  • Quote
  • Oct 17, 2011 2:02am Oct 17, 2011 2:02am
  •  hjabuadina
  • | Joined Jul 2009 | Status: hjabuadina | 10 Posts
Hi, i have used this scaling last week , it was wonderful cycle entry , but need to change instead drag and drop why not just one click system , drag and drop is sometime take a few minute to appear entry and excute sometime not at all, so miss my huge time to entry, i ,m suggesting if you could change system script into one click and the parameter are still good don't change it is much perfect.. thank you..

Scaler fan user
 
 
  • Post #10
  • Quote
  • Mar 26, 2013 1:57pm Mar 26, 2013 1:57pm
  •  MurphyMan
  • | Joined Sep 2009 | Status: Rule #1... Don't lose your pips | 197 Posts
Thank you for this valuable script.
 
 
  • Post #11
  • Quote
  • Apr 4, 2013 5:25am Apr 4, 2013 5:25am
  •  Mummyz
  • | Joined Jul 2011 | Status: FX-Syndicate | 18 Posts
This is the Script that I Need..
Thanks tigpips ScalpingScript V.1.2 works amazing for me..
Trade Safely with FX-Syndicate
 
 
  • Post #12
  • Quote
  • May 20, 2013 3:54am May 20, 2013 3:54am
  •  Redsunfx
  • | Joined May 2013 | Status: Member | 165 Posts
using ScalpingScript V.1.2 is it possible to get for example scale-in 3 steps but with the same SL ?
ex:
buy 1.3010 sl 1.3000
buy 1.3020 sl 1.3000
buy 1.3030 sl 1.3000
 
 
  • Post #13
  • Quote
  • Oct 8, 2013 4:33pm Oct 8, 2013 4:33pm
  •  King Singh
  • | Joined Feb 2010 | Status: Member | 78 Posts
Quoting tigpips
Disliked
Hi Trader88, I have made the changes. Added: Number_of_Order_Cycle This refers to the number of pending orders that will be sent. {image} {file}
Ignored
Hi tigpips,
Thanks a lot for the script. Will save me a lot of hassle.

Great job ..

p.s. If possible, can you do some modifications on this script. Or anyone who knows programming. I will pay for the work done. message me for details.
Thanks..!!
 
 
  • Post #14
  • Quote
  • May 12, 2014 5:33pm May 12, 2014 5:33pm
  •  2face
  • | Joined Jan 2012 | Status: Member | 90 Posts
tried to install the indi but did not show as among the list. Could somebody help me out on how to run it
 
 
  • Post #15
  • Quote
  • May 12, 2014 5:56pm May 12, 2014 5:56pm
  •  fxdaytrader_
  • Joined Jan 2011 | Status: UberTroll | 1,847 Posts
Quoting 2face
Disliked
tried to install the indi but did not show as among the list. Could somebody help me out on how to run it
Ignored
http://www.forexfactory.com/showthre...23#post7448823
(pls. read the 1. post of the thread also) ...
PM me with coding requests and I'll probably put you on my ignore list
 
 
  • Post #16
  • Quote
  • May 13, 2014 2:43am May 13, 2014 2:43am
  •  2face
  • | Joined Jan 2012 | Status: Member | 90 Posts
I tried to open the folder, but could end up with a file named log(C:\Users\[user name]\AppData\Roaming\MetaQuotes\Terminal\log). I am using 4.00 build 646 version.
Any other way to run the script. I tried to place it in C:\Program Files\Ava MetaTrader\experts\indicator and still didnt work
 
 
  • Post #17
  • Quote
  • Edited 3:11am May 13, 2014 2:52am | Edited 3:11am
  •  fxdaytrader_
  • Joined Jan 2011 | Status: UberTroll | 1,847 Posts
IT BELONGS TO C:\Users\USERNAME\AppData\Roaming\M etaQuotes\Terminal\UNIQE-TERMINAL-HASHCODE\MQL4\SCRIPTS

and please do not spam (double posts) my build 509-indicator thread, thanks
Attached File(s)
File Type: ex4 Scaling script v1.2.ex4   7 KB | 444 downloads
PM me with coding requests and I'll probably put you on my ignore list
 
 
  • Post #18
  • Quote
  • May 13, 2014 7:17am May 13, 2014 7:17am
  •  2face
  • | Joined Jan 2012 | Status: Member | 90 Posts
I said no such folder there. I am using window 7 (C:\Users\[user name]\AppData\Roaming\MetaQuotes\Terminal\log). The only folder in the Terminal is a folder named LOG
 
 
  • Post #19
  • Quote
  • May 13, 2014 7:21am May 13, 2014 7:21am
  •  fxdaytrader_
  • Joined Jan 2011 | Status: UberTroll | 1,847 Posts
another way to find the right folders:
Right-click some of you scripts in your mt4 and open them (edit) in the metaeditor.
in the editor, click "file" - "save as ...". a popup will show up in the path the script is located. So you can see which is the right folder ...
PM me with coding requests and I'll probably put you on my ignore list
 
 
  • Post #20
  • Quote
  • May 13, 2014 7:52am May 13, 2014 7:52am
  •  2face
  • | Joined Jan 2012 | Status: Member | 90 Posts
It works now. Is at the program files\ava meta trader\mql4\script
 
 
  • Platform Tech
  • /
  • Scaling in Script
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023