Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (firecrest, AndrewAMD, Quad), 389 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Wrong closure #467157
07/18/17 17:16
07/18/17 17:16
Joined: Dec 2016
Posts: 5
Como
Stark Offline OP
Newbie
Stark  Offline OP
Newbie

Joined: Dec 2016
Posts: 5
Como
Hi everyone, this is a simple system, I want to open long at 05.00 and close at 11.00 on Tuesday. Today the position is open at 05.00 and closed at 05.03. Does anyone know why? Thank you.

#include <profile.c>
function run()
{
set(PARAMETERS+LOGFILE);
StartDate= 20160601;
EndDate = 20170530;
BarPeriod =60 ;


Lots=20;

StopFactor= 1.0;
Stop= 42*PIP;



if ( dow()==2 && tod()==0500 && NumOpenLong==0 )
{

enterLong();
}


if (tod()==1100)
{
exitTrade();
}



//PlotBars = 100;
//PlotDate=20170510;
set(PLOTNOW);
//plotMAEGraph(-5);
plot("ATR", ATR(50), NEW, RED);

//plotWeek (priceClose(), 50);

}

Re: Wrong closure [Re: Stark] #467158
07/18/17 17:45
07/18/17 17:45
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
From the manual
"All stop, profit, trail, or entry limits are handled by software and controlled at each tick. They are not sent to the broker's server (except for the 'safety net' stop given by StopFactor) and thus not visible to the broker, this way preventing "stop hunting" or similar practices. This also steps around NFA Compliance Rule 2-43(b) that does not allow US citizens to place stop or profit targets."

Without more information, my best guess is that the stop loss was hit.
Check the testtrades.csv in the log directory, you should see the reason there.

Re: Wrong closure [Re: Dalla] #467163
07/18/17 19:38
07/18/17 19:38
Joined: Dec 2016
Posts: 5
Como
Stark Offline OP
Newbie
Stark  Offline OP
Newbie

Joined: Dec 2016
Posts: 5
Como
...,Long,EUR/CAD,52927365,20,2017-07-18 05:00,2017-07-18 05:03,1.45865,1.45897,4.39,0.00,Stop

This is what I found on trades.csv, It looks like the position has taken a stop


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