MQL Code Maker - page 4

 

Hey, nice that you've made your own CCI system with ZeroCode.

Yes, "Previous" means CLOSE PRICE of previous bar and "Current" means CURRENT PRICE. These two bars are the most commonly used, so I put these by default in the popup menu. I can put another one for a period of bars back. But I need 3 more "YES" from other traders.

is it possible to make the expert only run at certain hours?

Yes, it is possible. I can code that, but it would be better if someone point to an expert that uses this feature.

Anyway, Is VT open for download? I'd like to check that program, in case I can make ZeroCode produce the script for it.

 

The "10 minute strategy" does use it, I coded it succesfully but remembered it mostly worked at some times of the day. That is why I am looking for a way to do so.

Also is is MetaTrader that always has problems backtesting? everytime I test an expert it wont do Buy and Sell but only Buy....

Just pointing that out.

I dont know if VT is up for download but I'm gonna try to visit their office next weekend I'm going to New York with my family so I'll be going up the empire state building and I'll try to get a view of the stock pit

 

Gazuz, I'll take a look at "10 mins" expert, see if I can correct it.

Hey, watch the video walkthrough of creating a simple MACD Crossover expert at https://www.mql5.com/en/forum/194063.

 

Hi again,

Thought I'd give a little bit of feedback which might help in the development of ZeroCode.

I'm no MQL programmer but have some experience with MQ4. Ideally, if I'm playing around with ZeroCode, I'd like to be able to save the state of the ZeroCode logic, so maybe being able to save and load raw ZeroCode logic to a .zco file might be a future feature ?

Secondly, there needs to be some form of conditional logic not based solely on indicators i.e. consider this reasonably simple expert I alluded to above.

If Chart = Daily then

If Current Time = Bar Open Time + 4 hours then

If Bar Open Price > Current Price

Then

Place Buy Limit Order (at Bar Open Price) with S/L (Bar Low) with Profit (20 pips) and expire order in 24 hours

Else

Place Sell Limit Order (at Bar Open Price) with S/L (Bar High) with Profit (20 pips) and expire order in 24 hours

Not that big an expert really but is dependent (from what I can see) on Time and Bar type functions. I'm sure there's many others and you have probably already thought of them. ZeroCode is after all just in an early Beta 1 phase.

Hope this helps in some way

Martin

 

First of all, thanks to your suggestion very much.

Rastarr:
Secondly, there needs to be some form of conditional logic not based solely on indicators i.e. consider this reasonably simple expert I alluded to above. If Chart = Daily then If Current Time = Bar Open Time + 4 hours then If Bar Open Price > Current Price Then Place Buy Limit Order (at Bar Open Price) with S/L (Bar Low) with Profit (20 pips) and expire order in 24 hours Else Place Sell Limit Order (at Bar Open Price) with S/L (Bar High) with Profit (20 pips) and expire order in 24 hours

Actually, ZeroCode Beta 1 already support this condition. In next beta, this feature will be out interactively in the popup menu with indicators. One thing is not yet code is Entry Order instead of Market order option. Try below logics:

Buy logics:

AND Period = 1440

AND Hour = 4

AND Open > PriceBid

Sell logics:

AND Period = 1440

AND Hour = 4

AND Open <= PriceBid

In summary, next betas features:

- MQ4 support

- Custom indicator support

- Save the system (indicators and logics) to file

- Buy and Sell Entry Orders support

- More advance functions in popup menu

 

Scorpion,

Thanks for the newbie coding help - appreciated.

I plugged all that in and produced an mql which I've attached.

Last code block as follows doesn't make much sense to me on the entry conditions - both buy and sell would produce the same in my opinion.


// Check for BUY entry signal
If IsBuying and IsSelling=False and IsClosing=False then
{
// Buy
If StopLoss>0 then
{
RealSL=Ask-StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Ask+TakeProfit*Point;
}
SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED);
Alert("Reversal Beta 1: Buying");
};

// Check for SELL entry signal
If IsSelling and IsBuying=False and IsClosing=False then
{
// Sell
If StopLoss>0 then
{
RealSL=Bid+StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Bid-TakeProfit*Point;
}
SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,RED);
Alert("Reversal Beta 1: Selling");
};

As an aside, can placing Limits simply be a find/replace on the Buy/Sell instructions ? Forgive my lack of knowledge on mql

Cheers

Martin

Files:
 

Rastarr,

Sell and Buy will not happen at the same time, unless you give the same logics to both Buy and Sell.

As an aside, can placing Limits simply be a find/replace on the Buy/Sell instructions ? Forgive my lack of knowledge on mql

Yes, you can find & replace SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED) and SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,R ED)

 

Thanks Scorpion for the info - most helpful.

It's at least allowed me to hack the resultant MQL into what I was trying to achieve given my redementary knowledge.

Thanks

Martin

 

Hi,

I downloaded the ZeroCode yesterday and I already think that this thing is a marvel. You did an incredible job in making this program for all the dummies like me. It will probably help me understand how to program on Metatrader. I think that you should add an «open file» so we could be able to modify our code after back-testing it. It would be nice to have the same program but for custom indicator.

Good job

JF

 

Is it possible to modify the code so an openposition is not close when there is a contrary signal so it close only when it hits its S/L or T/P or its close signal.

JF