Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,499 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Scaling a plot #428835
09/04/13 07:40
09/04/13 07:40
Joined: Aug 2013
Posts: 124
D
DMB Offline OP
Member
DMB  Offline OP
Member
D

Joined: Aug 2013
Posts: 124
I am going to use this thread to ask questions as I develop my strategy. Since most of my questions will be minor I will keep them all in one thread.

I am coding an open range break out strategy similar to that which Larry Williams' taught. I am writing the code so that once I have one good algorithm, I can duplicate it and alter it for other filter conditions.

First question: I am trying to scale the plot so that I can see if the code is doing what I want it to do. But either the chart is to dense or no trades appear. See the example attached for the later. The odd thing is that the equity curve is shown, but not trades.

Below is my code so far for reference:

Quote:
// Open - ATR stop short entry with a close trend filter.
function tradeBOSTrend()
{

vars Price = series(price());

var BreakoutValue;
BreakoutValue = optimize(1,0.2,2,0.1) * (priceHigh(1)-priceLow(1));
var shortentry = priceOpen() - (BreakoutValue * (priceHigh(1)-priceLow(1)));

var stopFactor = optimize(1,0.2,2,0.1) ;
Stop = stopFactor * ATR(100);
Trail = stopFactor * ATR(100);

int compareClose = optimize(1,1,10,1);

if ( priceClose(1) < priceClose(compareClose) )
{

Entry = shortentry;
enterShort();
}


for(open_trades)
if(TradeIsOpen and TradeResult > 0)
exitTrade(ThisTrade);

}

function run()
{
set(PARAMETERS+LOGFILE); // use optimized parameters
BarPeriod = 1440; // Daily bars
LookBack = 150;
StartDate = 2007;
NumWFOCycles = 8; // activate WFO, 8 cycles

if(ReTrain) {
SelectWFO = -1; // when re-optimizing, select the last cycle only
UpdateDays = -1; // update price data from the server
}


while(asset(loop("EUR/USD")))
while(algo(loop("BO_S_Trend")))
{
if(strstr(Algo,"BO_S_Trend"))
tradeBOSTrend();

}


PlotBars = 100;
PlotScale = -10;
PlotWidth = 1000;
PlotHeight1 = 500;


}

Attached Files
Plot_no_trades.png (5 downloads)
Re: Scaling a plot [Re: DMB] #428840
09/04/13 10:28
09/04/13 10:28
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
"PlotBars" is not used anymore for scaling the chart. It was an experimental variable and only by mistake left in the documentation. That's why you see no trades.

For zooming a certain area of the chart, use StartDate and EndDate.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1