molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sat May 11, 2024 4:55 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Sell conditions met but no order placed.
PostPosted: Wed Nov 14, 2012 4:11 am 
Offline

Joined: Mon Jul 02, 2012 8:43 pm
Posts: 6
Hi there everyone,
I hope someone can help me out here. I'm new to Molanis and have no coding knowledge so please forgive any dumb mistakes or omissions. I tried starting with a simple EA, a bounce off an ATR line but something is quite wrong. If the conditions for a buy signal are met then the EA triggers a buy at market order from the account...great!! ...but if the conditions are met for a Sell order nothing happens and I can't figure out what the problem is. I've tried numerous indicators with different names but each has exactly the same parameters and exactly the same output on the chart but the problem is always the same. I've split the .mol file into 2 parts (buy & sell as attached), both files compile properly as an EA and attach to the chart properly but a sell deal is never done in backtesting or in "live" demo testing. Any ideas anyone and please remember coding is a foreign language to me.

Thanks

Chris


Attachments:
ChandelierStops_v1_YoYo.mq4 [3.02 KiB]
Downloaded 415 times
CSELL.mol [8.92 KiB]
Downloaded 399 times
CBUY.mol [8.92 KiB]
Downloaded 402 times
Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Fri Nov 16, 2012 12:01 pm 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
Hi cj

Your lot size is set to 0 in the sell block.

Please validate your diagram each time before you write the MT4 code to it. It will show you these errors.

Cheers,

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Fri Nov 16, 2012 7:57 pm 
Offline

Joined: Mon Jul 02, 2012 8:43 pm
Posts: 6
Sorry I must have attached the CSELL.mol before I had validated the diagram and generated the code. This particular diagram was one I created to display things as simply as I could....anyway I changed the Lot amount and re generated the code. Unfortunately the same result, not 1 sell trade in a 2 month period backtest on 5 pip range bars while the CBUY ea did
76 trades. I really can't understand why this is happening, in order to post this support request I created the CBUY.mol first then validated it , generated the code and got the EA which I then backtested and everything worked fine. So to create the CSELL.mol all I did was edit the price data (High to Low etc.) of the CBUY.mol without touching the other side of the Trading Rule Editor and save the file as CSELL.mol. I then validated the diagram and generated the code to create the EA so far no problem but in the backtest no deals at all even though I can see where the conditions were met.
I've attached the source code for the indicator (altough as I said in previous message I have tried this with 3 or 4 indicators of different names but which do exactly the same thing, all with the same reesult) and the .mol files but I have the wrong version of Molanis to get the source code for the EA's sorry.
I am at my wits end as to why I can't get such a simple stategy to work properly so I really hope you can help.

Thanks

Chris


Attachments:
CBUY.mol [8.92 KiB]
Downloaded 409 times
ChandelierStops_v1_YoYo.mq4 [3.02 KiB]
Downloaded 392 times
CSELL.mol [8.96 KiB]
Downloaded 408 times
Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Sat Nov 17, 2012 10:17 am 
Offline

Joined: Fri Feb 04, 2011 9:48 pm
Posts: 114
Location: Canada
The reason is this:

only change the < to > etc.
do not change the low symbol to high symbol, etc. Leave this part alone.

go back and delete the CSELL.mol, then open the BSELL.mol and then go save as and re-create the CSELL.mol.

Once you have re-created the CSELL.mol, only change the direction symbols, nothing else. Then save it, validate it, create Mt4 code and re-try it

Cheers,

_________________
Building a future with automated trading


Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Mon Nov 19, 2012 2:21 am 
Offline

Joined: Mon Jul 02, 2012 8:43 pm
Posts: 6
Thanks very much for your advice but unfortunately that didn't work.

By a process of elimination I have found where things go wrong but I have no idea why or how to fix it.

The attached mol file and EA are designed to trigger trades when price violates an atr stop line but then closes back on the original side i.e candle high above the line but close below the line should trigger sell trade and opposite for a buy, but only the buy signals are triggering trades. I'll attach a screenshot in next post immediately after this.


There are only 4 trading blocks used in the diagram. On the sell side, "candle high above indicator line" and "candle close below indicator line". On the buy side "candle low below indicator line" and "candle close above indicator line". The blocks on the buy side work perfectly well together. On the sell side if you use either of the blocks individually in the diagram (with either 1 or both of the buy blocks) the EA works. However if you then add the other sell block (which is the whole point of the sell side) the EA stops producing sell trades.

This is starting to do my head in. Any ideas please?


Attachments:
ChandelierStops_v1_YoYo.mq4 [3.02 KiB]
Downloaded 386 times
test 5.mol [11.7 KiB]
Downloaded 431 times
test 5.mq4 [89.07 KiB]
Downloaded 454 times
Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Mon Nov 19, 2012 2:22 am 
Offline

Joined: Mon Jul 02, 2012 8:43 pm
Posts: 6
This is a screenshot of the problem


Thanks

Chris


Attachments:
Capture 1.JPG
Capture 1.JPG [ 62.81 KiB | Viewed 5832 times ]
Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Mon Nov 19, 2012 9:05 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You have an error in the way you use the custom indicator.It has two signals 0 and 1. From the indicator's code:
SetIndexBuffer(0,UpBuffer1);
SetIndexBuffer(1,DnBuffer1);
So up signal is mode 0, and down signal is code 1. Change your ea to use both mode 0 (up), and mode 1 (down)


Top
 Profile  
 
 Post subject: Re: Sell conditions met but no order placed.
PostPosted: Wed Nov 21, 2012 2:05 am 
Offline

Joined: Mon Jul 02, 2012 8:43 pm
Posts: 6
That's terrific guys thanks very much, just changed the mode in the diagram and all working wonderfully.

Thanks again

Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009