Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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: 98
O
OptimusPrime Offline
Junior Member
OptimusPrime  Offline
Junior Member
O

Joined: Aug 2018
Posts: 98
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