Chart Trader Vs Automatic Trading

Questions about MultiCharts and user contributed studies.
NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

Chart Trader Vs Automatic Trading

Postby NW27 » 13 Dec 2011

Hi All,

I've used the Chart Trader panel wiht the entry order & master strategies and I'm really happy with the way these work together.
The main thing relates to how the orders are handled. As an example -
I have a master Strategy that has the following configures :
1. A Stop Loss of 10 Pips
2. A Breakeven activated at +5, transaction cost 1.
3. Trailing Stop that kicks in a 7 points profit and is a 5 Point Stop Loss

Say I did a Buy at Market @ 4000 (It's nicely trending up :))
The charttrader put's in a Sell order when the Buy us filled @ 3990 (SL)
Price moves to BE ie 4005. The existing order gets changed from 3990 to 4001
Price moves to TS ie 4007. The existing order gets changed from 4001 to 4002
Etc etc.
Great :) At any one time there is only ONE exit order sitting at the exchange.

Now -

I've done some back testing in the past using the inbuilt back tester but when I come to actually using the strategy on the IB test account, I'm not happy with how it is operating.
In comparison to the above example :
In the Signal I Specify

setbreakeven(50);
setstoploss(10);
SetDollarTrailing(100);

Each one of these appears as a separate order in MC and at IB. So my concern here is if my internet went down, I have say 1 position long with 3 separate sell orders under it.
When the position is closed out, all of the orders disappear but only if MC is in control and doing this.


So, how do you write a script that only creates one order in the system that reflects the various stages of a trade as per the above Chart Trader panel example?

Neil.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Chart Trader Vs Automatic Trading

Postby Henry MultiСharts » 15 Dec 2011

Hello Neil.
You need to place the "strategy levels" consequentially.
That means that in your script you need to put the orders under conditions in order to generate them one after another.

You can find useful information about coding on the Power Language
at this web page under Additional information sources: https://www.multicharts.com/multicharts ... mentation/
PowerLanguage FAQ viewtopic.php?f=16&t=6929
Multicharts help file also has information about code words.
You can find it by clicking on the Help tab-> MC Help file in the main window of Multicharts.
We can also write a script for you as a custom paid project.

NW27
Posts: 177
Joined: 25 Dec 2010
Has thanked: 40 times
Been thanked: 85 times

Re: Chart Trader Vs Automatic Trading

Postby NW27 » 15 Dec 2011

Hi Henry or Others,

Say I'm trading on 5min bars.
I'm using "IntraBarOrderGeneration" and I go long 2min into the 5min bar.
I place a StopLoss order Ie Sell ("SL") 1 contract..... 5points below my EntryPrice;
3min Into the bar, I'm now at a breakeven level so I create a new order
Sell ("BE") 1 contract at EntryPrice on stop;

How do I cancel the "SL" order?
Otherwise I end up with 2 orders now at the broker, a "SL" and a "BE".

The alternate was to only have one Sell order at the end of the script and just changed the price level on the order to reflect the stage of the trade.
To be able to properly record the exits and reasons, I have tried creating a variable to be used as the Stop label ie Sell (Var1) but it says it must be a constant.
What next?

Neil.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Chart Trader Vs Automatic Trading

Postby Henry MultiСharts » 16 Dec 2011

The order is active until the next script calculation.
The order will be cancelled if the condition is not met.
If you need to cancel the order-you need to stop sending it from the script.


Return to “MultiCharts”