+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 44

Thread: (Ask) my EA only can open sell cannot open order buy

Hybrid View

  1. #1
    Junior Member nonamefx is an unknown quantity at this point nonamefx's Avatar
    Join Date
    Jul 2015
    Posts
    1
    Thanks
    0
    Thanked 6 Times in 1 Post
    SubscribeSubscribe
    subscribed 0

    (Ask) my EA only can open sell cannot open order buy

    hello i have created ea yesterday and today i was try to simulator but when i see my ea can't open order buy
    this is my ea code
    Spoiler Spoiler:
    extern int MagicNumber=0;
    extern double Lots =0.01;
    extern double StopLoss=5;
    extern double TakeProfit=100;
    extern int TrailingStop=3;
    extern int Slippage=0;
    //+------------------------------------------------------------------+
    // expert start function
    //+------------------------------------------------------------------+
    int start()
    {
    double MyPoint=Point;
    if(Digits==3 || Digits==5) MyPoint=Point*10;

    double TheStopLoss=0;
    double TheTakeProfit=0;
    if( TotalOrdersCount()==0 )
    {
    int result=0;
    if((iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)<iMA(NU LL,0,5,0,MODE_SMA,PRICE_CLOSE,0)))
    if((iMA(NULL,0,5,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NUL L,0,5,0,MODE_SMA,PRICE_CLOSE,0))) // Here is your open buy rule
    {
    result=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage ,0,0,"EA Generator www.ForexEAdvisor.com",MagicNumber,0,Blue);
    if(result>0)
    {
    TheStopLoss=0;
    TheTakeProfit=0;
    if(TakeProfit>0) TheTakeProfit=Ask+TakeProfit*MyPoint;
    if(StopLoss>0) TheStopLoss=Ask-StopLoss*MyPoint;
    OrderSelect(result,SELECT_BY_TICKET);
    OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(TheStopLoss,Digits),NormalizeDouble(TheTa keProfit,Digits),0,Green);
    }
    return(0);
    }
    if((iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NU LL,0,5,0,MODE_SMA,PRICE_CLOSE,0))) // Here is your open Sell rule
    {
    result=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippag e,0,0,"EA Generator www.ForexEAdvisor.com",MagicNumber,0,Red);
    if(result>0)
    {
    TheStopLoss=0;
    TheTakeProfit=0;
    if(TakeProfit>0) TheTakeProfit=Bid-TakeProfit*MyPoint;
    if(StopLoss>0) TheStopLoss=Bid+StopLoss*MyPoint;
    OrderSelect(result,SELECT_BY_TICKET);
    OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(TheStopLoss,Digits),NormalizeDouble(TheTa keProfit,Digits),0,Green);
    }
    return(0);
    }
    }

    for(int cnt=0;cnt<OrdersTotal();cnt++)
    {
    OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
    if(OrderType()<=OP_SELL &&
    OrderSymbol()==Symbol() &&
    OrderMagicNumber()==MagicNumber
    )
    {
    if(OrderType()==OP_BUY)
    {
    if((iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)<iMA(NU LL,0,5,0,MODE_SMA,PRICE_CLOSE,0))) //here is your close buy rule
    {
    OrderClose(OrderTicket(),OrderLots(),OrderClosePri ce(),Slippage,Red);
    }
    if(TrailingStop>0)
    {
    if(Bid-OrderOpenPrice()>MyPoint*TrailingStop)
    {
    if(OrderStopLoss()<Bid-MyPoint*TrailingStop)
    {
    OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*MyPoint,OrderTakeProfit(),0,Green);
    return(0);
    }
    }
    }
    }
    else
    {
    if((iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)<iMA(NU LL,0,5,0,MODE_SMA,PRICE_CLOSE,0))) // here is your close sell rule
    {
    OrderClose(OrderTicket(),OrderLots(),OrderClosePri ce(),Slippage,Red);
    }
    if(TrailingStop>0)
    {
    if((OrderOpenPrice()-Ask)>(MyPoint*TrailingStop))
    {
    if((OrderStopLoss()>(Ask+MyPoint*TrailingStop)) || (OrderStopLoss()==0))
    {
    OrderModify(OrderTicket(),OrderOpenPrice(),Ask+MyP oint*TrailingStop,OrderTakeProfit(),0,Red);
    return(0);
    }
    }
    }
    }
    }
    }
    return(0);
    }

    int TotalOrdersCount()
    {
    int result=0;
    for(int i=0;i<OrdersTotal();i++)
    {
    OrderSelect(i,SELECT_BY_POS ,MODE_TRADES);
    if (OrderMagicNumber()==MagicNumber) result++;

    }
    return (result);

    i hope anyone can solve my problem
    thanks before

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  2. The Following 6 Users Say Thank You to nonamefx For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), Kanwal (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19)

  3. #2
    Member babar hanif is a jewel in the rough babar hanif is a jewel in the rough babar hanif is a jewel in the rough babar hanif is a jewel in the rough babar hanif's Avatar
    Join Date
    Mar 2018
    Posts
    829
    Thanks
    2
    Thanked 332 Times in 235 Posts
    SubscribeSubscribe
    subscribed 0
    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai to apko wahan par sell ki ek our trade lga deni chahiye .

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  4. The Following 6 Users Say Thank You to babar hanif For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), Kanwal (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19)

  5. #3
    Member yaseenhfd is a splendid one to behold yaseenhfd is a splendid one to behold yaseenhfd is a splendid one to behold yaseenhfd is a splendid one to behold yaseenhfd is a splendid one to behold yaseenhfd is a splendid one to behold yaseenhfd's Avatar
    Join Date
    Dec 2018
    Posts
    310
    Thanks
    55
    Thanked 663 Times in 212 Posts
    SubscribeSubscribe
    subscribed 0
    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai to apko wahan par sell ki ek our trade lga deni chahiye .

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  6. The Following 5 Users Say Thank You to yaseenhfd For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19)

  7. #4
    Senior Member sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach's Avatar
    Join Date
    May 2019
    Location
    arifwala,pakistan
    Posts
    2,437
    Thanks
    2,605
    Thanked 4,089 Times in 1,728 Posts
    SubscribeSubscribe
    subscribed 0
    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai

    --- Update ---

    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai.

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  8. The Following 7 Users Say Thank You to sumerach For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), CJ7 (2020-10-20), Kanwal (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19)

  9. #5
    Senior Member sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach has a reputation beyond repute sumerach's Avatar
    Join Date
    May 2019
    Location
    arifwala,pakistan
    Posts
    2,437
    Thanks
    2,605
    Thanked 4,089 Times in 1,728 Posts
    SubscribeSubscribe
    subscribed 0
    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  10. The Following 7 Users Say Thank You to sumerach For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), CJ7 (2020-10-20), Kanwal (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19)

  11. #6
    Banned mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555 has much to be proud of mohsin555's Avatar
    Join Date
    Jun 2019
    Posts
    511
    Thanks
    26
    Thanked 1,195 Times in 451 Posts
    bro mujhe lagta hai k agar ap apni trade sell ki lagao market dekh kar our maarket buy ki taraf chali jay to mere keyal sy apko thora sa wait karna chahiye our jb apko lagy k ab market nechy any wali hai

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  12. The Following 7 Users Say Thank You to mohsin555 For This Useful Post:

    Alizahid (2020-10-20), Boss12 (2020-10-19), CJ7 (2020-10-20), Kanwal (2020-10-19), LOC (2020-10-20), raheel00 (2020-10-19), SubhanAllah (2020-10-20)

  13. #7
    Banned raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00 has a reputation beyond repute raheel00's Avatar
    Join Date
    Oct 2020
    Posts
    917
    Thanks
    13,532
    Thanked 7,014 Times in 1,355 Posts
    प्रतिशत आवंटन प्रबंधन मॉड्यूल, जिसे प्रतिशत आवंटन धन प्रबंधन या pamm के रूप में भी जाना जाता है, एक जमा धन विदेशी मुद्रा व्यापार का एक रूप है। एक निवेशक को अपनी पसंद के योग्य व्यापारी (एस) / मनी मैनेजर (एस) के वांछित अनुपात में अपना पैसा आवंटित करना पड़ता है

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  14. The Following 7 Users Say Thank You to raheel00 For This Useful Post:

    Alizahid (2020-10-20), bahi00 (2020-10-19), Boss12 (2020-10-19), CJ7 (2020-10-20), Kanwal (2020-10-19), LOC (2020-10-20), SubhanAllah (2020-10-20)

  15. #8
    Banned bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00 has a reputation beyond repute bahi00's Avatar
    Join Date
    Sep 2020
    Posts
    5,567
    Thanks
    35,053
    Thanked 39,440 Times in 7,688 Posts
    एक मुद्रा को हमेशा दूसरी मुद्रा के सापेक्ष कारोबार किया जाता है। यदि आप एक मुद्रा बेचते हैं, तो आप दूसरी खरीद रहे हैं, और यदि आप एक मुद्रा खरीदते हैं, तो आप दूसरी बेच रहे हैं। इलेक्ट्रॉनिक ट्रेडिंग की दुनिया में, आपके लेनदेन की कीमतों के बीच के अंतर पर एक लाभ होता है।

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  16. The Following 6 Users Say Thank You to bahi00 For This Useful Post:

    Alizahid (2020-10-20), Boss12 (2020-10-19), CJ7 (2020-10-20), Kanwal (2020-10-19), LOC (2020-10-20), SubhanAllah (2020-10-20)

  17. #9
    Banned Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12 has a reputation beyond repute Boss12's Avatar
    Join Date
    Sep 2020
    Posts
    3,995
    Thanks
    25,716
    Thanked 26,875 Times in 5,568 Posts
    एक मुद्रा को हमेशा दूसरी मुद्रा के सापेक्ष कारोबार किया जाता है। यदि आप एक मुद्रा बेचते हैं, तो आप दूसरी खरीद रहे हैं, और यदि आप एक मुद्रा खरीदते हैं, तो आप दूसरी बेच रहे हैं। इलेक्ट्रॉनिक ट्रेडिंग की दुनिया में, आपके लेनदेन की कीमतों के बीच के अंतर पर एक लाभ होता है।

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  18. The Following 4 Users Say Thank You to Boss12 For This Useful Post:

    Alizahid (2020-10-20), CJ7 (2020-10-20), LOC (2020-10-20), SubhanAllah (2020-10-20)

  19. #10
    Senior Member Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal has a reputation beyond repute Kanwal's Avatar
    Join Date
    Oct 2020
    Posts
    3,159
    Thanks
    5,607
    Thanked 8,955 Times in 2,594 Posts
    SubscribeSubscribe
    subscribed 0
    एक मुद्रा को हमेशा दूसरी मुद्रा के सापेक्ष कारोबार किया जाता है। यदि आप एक मुद्रा बेचते हैं, तो आप दूसरी खरीद रहे हैं, और यदि आप एक मुद्रा खरीदते हैं, तो आप दूसरी बेच रहे हैं। इलेक्ट्रॉनिक ट्रेडिंग की दुनिया में, आपके लेनदेन की कीमतों के बीच के अंतर पर एक लाभ होता है।

    Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.


  20. The Following 4 Users Say Thank You to Kanwal For This Useful Post:

    Alizahid (2020-10-20), CJ7 (2020-10-20), LOC (2020-10-20), SubhanAllah (2020-10-20)

+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Currently Active UsersCurrently Active Users

There are currently users online. members and guests

Forex Forum India | Forex Community Place Statistics Forex Forum India Statistics

Most users ever online was .

Welcome to our newest member,

Threads:

Posts:

Member: