Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 609 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TradeIsEntry #487690
07/28/23 09:23
07/28/23 09:23
Joined: Jul 2023
Posts: 11
helsinki
M
Miska Offline OP
Newbie
Miska  Offline OP
Newbie
M

Joined: Jul 2023
Posts: 11
helsinki
Hello

I have started to code and trade with Zorro. Im just beginner and have only some codeing experience 13 years ago. Anyway, I have some problems with TradeIsEntry: PriseIsEntry dont regognice when the entry has done.

First solution, both are in run-function ():

//Entry, first

if((priceH(5)<priceH(4))....{
Entry=priceH(3);
Trade_price=priceH(3);
Counter1+=1;
}

// Examining if the first trade has been entered

if((TradeIsEntry) and (Counter1==1)){
Counter1+=1;
Trade_price=priceReal();

}

Second approch:

//Entry, first, in run function

if((priceH(5)<priceH(4))....{
enterLong(1,priceH(3),sl_10,0,0);
Trade_price=priceH(3);
Counter1+=1;
printf("Counter_BuyStop: %f\n",Counter1);
}

//Examine if trade is entried

int manage(){
if(TradeIsEntry) Counter1+=1;
return 0;
}

function run()
...

So how I can make the TradeIsEntry to work so I can determinate that stop limit has reached and trade is entried?

Thanks for your help

Miska

Re: TradeIsEntry [Re: Miska] #487693
07/28/23 17:11
07/28/23 17:11
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
It is hard to interpret your code snippets out of context. Post the full code.

Re: TradeIsEntry [Re: Miska] #487695
07/30/23 14:06
07/30/23 14:06
Joined: Jul 2023
Posts: 11
helsinki
M
Miska Offline OP
Newbie
Miska  Offline OP
Newbie
M

Joined: Jul 2023
Posts: 11
helsinki
Ok, understand... its little a bit diffucult to put all to the code...

Is it possbile to give some short code example how the TradeIsEntry work? How I can detect that Entry=priceH(3) has been generated to actual trade? Or is the TradeIsEntry only possbile way or easiest?

Thanks

Re: TradeIsEntry [Re: Miska] #487698
08/02/23 09:38
08/02/23 09:38
Joined: Jul 2023
Posts: 11
helsinki
M
Miska Offline OP
Newbie
Miska  Offline OP
Newbie
M

Joined: Jul 2023
Posts: 11
helsinki
Can anybody give a example...

Re: TradeIsEntry [Re: Miska] #487699
08/02/23 13:41
08/02/23 13:41
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
Did you even set up your TMF correctly? Are you pointing to it when you call enterLong/enterShort? If not, your code will not work.

These booleans will be set up whenever the TMF is called. Check them all and print stuff to the log to verify behavior:
TradeIsNewBar
TradeIsEntry
TradeIsStop
TradeIsProfit

At the bottom are some code samples showing a proper TMF setup:
https://zorro-project.com/manual/en/trade.htm

Re: TradeIsEntry [Re: AndrewAMD] #487701
08/03/23 09:28
08/03/23 09:28
Joined: Jul 2023
Posts: 11
helsinki
M
Miska Offline OP
Newbie
Miska  Offline OP
Newbie
M

Joined: Jul 2023
Posts: 11
helsinki
Ok, so when Im using TradeIsEntry all these trades or entries( stops) have to set up via tmf process. So I have to make these trades/entries before run-function in different TMF-prosedure(as it is in manual)? And after that I can check if TradeIsEntry. Ok, I ll try this. Thanks Andrew!

Re: TradeIsEntry [Re: AndrewAMD] #487722
08/10/23 10:32
08/10/23 10:32
Joined: Jul 2023
Posts: 11
helsinki
M
Miska Offline OP
Newbie
Miska  Offline OP
Newbie
M

Joined: Jul 2023
Posts: 11
helsinki
Thanks for help...algo is now working...


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1