Gamestudio Links
Zorro Links
Newest Posts
Why Zorro supports up to 72 cores?
by 11honza11. 04/26/24 08:55
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, VoroneTZ, Quad, 1 invisible), 837 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Skipped Trades #473851
08/22/18 11:33
08/22/18 11:33
Joined: May 2018
Posts: 8
A
Adey Offline OP
Newbie
Adey  Offline OP
Newbie
A

Joined: May 2018
Posts: 8
I have a script which I am testing on Demo.

I have a bunch of skipped trades at the beginning with the message.

Skipped (outside 9912..153697)

I am guessing it has something to do with lookback or preload, but not sure. I did not have verbose set so I cannot look there.

I have checked the manual.

If someone could give me an idea then that would be great.

Re: Skipped Trades [Re: Adey] #473853
08/22/18 14:33
08/22/18 14:33
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Can you post the script?

Re: Skipped Trades [Re: AndrewAMD] #473854
08/22/18 15:03
08/22/18 15:03
Joined: May 2018
Posts: 8
A
Adey Offline OP
Newbie
Adey  Offline OP
Newbie
A

Joined: May 2018
Posts: 8
Hi,

Script is below with the logic removed.

The skipped has only appeared whilst demo trading, does not happen on a back test.

/////////////////////

#include<profile.c>

function run()
{
set(PLOTNOW|PARAMETERS|LOGFILE);
// set(TICKS);
NumCores = -1;
// Verbose = 3;

// is = 0 .. oos = 1
int mydate = 2;
switch(mydate)
{
case 0:
//IS DATES
StartDate= 20100101;
EndDate = 20131231;
break;
case 1:
//OOS DATES
StartDate = 20140101;
EndDate = 20180101;
break;
case 2:
//full data
StartDate = 20170101;
// EndDate = 20180701;
break;
}

LookBack = 7200;
BarPeriod = 10;
BarOffset = 0;
// StartWeek = 70000;
// EndWeek = 52200;
Weekend = 3;

assetList("AssetsDarwin");
// Capital = 1000;
// var mysize = Lots = round(7 * sqrt( 1 + (WinTotal-LossTotal)/Capital));
var mysize = Lots = 10;

if(is(INITRUN)) ccyReset();



TimeFrame = 6;

if(week(0) != week(1)) ccyReset();
while(asset(loop("AUD/USD","GBP/USD","USD/CHF","USD/CAD","EUR/USD","NZD/USD","USD/JPY")))
{
vars Prices = series(price());
ccySet(ROC(Prices,1)); // store price change as strength
}

string longAsset = ccyMax();
string shortAsset = ccyMin();

// long atr
asset(longAsset);

var len = 50;
var Lrng[51];

int i, N = 0;

for(i=0; i < (LookBack/6) && N < len; i++)
{
if(hour(i) == hour(0) && minute(i) == minute(0))
{
calc something
N++;
}
}
vars longprice = series(price(),31);
var longtrend = (LowPass(longprice,15) - LowPass(longprice,30))/PIP;


// short atr
asset(shortAsset);

var Srng[51];

int i, N = 0;

for(i=0; i < (LookBack/6) && N < len; i++)
{
if(hour(i) == hour(0) && minute(i) == minute(0))
{
calc something
N++;
}
}
vars shortprice = series(price());
var shorttrend = (LowPass(shortprice,15) - LowPass(shortprice,30))/PIP;

double mySMed = mycalc
double myLMed = mycalc
double percLong = mycalc
double percShort = mycalc ;

var upThreshold = 8;
var downThreshold = 12;


// 10min for entry

TimeFrame = 1;

static double fracHigh = 0;
static double fracLow = 0;

// longs

asset(longAsset);

if (priceHigh(0) > HH(12,1) )
{
fracHigh = priceHigh(0);
// if (NumOpenLong == 0 )
if (NumOpenLong == 0 && percLong >= 0.0010 && longtrend >= upThreshold)
{

algo("1st");
for(current_trades) {if(TradeIsPending) exitTrade(ThisTrade);}
EntryTime = 50;
Stop = percLong;
TakeProfit = myLMed;
enterLong(mysize,-percLong);

// algo("2nd");
// for(current_trades) {if(TradeIsPending) exitTrade(ThisTrade);}
// EntryTime = 50;
// Stop = percLong;
// TakeProfit = percLong;
// Trail = myLMed;
// TrailStep = 50;
// enterLong(mysize,-percLong);
}
}

// shorts

asset(shortAsset);
if (priceLow(0) < LL(12,1) )
{
fracLow = priceLow(0);
if (NumOpenShort == 0 )
if (NumOpenShort == 0 && percShort >= 0.0010 && shorttrend <= downThreshold*-1)
{
algo("1stS");
for(current_trades) {if(TradeIsPending) exitTrade(ThisTrade);}
EntryTime = 50;
Stop = percShort;
TakeProfit = mySMed;
enterShort(mysize,-percShort);

// algo("2ndS");
// for(current_trades) {if(TradeIsPending) exitTrade(ThisTrade);}
// EntryTime = 50;
// Stop = percShort;
// TakeProfit = percShort;
// Trail = mySMed;
// TrailStep = 50;
// enterShort(mysize,-percShort);
}
}

///-------------------
/// Plotting

//PlotBars = -1000;
PlotHeight1 = 700;
PlotHeight2 = 500;
PlotWidth = 1300;
PlotScale = 8;

// if (priceHigh(0) > HH(20,1)) plot("HH", priceHigh(0),DOT,BLUE);
// if (priceLow(0) < LL(20,1)) plot("LL", priceLow(0),DOT,YELLOW);

// ColorEquity = ColorDD = 0;

// plotPriceProfile(20,0); //put these at entries to record and with number of bars and 0 for long and 2 for short
//plotProfitHack(1);
// plotTradeProfile(50);
//plotMAEGraph(10);
//plotMFEGraph(10);
// plotDay(Equity,0);
// plotWeek(Equity,0);
//plotMonth(Equity,0);
// plotYear(Equity,1);

// plot periodic profitability

// static int periodWin;
// static int periodCount;
// if(is(INITRUN)) {periodWin = 0; periodCount =0;}
// periodWin += plotDayProfitHack();
// if(day(0) != day(1)) {periodCount +=1;}

// periodWin += plotWeekProfitHack();
// if(week(0) != week(1)) {periodCount +=1;}

// periodWin += plotMonthProfitHack();
// if(month(0) != month(1)) {periodCount +=1;}

// periodWin += plotQuarterProfitHack();
// if(is(EXITRUN)) printf("nWinning Periods: %d out of %d", periodWin, periodCount);

//printf("nStop: %.4f", (var)Stop);
//if(is(EXITRUN)) watch("Stop", (Stop * Lots * PIPCost/PIP)/(MarginMax+(MAE*1.5)));
print(TO_REPORT,"nTotal Equityttt%.2f nTotal Profit(inc Op)t%.2f nMaxDD/Return(<.60)tt%.2f nMin Equity(Max Margin)t%.2f nReturn/DD > 2ttt%.2f nAverage Loss Perctt%.2f",Balance,ProfitTotal, MAE/ProfitClosed, MarginMax+(MAE*1.5), ProfitClosed/DrawDownMax, (LossTotal/NumLossTotal)/(MarginMax+(MAE*1.5)) );
}

///////////////////////

Obviously the code will not run without the logic of the system. But you can see the the structure.

Thanks in advance.


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