Can someone tell me why this happens - MetaTrader | futures io social day trading
futures io futures trading


Can someone tell me why this happens
Updated: Views / Replies:812 / 5
Created: by ryangillespie Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Can someone tell me why this happens

  #1 (permalink)
Elite Member
london, England
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: CL
 
ryangillespie's Avatar
 
Posts: 34 since Nov 2011
Thanks: 9 given, 1 received

Can someone tell me why this happens

Can anyone tell me why this code only opens long positions and doesn't open on the next bar after a signal. It also open a trade as soon as i start the EA regardless of when the signal was i.e x bars ago

Thank you

 
Code
                            
//+------------------------------------------------------------------+
//|                                                  A Daytrader.mq4 |
//|                                                               RG |
//|                                                                  |
//+------------------------------------------------------------------+

//---- input parameters

extern double    TakeProfit=70.0;
extern double    Lots=3;
extern double    TrailingStop=15.0;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//---- 
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   
return(0);
  }


//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//---- 

   
   
int cnttickettotal;
   
double ArrowUpArrowDown;
   
   
   
   if(
Bars<100)
     {
      Print(
"bars less than 100");
      return(
0);  
     }
   if(
TakeProfit<10)
     {
      Print(
"TakeProfit less than 10");
      return(
0);  // check TakeProfit
     
}
     
     
      
ArrowUp iCustom(NULL,0,"PZ_DayTrading",0,1);
      
ArrowDown iCustom(NULL,0,"PZ_DayTrading",1,1);
   
   
   
   
total  OrdersTotal(); 
   if(
total 1
     
     {
       if  (
ArrowUp!=1)
         {
            
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"DayTrader",12345,0,Green);
            if(
ticket>0)
              {
               if(
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
              }
            
            return(
0);
         }
         else if (
ArrowDown!=2)
         {

            
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"DayTrader",12345,0,Red);
            if(
ticket>0)
              {
               if(
OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
              }
            
            return(
0);
         }
         return(
0);
     }
   for(
cnt=0;cnt<total;cnt++)
     
   return(
0);
  }
//+----------------------------------------------------------- 

Reply With Quote
 
  #2 (permalink)
Elite Member
Chicago, IL
 
Futures Experience: None
Platform: NT8,NT7,TWS,FOREX.COM app
Broker/Data: InteractiveBrokers, NinjaTrader Brokerage FOREX.COM, IQFeed
Favorite Futures: The one I'm creating in the present....ES, ZF, ZN, ZB, FX pairs
 
Blash's Avatar
 
Posts: 1,557 since Nov 2011
Thanks: 4,515 given, 2,336 received
Forum Reputation: Legendary

Only problem is what you are asking for in debugging this code can quickly turn into a very time consuming effort. Did you write it?

It is an axiomatic fact that while you meditate you are speaking with your own spirit. In that state of mind you put certain questions to your spirit and the spirit answers: the light breaks forth and the reality is revealed.
The steed of this Valley is pain; and if there be no pain this journey will never end.
Buy Low And Sell High (read left to right or right to left....lol)
Reply With Quote
 
  #3 (permalink)
Elite Member
london, England
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: CL
 
ryangillespie's Avatar
 
Posts: 34 since Nov 2011
Thanks: 9 given, 1 received


Hi, thanks for the reply.

I have pulled bits of code from other EAs as I am trying to write my own, and failing. Any assistance on how to correct the issue would be greatly appreciated.

Reply With Quote
 
  #4 (permalink)
Elite Member
Chicago, IL
 
Futures Experience: None
Platform: NT8,NT7,TWS,FOREX.COM app
Broker/Data: InteractiveBrokers, NinjaTrader Brokerage FOREX.COM, IQFeed
Favorite Futures: The one I'm creating in the present....ES, ZF, ZN, ZB, FX pairs
 
Blash's Avatar
 
Posts: 1,557 since Nov 2011
Thanks: 4,515 given, 2,336 received
Forum Reputation: Legendary

I assumed it was C# Ninja code because your info says you use Ninja as your platform. But I now see this thread is in the Metatrader sub-forum.
I only do Ninja stuff and very badly at that.....lol
Maybe if you post the file someone might have a better chance of helping out and maybe if you can have a more concrete question narrowed down to a piece of code within the whole....????

It is an axiomatic fact that while you meditate you are speaking with your own spirit. In that state of mind you put certain questions to your spirit and the spirit answers: the light breaks forth and the reality is revealed.
The steed of this Valley is pain; and if there be no pain this journey will never end.
Buy Low And Sell High (read left to right or right to left....lol)
Reply With Quote
The following user says Thank You to Blash for this post:
 
  #5 (permalink)
Elite Member
london, England
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: CL
 
ryangillespie's Avatar
 
Posts: 34 since Nov 2011
Thanks: 9 given, 1 received

https://www.mql5.com/en/charts/3681899/eurusd-m15-fxprimus-ltd

Here you can see a long position open a few bars after the short signal, should have been a short trade. Still no buy orders. No idea whats happening , can anyone help.

Have a missed something in the code relating to my order management.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
jammu, india
 
Futures Experience: None
Platform: metatrader
Favorite Futures: Stocks
 
Posts: 2 since Aug 2015
Thanks: 0 given, 0 received

Can You elaborate

Hi, can you elaborate it as I the the informative provided by you is insufficient.

Reply With Quote

Reply



futures io > > > > Can someone tell me why this happens

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     


All times are GMT -4. The time now is 07:13 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.09 seconds with 18 queries on phoenix via your IP 54.92.194.75