Hi,
I'm Italian, my english in not good. Sorry.
i'm testing MC ( free 30 days ).
I'd like to test the function backtest ok trading system.
Where can i find a script of a simple trading system ?
Thanks
Davide
simple t.s. example
Re: simple t.s. example
this is a default MC script :
____________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
____________________________________________
Can you help me tu write an exit ?
Thanks
____________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
____________________________________________
Can you help me tu write an exit ?
Thanks
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: simple t.s. example
You need to open the power language editor, then select "file", then " open", then select "signals", that's where the systems are located...
(In charting the power editor is the Fx icon at the top of the page.) there is also an icon on your desktop..
(In charting the power editor is the Fx icon at the top of the page.) there is also an icon on your desktop..
Re: simple t.s. example
thanks.You need to open the power language editor, then select "file", then " open", then select "signals", that's where the systems are located...
(In charting the power editor is the Fx icon at the top of the page.) there is also an icon on your desktop..
I found some default t.s. but are not ready to run.
For exemple this
_____________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
_____________________________________
What can i write to complete this system ?
Thanks
Davide
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: simple t.s. example
go back to where you found the above code,this is a default MC script :
____________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
____________________________________________
Can you help me tu write an exit ?
Thanks
then look for the next strategy name "MovingAverage2line Cross SE".
Re: simple t.s. example
Thanks.
I typed this script mixing the two t.s.
________________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
condition2 = CurrentBar > 1 and var0 crosses under var1 ;
if condition2 then
Sell Short ( "MA2CrossSE" ) next bar at market ;
_________________________________________________
Is it correct ?
Thanks
I typed this script mixing the two t.s.
________________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
condition2 = CurrentBar > 1 and var0 crosses under var1 ;
if condition2 then
Sell Short ( "MA2CrossSE" ) next bar at market ;
_________________________________________________
Is it correct ?
Thanks
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: simple t.s. example
Hello davide007,
If you have tried to combine MovAvg2Line Cross LE and MovAvg2Line Cross SE into a single code reverse strategy then the code is correct.
If you have tried to combine MovAvg2Line Cross LE and MovAvg2Line Cross SE into a single code reverse strategy then the code is correct.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: simple t.s. example
Give it a try, you can't damage anything. (just don't go live on real money account).Thanks.
I typed this script mixing the two t.s.
________________________________________________
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE" ) next bar at market ;
condition2 = CurrentBar > 1 and var0 crosses under var1 ;
if condition2 then
Sell Short ( "MA2CrossSE" ) next bar at market ;
_________________________________________________
Is it correct ?
Thanks
Another way to do it is to apply both strategies to your chart.
ps. Helpful FAQ for learning EasyLanguage:
viewtopic.php?f=16&t=6929
You will find EasyLanguage a powerful tool for the traders.