Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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