why ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
RedBerlin
Posts: 81
Joined: 05 Dec 2014

why ?

Postby RedBerlin » 18 Jun 2017

HI EVERYONE
I d like have a help about this that for some reason dasnt work!!!!thanks in advance

Code: Select all

inputs:
FastLength( 12 ),
SlowLength( 26 ),
MACDLength( 9 ),
starttrade (0800),
endtrade(1600),
dailyprofit(500),
dailyloss(250);


Variables:
todaynet(0),
yesterdaynet(0),
var0( 0 ),
var1( 0 ),
var2( 0 ) ;

var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;

if date <> date[1] then begin
yesterdaynet = NetProfit;
end;


todaynet = NetProfit + openpositionprofit - yesterdaynet;

condition1 = var2 crosses under 0 ;
condition2 = var2 crosses over 0 ;

condition98 = (-dailyloss < todaynet and todaynet < dailyprofit) and (Time > starttrade and time < endtrade);


if condition98 then begin
if condition1 then sellshort ( "MacdSE" ) next bar at market;
if condition2 then buy ( "MacdLE" ) next bar at market ;
end;
Last edited by RedBerlin on 18 Jun 2017, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: why ?

Postby TJ » 18 Jun 2017

Welcome back Redberlin:

Please see post #1 and post #2
viewtopic.php?t=11713

RedBerlin
Posts: 81
Joined: 05 Dec 2014

Re: why ?

Postby RedBerlin » 18 Jun 2017

It is nice to see you back Redberlin:

Please see post #1 and post #2
viewtopic.php?t=11713
Thanks TJ for nice welcoming.
Being myself not professional trader sometimes I try to earn money doing trading using overall multiharts that
I bought 3 yeard ago for autotradingbut recently I ve understood that it has a big pòtential of manual trading as well,with a historic 's
v olatily index as DAX To Germany,
coming on topic,I have no base or school or capacity of programming and your answer about topic 1,2 for me is arabisch.
after 2 years I have no still set stop loss
http://www.directa.it/pub2/it/howto/300/how304.html
the link above explain which kind of stop loss my broker ask.
at the time I was ño able to set in any code.
if is possible help is nice otherwise my lfe will go on without stop loss o topic solved.
ciao

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: why ?

Postby TJ » 18 Jun 2017

I am not a computer graduate.
I am not a professional programmer
Most of the people here are not trained in computer.

EasyLanguage is designed for people without programming experience.

The key is not in programming, but in identifying the problem.

Please see post #5
viewtopic.php?t=11713

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: why ?

Postby Angelina MultiСharts » 19 Jun 2017

Hello RedBerlin,

Please specify the exact issue you're having with this script.

RedBerlin
Posts: 81
Joined: 05 Dec 2014

Re: why ?

Postby RedBerlin » 01 Jul 2017

Code: Select all

inputs:
FastLength( 12 ),
SlowLength( 26 ),
MACDLength( 9 ),
starttrade (0800),
endtrade(1600),
dailyprofit(20),
dailyloss(50);


Variables:
todaynet(0),
yesterdaynet(0),
var0( 0 ),
var1( 0 ),
var2( 0 ) ;

var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;

if date <> date[1] then begin
yesterdaynet = NetProfit;
end;


todaynet = NetProfit + openpositionprofit - yesterdaynet;

condition1 = var2 crosses under 0 ;
condition2 = var2 crosses over 0 ;

condition98 = (-dailyloss < todaynet and todaynet < dailyprofit) and (Time > starttrade and time < endtrade);


if condition98 then begin
if condition1 then sellshort ( "MacdSE" ) next bar at market;
if condition2 then buy ( "MacdLE" ) next bar at market ;
end;
setprofittarget(20);
setstoploss(50);
Hello RedBerlin,

Please specify the exact issue you're having with this script.
HI ANGELINA
I ve inserted at the end of code :setprofittargrt(20)
my idea was :when during trading I ve reached 20 euro gain, just as example stop to trading until next day.
but it not happen,it continue to do trading altough after a few trades has profit 20 uro.
for sure I ve wrong in something, please give me a advice.
thanks

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: why ?

Postby Angelina MultiСharts » 13 Jul 2017

RedBerlin,

Please, send us an export of this workspace, export of your signal and export of the instrument from QuoteManager.

RedBerlin
Posts: 81
Joined: 05 Dec 2014

Re: why ?

Postby RedBerlin » 21 Jul 2017

RedBerlin,

Please, send us an export of this workspace, export of your signal and export of the instrument from QuoteManager.
HI
maybe it works but there is two problems
1 the main is =I 'D like at 1600 hour stop trading and close every position open but it doesnt.
2 i see the trade ends when reach target profit o stoploss,for example ,if there is a position open but indicator
call a new signal it ignore new signal until target is reach.

RedBerlin
Posts: 81
Joined: 05 Dec 2014

Re: why ?  [SOLVED]

Postby RedBerlin » 23 Jul 2017

RedBerlin,

Please, send us an export of this workspace, export of your signal and export of the instrument from QuoteManager.
HI
maybe it works but there is two problems
1 the main is =I 'D like at 1600 hour stop trading and close every position open but it doesnt.
2 i see the trade ends when reach target profit o stoploss,for example ,if there is a position open but indicator
call a new signal it ignore new signal until target is reach.
I solved


Return to “MultiCharts”