Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,008 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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 | 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