Plotting indicators

Posted By: Pipinator

Plotting indicators - 12/06/12 03:52

Hello -

I hijacked the code from the tutorial and created a lowpass crossover trigger. I have many questions however what I would really like is better resolution when I plot the indicators, so I can see the trigger. Can I using the results button or do I need to log the data an plot in a different package.

Thanks!

T

BTW.. Lots of promise it would seem on this crossover. 213% and it is not trading the tops which I am very happy with.

function run()
{
set(PARAMETERS+FACTORS); // generate and use optimized parameters
BarPeriod = 240; // 4 hour bars
LookBack = 500; // needed for Fisher()
NumWFOCycles = 10; // activate WFO
NumBarCycles = 4; // 4 times oversampling

var *Price = series(price());
var *Trend = series(LowPass(Price,optimize(250,100,1000)));
var *TrendShort = series(LowPass(Price,30));
var *TrendLong = series(LowPass(Price,50));
var ma = MovingAverage(Price,200,MAType_SMA);
vars Signals = series(0);

Stop = optimize(4,2,8) * ATR(100);

if(ReTrain) {
UpdateDays = 30; // reload new price data from the server every 30 days
SelectWFO = -1; // select the last cycle for re-optimization
}

// portfolio loop
while(asset(loop("EUR/USD")))
{
// set up the margin
if(OptimalFLong > 0 and OptimalFShort > 0)
{
Margin = 100*(OptimalFLong+OptimalFShort);
//Margin += (WinTotal-LossTotal)/8 * (OptimalFLong+OptimalFShort);

Trail = 2*ATR(100);
TimeExit = 4;

if (crossOver(TrendShort,TrendLong)){
if(Sum(Signals+1,3) == 0)
enterLong();
Signals[0] = 1;
}
if (crossUnder(TrendShort,TrendLong)){
if(Sum(Signals+1,3) == 0)
enterShort();
Signals[0] = 1;
}

}
}

plot("Fast", *TrendShort, NEW, RED);
plot("Slow", *TrendLong, 0, BLUE);
PlotWidth = 800;
PlotHeight1 = 600;

}
Posted By: jcl

Re: Plotting indicators - 12/06/12 07:23

You can at first set a higher PlotWidth, such as 4000.

There's a limit, as you can not have extremely large images. For an even higher resolution, zoom in. In the code for the Workshop 4 lesson there's an out-commented part for zooming to a certain date.
Posted By: Pipinator

Re: Plotting indicators - 12/06/12 13:47

Thank you!
Posted By: SFF

Re: Plotting indicators - 12/07/12 16:13

Hi Pipinator,

When I clicked your script which I saved as lowpass.c I got those error massages.


Can't open lowpass.fac
Can't open lowpass_1.par

How can I test it successfully?

Thanks in advance.
© 2024 lite-C Forums