Off Topic Posts - page 2

To add comments, please log in or register
Sam Sb
1
Sam Sb  
Hi guys !
Any one know C++. 
I have an issue about martingale, if a buying signal shows up, the EA enter the trade, if it's a loss martingale is activated for step 1,2,3...etc till it wins... but the problem is for exmple in step 3 a sell signal shows up the martingale keeps buying insted of selling and ading the step 3 amount into the sell!?

To be more claire here's an exmple:
Buys $2.. lost , step 1 martingale buys again $4 ...lost, step 2 mtg buys again $12 ... lost , in step 3 sell signal shows up martingale buys with $36 instead of selling with $36!?

Can anyone have an idea to add an Else If condition??
Keith Watford
Moderator
24191
Keith Watford  
Show the relevant code if you want assistance.
samsb31
1
samsb31  
Keith Watford:
Show the relevant code if you want assistance.

Here it is:

// if signal UP (CALL)

   if (AutoSignal && signal(up) && Time[0] > sendOnce) {
      mt2trading (asset, "CALL", TradeAmount, ExpiryMinutes, MartingaleType, MartingaleSteps, MartingaleCoef, Broker, SignalName, signalID);
      Print ("CALL - Signal sent!" + (MartingaleType != NoMartingale ? " [Martingale: Steps " + IntegerToString(MartingaleSteps) + ", Coefficient " + DoubleToString(MartingaleCoef,2) + "]" : ""));
      sendOnce = Time[0]; // Time stamp flag to avoid duplicated trades      
   }
      
   // if signal DOWN (PUT)
   if (AutoSignal && signal(dn) && Time[0] > sendOnce) {
      mt2trading (asset, "PUT", TradeAmount, ExpiryMinutes, MartingaleType, MartingaleSteps, MartingaleCoef, Broker, SignalName, signalID);
      Print ("PUT - Signal sent!" + (MartingaleType != NoMartingale ? " [Martingale: Steps " + IntegerToString(MartingaleSteps) + ", Coefficient " + DoubleToString(MartingaleCoef,2) + "]" : ""));
      sendOnce = Time[0]; // Time stamp flag to avoid duplicated trades
   }
   
      
   //--- return value of prev_calculated for next call

   return(rates_total);


Hope you can help

Sergey Golubev
Moderator
116886
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button


itrade31
8
itrade31  
Sergey Golubev:

I just got banned from the other account for no reason, 

By the way i managed to creat new one, so please i need an answer before i get banned again for no reason

// if signal UP (CALL)
   if (AutoSignal && signal(up) && Time[0] > sendOnce) {
      mt2trading (asset, "CALL", TradeAmount, ExpiryMinutes, MartingaleType, MartingaleSteps, MartingaleCoef, Broker, SignalName, signalID);
      Print ("CALL - Signal sent!" + (MartingaleType != NoMartingale ? " [Martingale: Steps " + IntegerToString(MartingaleSteps) + ", Coefficient " + DoubleToString(MartingaleCoef,2) + "]" : ""));
      sendOnce = Time[0]; // Time stamp flag to avoid duplicated trades      
   }
      
   // if signal DOWN (PUT)
   if (AutoSignal && signal(dn) && Time[0] > sendOnce) {
      mt2trading (asset, "PUT", TradeAmount, ExpiryMinutes, MartingaleType, MartingaleSteps, MartingaleCoef, Broker, SignalName, signalID);
      Print ("PUT - Signal sent!" + (MartingaleType != NoMartingale ? " [Martingale: Steps " + IntegerToString(MartingaleSteps) + ", Coefficient " + DoubleToString(MartingaleCoef,2) + "]" : ""));
      sendOnce = Time[0]; // Time stamp flag to avoid duplicated trades
   }
   
      
   //--- return value of prev_calculated for next call
   return(rates_total);
}
Keith Watford
Moderator
24191
Keith Watford  
itrade31:

I just got banned from the other account for no reason, 

By the way i managed to creat new one, so please i need an answer before i get banned again for no reason

It is not allowed to have multiple user names.

You asked your initial question

Sam Sb:

and then followed up as

samsb31:

so I guess that there was a reason. Weren't you notified of the reason?

Nelson Wanyama
963
Nelson Wanyama  
I was searching for the topic then I found it here. 😂✔✔
itrade31
8
itrade31  
Keith Watford:

It is not allowed to have multiple user names.

You asked your initial question

and then followed up as

so I guess that there was a reason. Weren't you notified of the reason?


No i didn't recieve anything, i don't even know how to use this platform , i just cam for a question it's above and i'm looking for answers if anyone could help with the martingale problem!!

If anyone know about C++ please read my message above and suggest me a solution.

itrade31
8
itrade31  
Nelson Wanyama:
I was searching for the topic then I found it here. 😂✔✔
do you face the same problem as me ? Lol
William Roeder
22339
William Roeder  
itrade31: help with the martingale problem!!
Martingale, guaranteed to blow your account eventually. If it's not profitable without, it is definitely not profitable with.
          Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum 2015.02.11

Why it won't work: Calculate Loss from Lot Pips - MQL5 programming forum 2017.07.11

To add comments, please log in or register