SetProfitTarget/SetStopLoss not working realtime

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

SetProfitTarget/SetStopLoss not working realtime

Postby 2haerim » 28 Jul 2008

Four InteractiveBroker's Crude oil symbol CLU8 1 min chart for 10 days back are plotted and a same signal below is applied to all the charts.
All charts set the unfilled stop/limit setting to 0 to use theoretical trading mode.

And each chart is set as follows:
Chart 1(upper left) : Autotrading off / SA mode
Chart 2(bottom left) : Autotrading off / AA mode
Chart 3(upper right) : Autotrading on / SA mode
Chart 4(bottom right): Autotrading on / AA mode


When I run MC and open this workspace, I got the screen shot CLU8_1min_Initial_041250.png.

As you see, all 4 charts show different signals. First of all, I need to know how to interpret these 4 charts signal appearances.

Next I turned on autotrading for two charts: one in SA mode and the other in AA mode. It is CLU8_1min_AutoOnFor2_041400.png.

Again some charts change their signal shapes. I need explanation here again why some charts change.

Third capture (CLU8_1min_AutoOnFor2_FirstSignal_AA_041600.png) was done when the first profit target was reached.

Again, all 4 charts react differently. Need explanation too.

The rest pictures are taken in the order of time sequence whenever something changed.


Things are very confusing depending on how the autotrading and SA/AA mode is set. I think we need a very clear and descriptive explanation about what differences there exist on those 4 charts.



Many signals including profit target and stop loss are displayed in history bars.

However, when the market is realtime, there are no signals are generated whatsoever.

Anyone can explain why?



Code: Select all

{
CL U8 - Settings(Price Scale:1/100, Daily Limit:1000, Min.Movement:1, Big Point Value:1000)
}



{1 min Chart}
Inputs: Rdays(5), HighLine(70), LowLine(30), StopA(50),ProfitA(50);
variable: MyRSI(0);


MyRSI=RSI(Close,Rdays);

{Entry}

{BUY}

If MyRSI[1]<HighLine And MyRSI[0]>HighLine Then
Buy next bar at market;

{SELL}

If MyRSI[1]>LowLine And MyRSI[0]<LowLine Then
Sellshort next bar at market;


{Exit}
{Profit Target}
setprofittarget(ProfitA);

{Protective Stop Loss}
setstoploss(StopA);
Attachments
CLU8_1min_Initial_041250.png
(122.88 KiB) Downloaded 287 times
CLU8_1min_AutoOnFor2_041400.png
(122.62 KiB) Downloaded 286 times
CLU8_1min_AutoOnFor2_FirstSignal_AA_041600.png
(122.58 KiB) Downloaded 282 times
CLU8_1min_AutoOnFor2_Signal_AA_042400.png
(121.17 KiB) Downloaded 285 times
CLU8_1min_AutoOnFor2_Signal_AA_043900.png
(118.46 KiB) Downloaded 289 times

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 28 Jul 2008

After experimenting more, it seems that SetStopLoss and SetProfitTarget does not work when Autotrading is on.

This could be a bug.

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 29 Jul 2008

It seems that when both SetStopLoss and SetProfitTarget are applied, one of them only works.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 29 Jul 2008

HaeRim,

I hope our conversation in the LiveChat has cleared the situation for you.
Will be waiting to receive the logs.


Return to “MultiCharts”