Script for Scaling in orders

User avatar
Aussiedoc
Trader
Posts: 270
Joined: Tue Dec 13, 2011 8:10 am
Location: Western District. Victoria. Australia

Script for Scaling in orders

Post by Aussiedoc »

BobbyT, thanks for this. :good: :good:

I'm having a struggle understanding. (Probably because today I feel like I am 800 years old.) so a question of clarification.

When you say
an initial TP of 50 pips on teh first order (and a TP of 10 pips on the final order)
does that mean that it opens 5 trades, all with the same entry & SL and then closes them at 10p,20p,30p,40p,50p or something else??

Thanks! :)
If you can never exceed your own expectations - why expect second-best?
BobbyT
Trader
Posts: 232
Joined: Thu Aug 21, 2014 1:34 am
Location: Seattle

Script for Scaling in orders

Post by BobbyT »

No worries.
The script has a function to use the same price as TP for all trades in the stack (SameSL_TP).
Setting it to true, in the example I gave would close the first order at 50p, the second at 40p and so on until the last order closes at 10p.
The original script didn't allow this and would throw an error as 5 trades x 10 pip step = 50 pips ( the same as the overall TP the example) and only makes sense when using FirstTradePending = flase.
It's a dirty hack but one that was reauired when sending the first order as a market order.
Hope I've made sense.

Cheers,
BobbyT
Procrastination provides exponentially negative returns - BobbyT
User avatar
Aussiedoc
Trader
Posts: 270
Joined: Tue Dec 13, 2011 8:10 am
Location: Western District. Victoria. Australia

Script for Scaling in orders

Post by Aussiedoc »

Love it!!

Means that it's pretty much the same as I do right now with separate 10p,20p,30p,40p & 50p scripts. My problem so far has been that that I get a staggered entry and, because each trade doesn't have a Magic number or comment I am limited to using the platform's TS.

I'll give it a go over the next few days and get back.

Cheers :)
If you can never exceed your own expectations - why expect second-best?
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Script for Scaling in orders

Post by Foreverforex »

Thank you for this script. I'm finally getting a hand on scalping and this is really efficient.

There is one part of the script logic that seems to be at odds with how I want to trade sometimes that I'm wondering if someone has the skills to address - I spent about 45 minutes staring at the code, hoping to be able to see a fix myself, but it's not within my brain power.

I get the "Numb Trades x ScalePips too high" error when I try to invoke settings that would let me 'ladder' or 'leapfrog' trades and TPs, instead of entering series of trades with all TPs falling after the last trade placed. For instance if I want to set 10 trades 5 pips apart, each one with an 8 pip TP, I get the error message. I want it starting as pending order where I drop it. I have set same TPSL as false.

Thanks in advance for the help if anyone can do it. If what I've explained isn't clear, I can try again. :arrrg:

Best,

FF

Add: Another funny thing happens with current script - If I place Buy Stop with 3 trades, 4 pips apart, TP of 15 and TPSL NOT set to same, all three trades enter and set correctly. If I try same settings with a Sell Stop, only two trades are set, the third one doesn't get placed. Odd?
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Script for Scaling in orders

Post by Foreverforex »

adding another scaling script here (originally from an old Captain Jack thread). It allows the trades to ladder up/overlap the way I'm trying to achieve. The only hiccup in this one is that for SellStop orders it sets a single TP instead of a unique TP for each trade. Doesn't do this on the BuyStop side. If anyone has the generosity to look under the hood and see if this can be fixed, I'd be very appreciative.

Thanks,

FF
You do not have the required permissions to view the files attached to this post.
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Script for Scaling in orders

Post by Foreverforex »

Oh Wow!! After about an hour, I think I made the fix myself!! a missing piece of code, declaring the value of the SameTPSL input, for the Sell Stop function and two - signs that should have been + signs.

Attached for anyone who might find it useful!!
You do not have the required permissions to view the files attached to this post.
hannele
Trader
Posts: 137
Joined: Wed Sep 19, 2012 2:31 am

Script for Scaling in orders

Post by hannele »

Thank you my clever friend :) much appreciated.

cheers
hannele
User avatar
Aussiedoc
Trader
Posts: 270
Joined: Tue Dec 13, 2011 8:10 am
Location: Western District. Victoria. Australia

Script for Scaling in orders

Post by Aussiedoc »

Thanks very much! :good: :good:
Cheers
If you can never exceed your own expectations - why expect second-best?
Post Reply

Return to “Scripts”