automation

Posted By: MINER

automation - 12/14/18 12:37

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.
Posted By: OptimusPrime

Re: automation - 12/16/18 06:45

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


Posted By: MINER

Re: automation - 12/17/18 07:33

Thank you @ OptimusPrime, well noted and i appreciate this information.
© 2024 lite-C Forums