Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (dr_panther, VoroneTZ, AndrewAMD, vicknick, 7th_zorro), 824 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 6 of 7 1 2 3 4 5 6 7
Re: Pre-Market Volatility [Re: swingtraderkk] #427040
08/01/13 12:50
08/01/13 12:50
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Ah. Okay. thats new to me. Thanks for the correction. I will read it...

Re: Pre-Market Volatility [Re: Sundance] #427041
08/01/13 12:53
08/01/13 12:53
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
But when priceClose(0) is the close of the last closed bar what is priceOpen(0)? The open of the last closed bar and what is the open price of the current bar???

That really makes no sence to me.


This is what the manual shows me:

'priceClose() returns the close price of the current bar, i.e. the most recent price.'

When priceClose() = priceClose(0) then i don't think that priceClose(0) is the closing price of the last closed bar!


Re: Pre-Market Volatility [Re: Sundance] #427042
08/01/13 13:03
08/01/13 13:03
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
Sorry sundance,

I edited the previous post while you were replying.

priceOpen(0) is the opening price in this example of the bar from 5UTC to 6UTC i.e the price at 5am and priceClose(0) is the price at 6UTC.

See my edited post for questions on whether this changes when executing trade management functions at tick level in the newly forming bar - you would need priceClose() to give you the price of the last tick and priceOpen() to give the price from 6UTC and not 5UTC.

Re: Pre-Market Volatility [Re: swingtraderkk] #427043
08/01/13 13:13
08/01/13 13:13
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Okay. I think JCL has to clarify that. I really thought it would be the same as in Metatrader. Cause it did make sence...

Re: Pre-Market Volatility [Re: swingtraderkk] #427046
08/01/13 13:20
08/01/13 13:20
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
Condsidering we need a trade management function for the OCO (one cancels the other) aspects of the strategy:

enterLong (oco, var v0, var v1 ...): TRADE*

and we need to specify the entry,

enterLong(1,-15*PIP);


I assume the pending nature of the orders needs to be specified in the trade management function. i.e. we cannot use both syntaxes of the enterLong function.

I was hoping for a very simple trade management function running on each tick along the lines of

Code:
if (NumOpenLong >0) {exitShort();}



but if the trade management function also needs to handle the entering of the pending orders once only and not per tick then it gets more complex.

Is there another way of handling this?

Re: Pre-Market Volatility [Re: swingtraderkk] #427278
08/06/13 10:00
08/06/13 10:00
Joined: Jul 2013
Posts: 75
R
royal Offline OP
Junior Member
royal  Offline OP
Junior Member
R

Joined: Jul 2013
Posts: 75
I tried to use JCL's MyTMF function to handle the OCO in the script, but I implemented it wrong somehow, as the results did not change. Maybe someone can help laugh

Code:
int CancelOtherTrades = 0;

int MyTMF()
{
  if(TradeIsPending and CancelOtherTrades == 1)
    return 1;
  if(TradeIsOpen) {
    CancelOtherTrades = 1;
    ThisTrade->manage = 0; // terminate the TMF
  }
  return 0;
}


function run()
{
	NumWFOCycles = 3; 
	Spread = 1;
	BarPeriod = 60;
	set(TICKS|LOGFILE);		
	var Price = priceClose();


		if (hour() >= 8 && hour() < 9 && MyTMF() == 0){
		
			Stop = Price + 51*PIP;
			TakeProfit = Price + 1;
			printf("Price = %.f",Price);
			enterShort(2,-15*PIP);
			enterShort(1,-20*PIP);
			enterShort(1,-25*PIP);
		
			Stop = Price - 50*PIP;
			TakeProfit = Price;
			enterLong(2,-14*PIP);
			enterLong(1,-19*PIP);
			enterLong(1,-24*PIP);
		}
}


Re: Pre-Market Volatility [Re: royal] #427285
08/06/13 11:54
08/06/13 11:54
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Sundance: priceClose(0) is the close and priceOpen(0) is the open of the current bar.

royal: You need a TMF for OCO. Look here:

http://manual.zorro-trader.com/trade.htm

- there is explained what a TMF is and how to use it.


Re: Pre-Market Volatility [Re: jcl] #427286
08/06/13 12:02
08/06/13 12:02
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
I will think about that JCL. How can the current bar has a closed price?

when its 12:45 then the current H1 bar has an open price at (12:00), a current price (12:45) but no closed priced (13:00).

I will check the manual again...

Re: Pre-Market Volatility [Re: Sundance] #427288
08/06/13 12:26
08/06/13 12:26
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
A bar has always an open, hi, low, and close price. If you have 1-hour bars that start at every full hour, there is no 12:45 bar. There is only a 12:00 and a 13:00 bar. Otherwise you had no bars, but just a continuous price curve.

By convention, the time associated to a bar is its close time. This is the time when the "run" function is executed. Thus, a 12:00 bar is not the bar that begins at 12:00, it's the bar that closes at 12:00.

Re: Pre-Market Volatility [Re: jcl] #427291
08/06/13 13:08
08/06/13 13:08
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Surely i know that there is no H1 bar at 12:45 :-)
I said 'when its 12:45'... Just as an example time between 12:00 and 13:00 o'clock.

That is then the difference between Zorro and MT4 i wasn't 100% sure of.

Page 6 of 7 1 2 3 4 5 6 7

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