Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (dBc), 17,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
automation #475486
12/14/18 12:37
12/14/18 12:37
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
Hello Community..

I would like to add a line of code to my script that will tell Zorro when not to trade, the line is "if the moving average (lets say SMAFast) im using is between the open and close of the previous one bar/candle i.e (the candle is not above/below the MA with it full body) zorro should not trade unless the condition is fulfilled.

Please help me put this in our lite-c language if, your help will highly be appreciated.

Thank you in advance.

Re: automation [Re: MINER] #475503
12/16/18 06:45
12/16/18 06:45
Joined: Aug 2018
Posts: 101
O
OptimusPrime Offline
Member
OptimusPrime  Offline
Member
O

Joined: Aug 2018
Posts: 101
Hi Miner:

Have you gone through the Workshops in the Manual? They are quite helpful.

For your current question, it may be easiest to use your condition as an if criteria that must be passed before your enterLong can be activated.

if(my_long_condition == true)
{

enterLong();
}
// For Example

if(NumOpenLong < 3)
enterLong();

In other cases, it may be appropriate to use the Phantom features of Zorro as described in the manual if that is more along the lines of what you need

// suspend trading after 4 losses in a row
if(LossStreakShort >= 4 || LossStreakLong >= 4)
setf(TradeMode,TR_PHANTOM); // phantom trades
else
resf(TradeMode,TR_PHANTOM); // normal trading



Last edited by OptimusPrime; 12/16/18 06:46.

Thanks so much,

OptimusPrime

Re: automation [Re: OptimusPrime] #475506
12/17/18 07:33
12/17/18 07:33
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
Thank you @ OptimusPrime, well noted and i appreciate this information.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1