You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
His code is CrossCondition was seen and now ChicospanCondition is seen.
If you still can't see it. Print out your variables, and find out why.
GumRai:
//Globalscope enum condition{ None,CrossedUp,CrossedDown }; condition CrossCondition=None;
The above is pseudo code amd will allow only 1 trade per cross
You should also include code to check only when a new bar opens
Thank you ,, but i didn't understand the code much ,, could you explain more if you don't mind
but this code mean that the both two conditions must be true in sametime ,, or not ??
No,
CrossCondition is a global variable that is initialized to None.
When a cross is detected CrossCondition is set to CrossedUp
if(CrossCondition==CrossedUp && ChicospanCondition) { Place Order; CrossCondition=None; }
In the same or following bars, CrossCondition remains set to CrossedUp until the Chicospan condition is met. Then a trade is placed and CrossCondition is set to None so that no more trades are placed on the same cross. Then the EA will check for a new cross.
Obviously you will also need code for the opposite cross.
thank you very much ,, but after creating the code and making a backtest ,, it opens only one order ,, and then ,, it doesn't open any more orders when new cross happens.
with this code i added a third condition which is (the price is above Kijun and tenken and span A and span b on M30 Timeframe) and fourth condition which is (Close[1] > Close[27] on M30 Timeframe)
It is right code ??